Commit d492daced4678b8bb6cfc258dd48f0825b15fd03
1 parent
6a6f669c
📖 CRM:code review 跟进记录
Showing
2 changed files
with
5 additions
and
1 deletions
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/vo/CrmClueRespVO.java
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 | 318 | if (poolConfig == null || !poolConfig.getEnabled()) { |
| 319 | 319 | return 0; |
| 320 | 320 | } |
| 321 | - // 获取没有锁定的不在公海的客户 | |
| 321 | + // 1. 获取没有锁定的不在公海的客户 | |
| 322 | 322 | List<CrmCustomerDO> customerList = customerMapper.selectListByLockStatusAndOwnerUserIdNotNull(Boolean.FALSE); |
| 323 | 323 | List<CrmCustomerDO> poolCustomerList = CollectionUtils.filterList(customerList, customer -> { |
| 324 | + // TODO @puhui999:建议这里作为一个查询条件哈,不放内存里过滤; | |
| 324 | 325 | // 1.1 未成交放入公海 |
| 325 | 326 | if (!customer.getDealStatus()) { |
| 326 | 327 | return (poolConfig.getDealExpireDays() - LocalDateTimeUtils.between(customer.getCreateTime())) <= 0; |
| ... | ... | @@ -329,6 +330,8 @@ public class CrmCustomerServiceImpl implements CrmCustomerService { |
| 329 | 330 | LocalDateTime lastTime = ObjUtil.defaultIfNull(customer.getContactLastTime(), customer.getCreateTime()); |
| 330 | 331 | return (poolConfig.getContactExpireDays() - LocalDateTimeUtils.between(lastTime)) <= 0; |
| 331 | 332 | }); |
| 333 | + | |
| 334 | + // 2. 逐个放入公海 | |
| 332 | 335 | int count = 0; |
| 333 | 336 | for (CrmCustomerDO customer : poolCustomerList) { |
| 334 | 337 | try { | ... | ... |