diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/followup/CrmFollowUpRecordController.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/followup/CrmFollowUpRecordController.java index 399696bf4..735f2e887 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/followup/CrmFollowUpRecordController.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/followup/CrmFollowUpRecordController.java @@ -38,7 +38,7 @@ import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUti public class CrmFollowUpRecordController { @Resource - private CrmFollowUpRecordService crmFollowUpRecordService; + private CrmFollowUpRecordService followUpRecordService; @Resource private CrmContactService contactService; @Resource @@ -48,7 +48,7 @@ public class CrmFollowUpRecordController { @Operation(summary = "创建跟进记录") @PreAuthorize("@ss.hasPermission('crm:follow-up-record:create')") public CommonResult createFollowUpRecord(@Valid @RequestBody CrmFollowUpRecordSaveReqVO createReqVO) { - return success(crmFollowUpRecordService.createFollowUpRecord(createReqVO)); + return success(followUpRecordService.createFollowUpRecord(createReqVO)); } @DeleteMapping("/delete") @@ -56,7 +56,7 @@ public class CrmFollowUpRecordController { @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('crm:follow-up-record:delete')") public CommonResult deleteFollowUpRecord(@RequestParam("id") Long id) { - crmFollowUpRecordService.deleteFollowUpRecord(id, getLoginUserId()); + followUpRecordService.deleteFollowUpRecord(id, getLoginUserId()); return success(true); } @@ -65,7 +65,7 @@ public class CrmFollowUpRecordController { @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('crm:follow-up-record:query')") public CommonResult getFollowUpRecord(@RequestParam("id") Long id) { - CrmFollowUpRecordDO followUpRecord = crmFollowUpRecordService.getFollowUpRecord(id); + CrmFollowUpRecordDO followUpRecord = followUpRecordService.getFollowUpRecord(id); return success(BeanUtils.toBean(followUpRecord, CrmFollowUpRecordRespVO.class)); } @@ -73,7 +73,7 @@ public class CrmFollowUpRecordController { @Operation(summary = "获得跟进记录分页") @PreAuthorize("@ss.hasPermission('crm:follow-up-record:query')") public CommonResult> getFollowUpRecordPage(@Valid CrmFollowUpRecordPageReqVO pageReqVO) { - PageResult pageResult = crmFollowUpRecordService.getFollowUpRecordPage(pageReqVO); + PageResult pageResult = followUpRecordService.getFollowUpRecordPage(pageReqVO); /// 拼接数据 Map contactMap = convertMap(contactService.getContactList( convertSetByFlatMap(pageResult.getList(), item -> item.getContactIds().stream())), CrmContactDO::getId); diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/business/bo/CrmBusinessUpdateFollowUpReqBO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/business/bo/CrmBusinessUpdateFollowUpReqBO.java index edb4eec1a..ccf8d0a0a 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/business/bo/CrmBusinessUpdateFollowUpReqBO.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/business/bo/CrmBusinessUpdateFollowUpReqBO.java @@ -7,6 +7,7 @@ import lombok.Data; import java.time.LocalDateTime; +// TODO @puhui999:是不是搞个通用的 ReqBO 就好了 /** * 商机跟进信息 Update Req BO * diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/clue/bo/CrmClueUpdateFollowUpReqBO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/clue/bo/CrmClueUpdateFollowUpReqBO.java index 36bc287f9..d4697acc2 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/clue/bo/CrmClueUpdateFollowUpReqBO.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/clue/bo/CrmClueUpdateFollowUpReqBO.java @@ -7,6 +7,7 @@ import lombok.Data; import java.time.LocalDateTime; +// TODO @puhui999:是不是搞个通用的 ReqBO 就好了 /** * 线索跟进信息 Update Req BO * diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contact/CrmContactService.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contact/CrmContactService.java index 7cb86bc56..5962db9a8 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contact/CrmContactService.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contact/CrmContactService.java @@ -65,7 +65,6 @@ public interface CrmContactService { */ void updateContactFollowUpBatch(List updateFollowUpReqBOList); - /** * 获得联系人 * diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contact/bo/CrmContactUpdateFollowUpReqBO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contact/bo/CrmContactUpdateFollowUpReqBO.java index 2b2cd9a1d..40604353e 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contact/bo/CrmContactUpdateFollowUpReqBO.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contact/bo/CrmContactUpdateFollowUpReqBO.java @@ -7,6 +7,7 @@ import lombok.Data; import java.time.LocalDateTime; +// TODO @puhui999:是不是搞个通用的 ReqBO 就好了 /** * 联系人跟进信息 Update Req BO * diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contract/bo/CrmContractUpdateFollowUpReqBO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contract/bo/CrmContractUpdateFollowUpReqBO.java index 4091a5634..57c1f5f50 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contract/bo/CrmContractUpdateFollowUpReqBO.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contract/bo/CrmContractUpdateFollowUpReqBO.java @@ -7,6 +7,7 @@ import lombok.Data; import java.time.LocalDateTime; +// TODO @puhui999:是不是搞个通用的 ReqBO 就好了 /** * 合同跟进信息 Update Req BO * 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 a27a43e87..a88b230e3 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 @@ -227,15 +227,16 @@ public class CrmCustomerServiceImpl implements CrmCustomerService { // 1.3. 校验客户是否锁定 validateCustomerIsLocked(customer, true); - // 2. 设置负责人为 NULL + // 2.1 设置负责人为 NULL int updateOwnerUserIncr = customerMapper.updateOwnerUserIdById(customer.getId(), null); if (updateOwnerUserIncr == 0) { throw exception(CUSTOMER_UPDATE_OWNER_USER_FAIL); } - // 3. 删除负责人数据权限 + // 2.2 删除负责人数据权限 permissionService.deletePermission(CrmBizTypeEnum.CRM_CUSTOMER.getType(), customer.getId(), CrmPermissionLevelEnum.OWNER.getLevel()); - // 联系人的负责人,也要设置为 null;这块和领取是对应的;因为领取后,负责人也要关联过来; + + // 3. 联系人的负责人,也要设置为 null。因为:因为领取后,负责人也要关联过来,这块和 receiveCustomer 是对应的 contactService.updateOwnerUserIdByCustomerId(customer.getId(), null); // 记录操作日志上下文 diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/bo/CrmCustomerUpdateFollowUpReqBO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/bo/CrmCustomerUpdateFollowUpReqBO.java index f5e0302e5..2ba7fbb05 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/bo/CrmCustomerUpdateFollowUpReqBO.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/bo/CrmCustomerUpdateFollowUpReqBO.java @@ -6,6 +6,7 @@ import lombok.Data; import java.time.LocalDateTime; +// TODO @puhui999:是不是搞个通用的 ReqBO 就好了 /** * 跟进信息 Update Req BO * diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/followup/CrmFollowUpRecordServiceImpl.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/followup/CrmFollowUpRecordServiceImpl.java index 6eae29ddb..f1c98e7d7 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/followup/CrmFollowUpRecordServiceImpl.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/followup/CrmFollowUpRecordServiceImpl.java @@ -59,10 +59,11 @@ public class CrmFollowUpRecordServiceImpl implements CrmFollowUpRecordService { crmFollowUpRecordMapper.insert(followUpRecord); LocalDateTime now = LocalDateTime.now(); - // 更新 bizId 对应的记录; + // 2. 更新 bizId 对应的记录; followUpHandlers.forEach(handler -> handler.execute(followUpRecord, now)); - // 更新 contactIds 对应的记录 + // 3.1 更新 contactIds 对应的记录 if (CollUtil.isNotEmpty(createReqVO.getContactIds())) { + // TODO @puhui999:可以用链式设置哈 contactService.updateContactFollowUpBatch(convertList(createReqVO.getContactIds(), contactId -> { CrmContactUpdateFollowUpReqBO crmContactUpdateFollowUpReqBO = new CrmContactUpdateFollowUpReqBO(); crmContactUpdateFollowUpReqBO.setId(contactId).setContactNextTime(followUpRecord.getNextTime()) @@ -70,7 +71,7 @@ public class CrmFollowUpRecordServiceImpl implements CrmFollowUpRecordService { return crmContactUpdateFollowUpReqBO; })); } - // 需要更新 businessIds、contactIds 对应的记录 + // 3.2 需要更新 businessIds、contactIds 对应的记录 if (CollUtil.isNotEmpty(createReqVO.getBusinessIds())) { businessService.updateContactFollowUpBatch(convertList(createReqVO.getBusinessIds(), businessId -> { CrmBusinessUpdateFollowUpReqBO crmBusinessUpdateFollowUpReqBO = new CrmBusinessUpdateFollowUpReqBO(); diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/followup/handle/CrmFollowUpHandler.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/followup/handle/CrmFollowUpHandler.java index 7df667727..82bcec835 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/followup/handle/CrmFollowUpHandler.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/followup/handle/CrmFollowUpHandler.java @@ -11,6 +11,7 @@ import java.time.LocalDateTime; */ public interface CrmFollowUpHandler { + // TODO @puhui999:需要考虑,下次联系时间为空; /** * 执行更新 *