Commit acdfc28ee6ce6b8fc659fad1a5e36868563c1c78
1 parent
9a007de9
code review:客户锁定的逻辑
Showing
3 changed files
with
6 additions
and
2 deletions
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 { | @@ -95,8 +95,9 @@ public class CrmCustomerController { | ||
| 95 | return success(true); | 95 | return success(true); |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | + // TODO @Joey:单独建一个属于自己业务的 ReqVO;因为前端如果模拟请求,是不是可以更新其它字段了; | ||
| 98 | @PutMapping("/lock") | 99 | @PutMapping("/lock") |
| 99 | - @Operation(summary = "锁定/解锁") | 100 | + @Operation(summary = "锁定/解锁客户") |
| 100 | @PreAuthorize("@ss.hasPermission('crm:customer:update')") | 101 | @PreAuthorize("@ss.hasPermission('crm:customer:update')") |
| 101 | public CommonResult<Boolean> lockCustomer(@Valid @RequestBody CrmCustomerUpdateReqVO updateReqVO) { | 102 | public CommonResult<Boolean> lockCustomer(@Valid @RequestBody CrmCustomerUpdateReqVO updateReqVO) { |
| 102 | customerService.lockCustomer(updateReqVO); | 103 | customerService.lockCustomer(updateReqVO); |
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 { | @@ -87,7 +87,7 @@ public interface CrmCustomerService { | ||
| 87 | void transferCustomer(CrmCustomerTransferReqVO reqVO, Long userId); | 87 | void transferCustomer(CrmCustomerTransferReqVO reqVO, Long userId); |
| 88 | 88 | ||
| 89 | /** | 89 | /** |
| 90 | - * 锁定客户 解锁客户 | 90 | + * 锁定/解锁客户 |
| 91 | * | 91 | * |
| 92 | * @param updateReqVO 更新信息 | 92 | * @param updateReqVO 更新信息 |
| 93 | */ | 93 | */ |
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 { | @@ -146,6 +146,9 @@ public class CrmCustomerServiceImpl implements CrmCustomerService { | ||
| 146 | public void lockCustomer(CrmCustomerUpdateReqVO updateReqVO) { | 146 | public void lockCustomer(CrmCustomerUpdateReqVO updateReqVO) { |
| 147 | // 校验存在 | 147 | // 校验存在 |
| 148 | validateCustomerExists(updateReqVO.getId()); | 148 | validateCustomerExists(updateReqVO.getId()); |
| 149 | + // TODO @Joey:可以校验下,如果已经对应的锁定状态,报个业务异常;原因是:后续这个业务会记录操作日志,会记录多了; | ||
| 150 | + // TODO @芋艿:业务完善,增加锁定上限; | ||
| 151 | + | ||
| 149 | // 更新 | 152 | // 更新 |
| 150 | CrmCustomerDO updateObj = CrmCustomerConvert.INSTANCE.convert(updateReqVO); | 153 | CrmCustomerDO updateObj = CrmCustomerConvert.INSTANCE.convert(updateReqVO); |
| 151 | customerMapper.updateById(updateObj); | 154 | customerMapper.updateById(updateObj); |