From d492daced4678b8bb6cfc258dd48f0825b15fd03 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 27 Jan 2024 00:55:42 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=96=20CRM=EF=BC=9Acode=20review=20?= =?UTF-8?q?=E8=B7=9F=E8=BF=9B=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/crm/controller/admin/clue/vo/CrmClueRespVO.java | 1 + .../module/crm/service/customer/CrmCustomerServiceImpl.java | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/vo/CrmClueRespVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/vo/CrmClueRespVO.java index 0858b6f3a..35d30956e 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/vo/CrmClueRespVO.java +++ b/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 { @Schema(description = "客户描述", example = "25682") @ExcelProperty("客户描述") private String description; + } diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerServiceImpl.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerServiceImpl.java index 2077359ed..ff9d9a030 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerServiceImpl.java +++ b/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 { if (poolConfig == null || !poolConfig.getEnabled()) { return 0; } - // 获取没有锁定的不在公海的客户 + // 1. 获取没有锁定的不在公海的客户 List customerList = customerMapper.selectListByLockStatusAndOwnerUserIdNotNull(Boolean.FALSE); List poolCustomerList = CollectionUtils.filterList(customerList, customer -> { + // TODO @puhui999:建议这里作为一个查询条件哈,不放内存里过滤; // 1.1 未成交放入公海 if (!customer.getDealStatus()) { return (poolConfig.getDealExpireDays() - LocalDateTimeUtils.between(customer.getCreateTime())) <= 0; @@ -329,6 +330,8 @@ public class CrmCustomerServiceImpl implements CrmCustomerService { LocalDateTime lastTime = ObjUtil.defaultIfNull(customer.getContactLastTime(), customer.getCreateTime()); return (poolConfig.getContactExpireDays() - LocalDateTimeUtils.between(lastTime)) <= 0; }); + + // 2. 逐个放入公海 int count = 0; for (CrmCustomerDO customer : poolCustomerList) { try {