Commit 9a007de9472fcbebf5a0114af5b537f164d15d17

Authored by 芋道源码
Committed by Gitee
2 parents 5bb91f13 0a58790c

!713 新增接口

Merge pull request !713 from Joey/feature/crm
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 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 86 */
87 87 void transferCustomer(CrmCustomerTransferReqVO 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
... ... @@ -142,4 +142,13 @@ public class CrmCustomerServiceImpl implements CrmCustomerService {
142 142 // 3. TODO 记录转移日志
143 143 }
144 144  
  145 + @Override
  146 + public void lockCustomer(CrmCustomerUpdateReqVO updateReqVO) {
  147 + // 校验存在
  148 + validateCustomerExists(updateReqVO.getId());
  149 + // 更新
  150 + CrmCustomerDO updateObj = CrmCustomerConvert.INSTANCE.convert(updateReqVO);
  151 + customerMapper.updateById(updateObj);
  152 + }
  153 +
145 154 }
... ...