Commit 0a58790c6b4363b1a3f538e8d3e76c012508edf7
1 parent
fdaa08c2
新增客户锁定和解锁 接口
Showing
3 changed files
with
24 additions
and
0 deletions
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/CrmCustomerController.java
| @@ -95,4 +95,12 @@ public class CrmCustomerController { | @@ -95,4 +95,12 @@ public class CrmCustomerController { | ||
| 95 | return success(true); | 95 | return success(true); |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | + @PutMapping("/lock") | ||
| 99 | + @Operation(summary = "锁定/解锁") | ||
| 100 | + @PreAuthorize("@ss.hasPermission('crm:customer:update')") | ||
| 101 | + public CommonResult<Boolean> lockCustomer(@Valid @RequestBody CrmCustomerUpdateReqVO updateReqVO) { | ||
| 102 | + customerService.lockCustomer(updateReqVO); | ||
| 103 | + return success(true); | ||
| 104 | + } | ||
| 105 | + | ||
| 98 | } | 106 | } |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerService.java
| @@ -86,4 +86,11 @@ public interface CrmCustomerService { | @@ -86,4 +86,11 @@ public interface CrmCustomerService { | ||
| 86 | */ | 86 | */ |
| 87 | void transferCustomer(CrmTransferCustomerReqVO reqVO, Long userId); | 87 | void transferCustomer(CrmTransferCustomerReqVO reqVO, Long userId); |
| 88 | 88 | ||
| 89 | + /** | ||
| 90 | + * 锁定客户 解锁客户 | ||
| 91 | + * | ||
| 92 | + * @param updateReqVO 更新信息 | ||
| 93 | + */ | ||
| 94 | + void lockCustomer(@Valid CrmCustomerUpdateReqVO updateReqVO); | ||
| 95 | + | ||
| 89 | } | 96 | } |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerServiceImpl.java
| @@ -138,4 +138,13 @@ public class CrmCustomerServiceImpl implements CrmCustomerService { | @@ -138,4 +138,13 @@ public class CrmCustomerServiceImpl implements CrmCustomerService { | ||
| 138 | CrmCustomerConvert.INSTANCE.convert(reqVO, userId).setCrmType(CrmEnum.CRM_CUSTOMER.getType())); | 138 | CrmCustomerConvert.INSTANCE.convert(reqVO, userId).setCrmType(CrmEnum.CRM_CUSTOMER.getType())); |
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | + @Override | ||
| 142 | + public void lockCustomer(CrmCustomerUpdateReqVO updateReqVO) { | ||
| 143 | + // 校验存在 | ||
| 144 | + validateCustomerExists(updateReqVO.getId()); | ||
| 145 | + // 更新 | ||
| 146 | + CrmCustomerDO updateObj = CrmCustomerConvert.INSTANCE.convert(updateReqVO); | ||
| 147 | + customerMapper.updateById(updateObj); | ||
| 148 | + } | ||
| 149 | + | ||
| 141 | } | 150 | } |