From 0a58790c6b4363b1a3f538e8d3e76c012508edf7 Mon Sep 17 00:00:00 2001 From: Joey Date: Fri, 3 Nov 2023 22:07:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AE=A2=E6=88=B7=E9=94=81?= =?UTF-8?q?=E5=AE=9A=E5=92=8C=E8=A7=A3=E9=94=81=20=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/customer/CrmCustomerController.java | 8 ++++++++ .../module/crm/service/customer/CrmCustomerService.java | 7 +++++++ .../crm/service/customer/CrmCustomerServiceImpl.java | 9 +++++++++ 3 files changed, 24 insertions(+) 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 ff144ffbf..0597c2292 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,4 +95,12 @@ public class CrmCustomerController { return success(true); } + @PutMapping("/lock") + @Operation(summary = "锁定/解锁") + @PreAuthorize("@ss.hasPermission('crm:customer:update')") + public CommonResult lockCustomer(@Valid @RequestBody CrmCustomerUpdateReqVO updateReqVO) { + customerService.lockCustomer(updateReqVO); + return success(true); + } + } 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 576a9bcbc..fca534514 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 @@ -86,4 +86,11 @@ public interface CrmCustomerService { */ void transferCustomer(CrmTransferCustomerReqVO reqVO, Long userId); + /** + * 锁定客户 解锁客户 + * + * @param updateReqVO 更新信息 + */ + void lockCustomer(@Valid CrmCustomerUpdateReqVO 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 e78717b2c..6215eb271 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 @@ -138,4 +138,13 @@ public class CrmCustomerServiceImpl implements CrmCustomerService { CrmCustomerConvert.INSTANCE.convert(reqVO, userId).setCrmType(CrmEnum.CRM_CUSTOMER.getType())); } + @Override + public void lockCustomer(CrmCustomerUpdateReqVO updateReqVO) { + // 校验存在 + validateCustomerExists(updateReqVO.getId()); + // 更新 + CrmCustomerDO updateObj = CrmCustomerConvert.INSTANCE.convert(updateReqVO); + customerMapper.updateById(updateObj); + } + }