|
@@ -6,10 +6,7 @@ import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.management.platform.entity.*;
|
|
import com.management.platform.entity.*;
|
|
-import com.management.platform.mapper.CustomMapper;
|
|
|
|
-import com.management.platform.mapper.SysDictMapper;
|
|
|
|
-import com.management.platform.mapper.SysFormMapper;
|
|
|
|
-import com.management.platform.mapper.UserMapper;
|
|
|
|
|
|
+import com.management.platform.mapper.*;
|
|
import com.management.platform.service.ContactsService;
|
|
import com.management.platform.service.ContactsService;
|
|
import com.management.platform.service.CustomService;
|
|
import com.management.platform.service.CustomService;
|
|
import com.management.platform.service.WxCorpInfoService;
|
|
import com.management.platform.service.WxCorpInfoService;
|
|
@@ -60,6 +57,12 @@ public class CustomController {
|
|
private WxCorpInfoService wxCorpInfoService;
|
|
private WxCorpInfoService wxCorpInfoService;
|
|
@Autowired
|
|
@Autowired
|
|
private ContactsService contactsService;
|
|
private ContactsService contactsService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private TaskMapper taskMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private BusinessOpportunityMapper businessOpportunityMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private SalesOrderMapper salesOrderMapper;
|
|
|
|
|
|
|
|
|
|
@RequestMapping("list")
|
|
@RequestMapping("list")
|
|
@@ -203,6 +206,35 @@ public class CustomController {
|
|
for (String id : ids1.split(",")) {
|
|
for (String id : ids1.split(",")) {
|
|
ids.add(Integer.parseInt(id));
|
|
ids.add(Integer.parseInt(id));
|
|
}
|
|
}
|
|
|
|
+ //任务
|
|
|
|
+ Integer taskCount = taskMapper.selectCount(new LambdaQueryWrapper<Task>()
|
|
|
|
+ .ne(Task::getStatus,2)
|
|
|
|
+ .eq(Task::getIsDelete,0)
|
|
|
|
+ .in(Task::getCustomId, ids));
|
|
|
|
+ if(null!=taskCount&&taskCount>0){
|
|
|
|
+ msg.setError("选中客户仍有任务,无法删除");
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+ //商机
|
|
|
|
+ Integer boCount = businessOpportunityMapper.selectCount(new LambdaQueryWrapper<BusinessOpportunity>()
|
|
|
|
+ .eq(BusinessOpportunity::getIsDelete,0)
|
|
|
|
+ .in(BusinessOpportunity::getCustomerId, ids)
|
|
|
|
+ );
|
|
|
|
+ if(null!=boCount&&boCount>0){
|
|
|
|
+ msg.setError("选中客户仍有商机,无法删除");
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //销售订单
|
|
|
|
+ Integer salesCount = salesOrderMapper.selectCount(new LambdaQueryWrapper<SalesOrder>()
|
|
|
|
+ .eq(SalesOrder::getIsDelete,0)
|
|
|
|
+ .in(SalesOrder::getCustomId, ids));
|
|
|
|
+ if(null!=salesCount&&salesCount>0){
|
|
|
|
+ msg.setError("选中客户仍有销售订单,无法删除");
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
customService.isDelete(ids);
|
|
customService.isDelete(ids);
|
|
msg.setMsg("操作成功");
|
|
msg.setMsg("操作成功");
|
|
} else {
|
|
} else {
|