Commit d492daced4678b8bb6cfc258dd48f0825b15fd03

Authored by YunaiV
1 parent 6a6f669c

📖 CRM:code review 跟进记录

yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/vo/CrmClueRespVO.java
@@ -111,4 +111,5 @@ public class CrmClueRespVO { @@ -111,4 +111,5 @@ public class CrmClueRespVO {
111 @Schema(description = "客户描述", example = "25682") 111 @Schema(description = "客户描述", example = "25682")
112 @ExcelProperty("客户描述") 112 @ExcelProperty("客户描述")
113 private String description; 113 private String description;
  114 +
114 } 115 }
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerServiceImpl.java
@@ -318,9 +318,10 @@ public class CrmCustomerServiceImpl implements CrmCustomerService { @@ -318,9 +318,10 @@ public class CrmCustomerServiceImpl implements CrmCustomerService {
318 if (poolConfig == null || !poolConfig.getEnabled()) { 318 if (poolConfig == null || !poolConfig.getEnabled()) {
319 return 0; 319 return 0;
320 } 320 }
321 - // 获取没有锁定的不在公海的客户 321 + // 1. 获取没有锁定的不在公海的客户
322 List<CrmCustomerDO> customerList = customerMapper.selectListByLockStatusAndOwnerUserIdNotNull(Boolean.FALSE); 322 List<CrmCustomerDO> customerList = customerMapper.selectListByLockStatusAndOwnerUserIdNotNull(Boolean.FALSE);
323 List<CrmCustomerDO> poolCustomerList = CollectionUtils.filterList(customerList, customer -> { 323 List<CrmCustomerDO> poolCustomerList = CollectionUtils.filterList(customerList, customer -> {
  324 + // TODO @puhui999:建议这里作为一个查询条件哈,不放内存里过滤;
324 // 1.1 未成交放入公海 325 // 1.1 未成交放入公海
325 if (!customer.getDealStatus()) { 326 if (!customer.getDealStatus()) {
326 return (poolConfig.getDealExpireDays() - LocalDateTimeUtils.between(customer.getCreateTime())) <= 0; 327 return (poolConfig.getDealExpireDays() - LocalDateTimeUtils.between(customer.getCreateTime())) <= 0;
@@ -329,6 +330,8 @@ public class CrmCustomerServiceImpl implements CrmCustomerService { @@ -329,6 +330,8 @@ public class CrmCustomerServiceImpl implements CrmCustomerService {
329 LocalDateTime lastTime = ObjUtil.defaultIfNull(customer.getContactLastTime(), customer.getCreateTime()); 330 LocalDateTime lastTime = ObjUtil.defaultIfNull(customer.getContactLastTime(), customer.getCreateTime());
330 return (poolConfig.getContactExpireDays() - LocalDateTimeUtils.between(lastTime)) <= 0; 331 return (poolConfig.getContactExpireDays() - LocalDateTimeUtils.between(lastTime)) <= 0;
331 }); 332 });
  333 +
  334 + // 2. 逐个放入公海
332 int count = 0; 335 int count = 0;
333 for (CrmCustomerDO customer : poolCustomerList) { 336 for (CrmCustomerDO customer : poolCustomerList) {
334 try { 337 try {