| | |
| | | import com.core.common.R; |
| | | import com.core.domain.KeyValueVo; |
| | | import com.zy.crm.common.web.BaseController; |
| | | import com.zy.crm.manager.entity.Item; |
| | | import com.zy.crm.manager.entity.Plan; |
| | | import com.zy.crm.manager.entity.PriQuoteBudget; |
| | | import com.zy.crm.manager.entity.PriSales; |
| | | import com.zy.crm.manager.service.ItemService; |
| | | import com.zy.crm.manager.service.PlanService; |
| | | import com.zy.crm.manager.service.PriQuoteBudgetService; |
| | | import com.zy.crm.manager.service.PriSalesService; |
| | | import com.zy.crm.manager.entity.*; |
| | | import com.zy.crm.manager.service.*; |
| | | import org.apache.poi.xssf.usermodel.XSSFSheet; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private PriSalesService priSalesService; |
| | | |
| | | @Autowired |
| | | private PriQuoteService priQuoteService; |
| | | |
| | | @RequestMapping(value = "/priQuoteBudget/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/priQuoteBudget/add/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth(memo = "添加报价预算单") |
| | | public R add(@RequestBody Map<String,Object> map) { |
| | | PriSales priSales = priSalesService.selectById(Long.parseLong(map.get("priSalesId").toString())); |
| | | |
| | |
| | | priQuoteBudget.setTitle(map.get("title").toString()); |
| | | priQuoteBudget.setTemplateName(priSales.getTemplateName()); |
| | | priQuoteBudget.setSheetData(map.get("sheetData").toString()); |
| | | priQuoteBudget.setPriSalesId(Long.parseLong(map.get("priSalesId").toString())); |
| | | priQuoteBudget.setItemId(priSales.getItemId()); |
| | | //保存产品费用明细订单号 |
| | | priQuoteBudget.setOrderNum(priSales.getInOrderNum()); |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/priQuoteBudget/addOther/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth(memo = "另存报价预算单") |
| | | public R addOther(@RequestBody Map<String,Object> map) { |
| | | PriQuoteBudget quote = priQuoteBudgetService.selectById(Long.parseLong(map.get("id").toString())); |
| | | |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/priQuoteBudget/update/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth(memo = "更新报价预算单") |
| | | public R update(@RequestBody Map<String,Object> map){ |
| | | PriQuoteBudget priQuoteBudget = priQuoteBudgetService.selectById(Long.parseLong(map.get("id").toString())); |
| | | priQuoteBudget.setTitle(map.get("title").toString()); |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/priQuoteBudget/updateForm/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth(memo = "更新报价预算单") |
| | | public R updateForm(Long id,String templateName,String title){ |
| | | PriQuoteBudget priQuoteBudget = priQuoteBudgetService.selectById(id); |
| | | priQuoteBudget.setTemplateName(templateName); |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/priQuoteBudget/delete/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth(memo = "删除报价预算单") |
| | | public R delete(Long[] ids){ |
| | | if (Cools.isEmpty(ids)){ |
| | | return R.error(); |
| | | } |
| | | for (Long id : ids){ |
| | | int priQuote= priQuoteService.selectCount(new EntityWrapper<PriQuote>().eq("ori_quote_budget_id", id)); |
| | | if (priQuote!=0){ |
| | | return R.error("存在关联的报价单,禁止删除!!!"); |
| | | } |
| | | } |
| | | priQuoteBudgetService.deleteBatchIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | |
| | | for (PriQuoteBudget priQuoteBudget : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", priQuoteBudget.getId()); |
| | | map.put("value", priQuoteBudget.getInOrderNum() + "/" + priQuoteBudget.getPlanId$() + "/" + priQuoteBudget.getMemberId$()); |
| | | map.put("value", priQuoteBudget.getInOrderNum() + "/" + priQuoteBudget.getPlanId$() + "/" + priQuoteBudget.getMemberId$() + "/" + priQuoteBudget.getTemplateName()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |