src/main/java/com/zy/crm/manager/controller/CstmrController.java
@@ -153,9 +153,9 @@ @ManagerAuth(memo = "删除甲方单位") public R delete(@RequestParam(value="ids[]") Long[] ids){ for (Long id : ids){ int cstmr_id = orderService.selectCount(new EntityWrapper<Order>().eq("cstmr_id", id)); if (cstmr_id!=0){ return R.error("存在关联跟踪项目,禁止删除!!!"); int order = orderService.selectCount(new EntityWrapper<Order>().eq("cstmr_id", id)); if (order!=0){ return R.error("存在关联的跟踪项目,禁止删除!!!"); } cstmrService.deleteById(id); } src/main/java/com/zy/crm/manager/controller/OrderController.java
@@ -15,8 +15,10 @@ import com.zy.crm.manager.entity.CstmrFoll; import com.zy.crm.manager.entity.Order; import com.zy.crm.manager.entity.OrderFoll; import com.zy.crm.manager.entity.Plan; import com.zy.crm.manager.service.OrderFollService; import com.zy.crm.manager.service.OrderService; import com.zy.crm.manager.service.PlanService; import com.zy.crm.system.entity.Role; import com.zy.crm.system.entity.User; import com.zy.crm.system.service.UserService; @@ -40,6 +42,8 @@ @Autowired private OrderService orderService; @Autowired private PlanService planService; @RequestMapping(value = "/order/{id}/auth") @ManagerAuth @@ -114,8 +118,12 @@ @ManagerAuth(memo = "删除跟踪项目") public R delete(@RequestParam(value="ids[]") Long[] ids){ for (Long id : ids){ int plan = planService.selectCount(new EntityWrapper<Plan>().eq("order_id", id)); if (plan!=0){ return R.error("存在关联的规划单,禁止删除!!!"); } orderService.deleteById(id); } } return R.ok(); } src/main/java/com/zy/crm/manager/controller/PlanController.java
@@ -19,13 +19,8 @@ import com.zy.crm.common.utils.SetOfUtils; import com.zy.crm.common.web.BaseController; import com.zy.crm.manager.controller.result.FollowerTableVo; import com.zy.crm.manager.entity.Order; import com.zy.crm.manager.entity.Plan; import com.zy.crm.manager.entity.PlanFoll; import com.zy.crm.manager.entity.PlanType; import com.zy.crm.manager.service.PlanFollService; import com.zy.crm.manager.service.PlanService; import com.zy.crm.manager.service.PlanTypeService; import com.zy.crm.manager.entity.*; import com.zy.crm.manager.service.*; import com.zy.crm.system.entity.User; import com.zy.crm.system.service.DeptService; import com.zy.crm.system.service.UserService; @@ -64,6 +59,8 @@ private DeptService deptService; @Autowired private OssService ossService; @Autowired private PriOnline2Service priOnline2Service; @GetMapping(value = "/plan/{id}/auth") @ManagerAuth @@ -215,7 +212,11 @@ @ManagerAuth(memo = "删除规划申请单") public R delete(@RequestParam(value="ids[]") Long[] ids){ for (Long id : ids){ planService.deleteById(id); int priOnline2 = priOnline2Service.selectCount(new EntityWrapper<PriOnline2>().eq("item_id", id)); if (priOnline2!=0){ return R.error("存在关联的核价单,禁止删除!!!"); } planService.deleteById(id); } return R.ok(); } src/main/java/com/zy/crm/manager/controller/PriOnline2Controller.java
@@ -11,12 +11,8 @@ import com.core.common.R; import com.core.domain.KeyValueVo; import com.zy.crm.common.web.BaseController; import com.zy.crm.manager.entity.Plan; import com.zy.crm.manager.entity.Pri; import com.zy.crm.manager.entity.PriOnline2; import com.zy.crm.manager.service.PlanService; import com.zy.crm.manager.service.PriOnline2Service; import com.zy.crm.manager.service.PriService; import com.zy.crm.manager.entity.*; import com.zy.crm.manager.service.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.io.ClassPathResource; import org.springframework.util.ClassUtils; @@ -39,6 +35,12 @@ @Autowired private PlanService planService; @Autowired private PriSalesService priSalesService; @Autowired private CstmrService cstmrService; @RequestMapping(value = "/priOnline2/{id}/auth") @ManagerAuth @@ -111,7 +113,7 @@ PriOnline2 priOnline2 = new PriOnline2(); priOnline2.setCreateTime(new Date()); priOnline2.setTitle(map.get("title").toString()); priOnline2.setTemplateName(map.get("title").toString()); // priOnline2.setTemplateName(map.get("title").toString()); priOnline2.setSheetData(map.get("sheetData").toString()); priOnline2.setItemId(Long.parseLong(map.get("itemId").toString())); SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); @@ -130,6 +132,9 @@ // Item item = itemService.selectById(priOnline.getItemId()); Plan plan = planService.selectById(priOnline2.getItemId()); priOnline2.setMemberId(plan.getUserId()); Cstmr cstmr = cstmrService.selectById(plan.getCstmrId()); priOnline2.setTemplateName(cstmr.getName()); //甲方单位名称 //设置项目流程 @@ -277,6 +282,12 @@ if (Cools.isEmpty(ids)){ return R.error(); } for (Long id : ids){ int priSales = priSalesService.selectCount(new EntityWrapper<PriSales>().eq("pri_online2_id", id)); if (priSales!=0){ return R.error("存在关联的产品费用明细,禁止删除!!!"); } } priOnline2Service.deleteBatchIds(Arrays.asList(ids)); return R.ok(); } @@ -303,7 +314,8 @@ for (PriOnline2 priOnline2 : page.getRecords()){ Map<String, Object> map = new HashMap<>(); map.put("id", priOnline2.getId()); map.put("value", priOnline2.getOrderNum() + "/" + priOnline2.getPlanId$() + "/" + priOnline2.getMemberId$()); // map.put("value", priOnline2.getOrderNum() + "/" + priOnline2.getPlanId$() + "/" + priOnline2.getMemberId$()); map.put("value", priOnline2.getOrderNum() + "/" + priOnline2.getTemplateName()); result.add(map); } return R.ok(result); src/main/java/com/zy/crm/manager/controller/PriQuoteBudgetController.java
@@ -12,14 +12,8 @@ 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; @@ -43,6 +37,9 @@ @Autowired private PriSalesService priSalesService; @Autowired private PriQuoteService priQuoteService; @RequestMapping(value = "/priQuoteBudget/{id}/auth") @ManagerAuth @@ -108,6 +105,7 @@ 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()); @@ -199,6 +197,12 @@ 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(); } @@ -225,7 +229,7 @@ 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); src/main/java/com/zy/crm/manager/controller/PriQuoteController.java
@@ -129,6 +129,7 @@ priQuote.setTitle(map.get("title").toString()); priQuote.setTemplateName(priQuoteBudget.getTemplateName()); priQuote.setSheetData(map.get("sheetData").toString()); priQuote.setOriQuoteBudgetId(Long.parseLong(map.get("priQuoteBudgetId").toString())); priQuote.setItemId(priQuoteBudget.getItemId()); priQuote.setOrderNum(priQuoteBudget.getInOrderNum()); SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); src/main/java/com/zy/crm/manager/controller/PriSalesController.java
@@ -12,14 +12,8 @@ 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.PriOnline; 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.PriOnlineService; 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; @@ -39,10 +33,13 @@ private PriSalesService priSalesService; @Autowired private PriOnlineService priOnlineService; private PriOnline2Service priOnline2Service; @Autowired private PlanService planService; @Autowired private PriQuoteBudgetService priQuoteBudgetService; @RequestMapping(value = "/priSales/{id}/auth") @ManagerAuth @@ -101,15 +98,16 @@ @RequestMapping(value = "/priSales/add/auth") @ManagerAuth(memo = "添加产品费用明细") public R add(@RequestBody Map<String,Object> map) { PriOnline priOnline = priOnlineService.selectById(Long.parseLong(map.get("priOnlineId").toString())); PriOnline2 priOnline2 = priOnline2Service.selectById(Long.parseLong(map.get("priOnlineId").toString())); PriSales priSales = new PriSales(); priSales.setCreateTime(new Date()); priSales.setTitle(map.get("title").toString()); priSales.setTemplateName(priOnline.getTemplateName()); priSales.setTemplateName(priOnline2.getTemplateName()); priSales.setSheetData(map.get("sheetData").toString()); priSales.setItemId(priOnline.getItemId()); priSales.setOrderNum(priOnline.getOrderNum()); priSales.setPriOnline2Id(Long.parseLong(map.get("priOnlineId").toString())); priSales.setItemId(priOnline2.getItemId()); priSales.setOrderNum(priOnline2.getOrderNum()); SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); priSales.setInOrderNum(format.format(new Date())); @@ -198,6 +196,12 @@ if (Cools.isEmpty(ids)){ return R.error(); } for (Long id : ids){ int priQuoteBudget= priQuoteBudgetService.selectCount(new EntityWrapper<PriQuoteBudget>().eq("pri_sales_id", id)); if (priQuoteBudget!=0){ return R.error("存在关联的报价预算单,禁止删除!!!"); } } priSalesService.deleteBatchIds(Arrays.asList(ids)); return R.ok(); } @@ -224,7 +228,7 @@ for (PriSales priSales : page.getRecords()){ Map<String, Object> map = new HashMap<>(); map.put("id", priSales.getId()); map.put("value", priSales.getInOrderNum() + "/" + priSales.getPlanId$() + "/" + priSales.getMemberId$()); map.put("value", priSales.getInOrderNum() + "/" + priSales.getPlanId$() + "/" + priSales.getMemberId$()+"/" + priSales.getTemplateName()); result.add(map); } return R.ok(result); src/main/java/com/zy/crm/manager/entity/PriQuote.java
@@ -119,6 +119,10 @@ @TableField("template") private String template; @ApiModelProperty(value= "上级id") @TableField("ori_quote_budget_id") private Long oriQuoteBudgetId; public PriQuote() {} public PriQuote(String title,String sheetData,Date createTime,String filepath,Integer settle) { src/main/java/com/zy/crm/manager/entity/PriQuoteBudget.java
@@ -86,6 +86,10 @@ @TableField("member_id") private Long memberId; @ApiModelProperty(value= "上级id") @TableField("pri_sales_id") private Long priSalesId; @ApiModelProperty(value= "创建部门") @TableField("dept_id") private Long deptId; src/main/java/com/zy/crm/manager/entity/PriSales.java
@@ -9,6 +9,7 @@ import com.zy.crm.manager.service.ItemService; import com.zy.crm.manager.service.OrderService; import com.zy.crm.manager.service.PlanService; import com.zy.crm.manager.service.PriSalesService; import com.zy.crm.system.entity.User; import com.zy.crm.system.service.UserService; import org.springframework.format.annotation.DateTimeFormat; @@ -87,6 +88,10 @@ @TableField("in_order_num") private String inOrderNum; @ApiModelProperty(value= "上级id") @TableField("pri_online2_id") private Long priOnline2Id; @ApiModelProperty(value= "业务员") @TableField("member_id") private Long memberId; @@ -115,6 +120,14 @@ } return null; } public String getPriOnline2Id$() { PriSalesService priSalesService = SpringUtils.getBean(PriSalesService.class); PriSales priSales = priSalesService.selectById(this.priOnline2Id); if (!Cools.isEmpty(priSales)){ return String.valueOf(priSales.getId()); } return null; } public String getUpdateTime$(){ if (Cools.isEmpty(this.updateTime)){ src/main/resources/mapper/PriSalesMapper.xml
@@ -9,6 +9,7 @@ <result column="sheet_data" property="sheetData" /> <result column="create_time" property="createTime" /> <result column="dept_id" property="deptId" /> <result column="pri_online2_id" property="priOnline2Id" /> </resultMap> src/main/webapp/static/js/priOnline2/priOnline.js
@@ -169,7 +169,7 @@ } else { layer.confirm('确定删除'+(ids.length===1?'此':ids.length)+'条数据吗', function(){ $.ajax({ url: baseUrl+"/priOnline/delete/auth", url: baseUrl+"/priOnline2/delete/auth", headers: {'token': localStorage.getItem('token')}, data: {ids: ids}, method: 'POST', @@ -207,7 +207,7 @@ 'fields': fields }; $.ajax({ url: baseUrl+"/priOnline/export/auth", url: baseUrl+"/priOnline2/export/auth", headers: {'token': localStorage.getItem('token')}, data: JSON.stringify(param), dataType:'json', src/main/webapp/views/priQuoteBudget/priQuoteBudget.html
@@ -127,12 +127,12 @@ </div> </div> <div class="layui-form-item"> <label class="layui-form-label">项目名: </label> <div class="layui-input-block"> <input class="layui-input" id="planId" disabled placeholder="请输入项目名" autocomplete="off" lay-verify="required"> </div> </div> <!-- <div class="layui-form-item">--> <!-- <label class="layui-form-label">项目名: </label>--> <!-- <div class="layui-input-block">--> <!-- <input class="layui-input" name="name" disabled placeholder="请输入项目名" autocomplete="off" lay-verify="required">--> <!-- </div>--> <!-- </div>--> <div class="layui-form-item"> <label class="layui-form-label">核价单号: </label> src/main/webapp/views/priSales/priSales.html
@@ -115,24 +115,30 @@ <div class="layui-row"> <div class="layui-col-md12"> <div class="layui-form-item"> <label class="layui-form-label layui-form-required">订单号: </label> <label class="layui-form-label layui-form-required">核价单号: </label> <div class="layui-input-block cool-auto-complete"> <input class="layui-input" name="id" placeholder="请输入订单号" style="display: none" lay-verify="required"> <input id="orderNum" name="orderNum" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="请输入订单号" onfocus=this.blur()> <input class="layui-input" name="id" placeholder="请输入核价单号" style="display: none" lay-verify="required"> <input id="orderNum" name="orderNum" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="请输入核价单号" onfocus=this.blur()> <div class="cool-auto-complete-window"> <input class="cool-auto-complete-window-input" data-key="priOnlineQueryBydirector" onkeyup="autoLoad(this.getAttribute('data-key'))"> <select class="cool-auto-complete-window-select" data-key="priOnlineQueryBydirectorSelect" onchange="confirmed(this.getAttribute('data-key'),getItemInfo)" multiple="multiple"> <input class="cool-auto-complete-window-input" data-key="priOnline2QueryBydirector" onkeyup="autoLoad(this.getAttribute('data-key'))"> <select class="cool-auto-complete-window-select" data-key="priOnline2QueryBydirectorSelect" onchange="confirmed(this.getAttribute('data-key'),getItemInfo)" multiple="multiple"> </select> </div> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">项目名: </label> <div class="layui-input-block"> <input class="layui-input" id="planId" disabled placeholder="请输入项目名" autocomplete="off" lay-verify="required"> </div> </div> <!-- <div class="layui-form-item">--> <!-- <label class="layui-form-label">项目名: </label>--> <!-- <div class="layui-input-block">--> <!-- <input class="layui-input" id="planId" disabled placeholder="请输入项目名" autocomplete="off" lay-verify="required">--> <!-- </div>--> <!-- </div>--> <!-- <div class="layui-form-item">--> <!-- <label class="layui-form-label layui-form-required">项目名: </label>--> <!-- <div class="layui-input-block">--> <!-- <input class="layui-input" id="planId" type="text" name="planId" placeholder="请输入项目名" autocomplete="off">--> <!-- </div>--> <!-- </div>--> </div> </div>