From acdfc28ee6ce6b8fc659fad1a5e36868563c1c78 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 3 Nov 2023 23:43:04 +0800 Subject: [PATCH] =?UTF-8?q?code=20review=EF=BC=9A=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E9=94=81=E5=AE=9A=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crm/controller/admin/customer/CrmCustomerController.java | 3 ++- .../yudao/module/crm/service/customer/CrmCustomerService.java | 2 +- .../module/crm/service/customer/CrmCustomerServiceImpl.java | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/CrmCustomerController.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/CrmCustomerController.java index ddcf6e97e..14dedecd1 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/CrmCustomerController.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/CrmCustomerController.java @@ -95,8 +95,9 @@ public class CrmCustomerController { return success(true); } + // TODO @Joey:单独建一个属于自己业务的 ReqVO;因为前端如果模拟请求,是不是可以更新其它字段了; @PutMapping("/lock") - @Operation(summary = "锁定/解锁") + @Operation(summary = "锁定/解锁客户") @PreAuthorize("@ss.hasPermission('crm:customer:update')") public CommonResult lockCustomer(@Valid @RequestBody CrmCustomerUpdateReqVO updateReqVO) { customerService.lockCustomer(updateReqVO); diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerService.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerService.java index 421113bd8..a9c47a0d4 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerService.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerService.java @@ -87,7 +87,7 @@ public interface CrmCustomerService { void transferCustomer(CrmCustomerTransferReqVO reqVO, Long userId); /** - * 锁定客户 解锁客户 + * 锁定/解锁客户 * * @param updateReqVO 更新信息 */ 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 69d68cc05..819fbc870 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 @@ -146,6 +146,9 @@ public class CrmCustomerServiceImpl implements CrmCustomerService { public void lockCustomer(CrmCustomerUpdateReqVO updateReqVO) { // 校验存在 validateCustomerExists(updateReqVO.getId()); + // TODO @Joey:可以校验下,如果已经对应的锁定状态,报个业务异常;原因是:后续这个业务会记录操作日志,会记录多了; + // TODO @芋艿:业务完善,增加锁定上限; + // 更新 CrmCustomerDO updateObj = CrmCustomerConvert.INSTANCE.convert(updateReqVO); customerMapper.updateById(updateObj);