From 2915b46fa599b1215ed510dfbce93409e5939310 Mon Sep 17 00:00:00 2001 From: Wanwan <913752709@qq.com> Date: Thu, 9 Nov 2023 00:01:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20CRM=20=E5=AE=A2=E6=88=B7=E5=85=AC?= =?UTF-8?q?=E6=B5=B7=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/module/crm/enums/ErrorCodeConstants.java | 1 + .../customer/CrmCustomerPoolConfigServiceImpl.java | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/enums/ErrorCodeConstants.java b/yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/enums/ErrorCodeConstants.java index 36767f83a..d1f3572db 100644 --- a/yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/enums/ErrorCodeConstants.java +++ b/yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/enums/ErrorCodeConstants.java @@ -34,6 +34,7 @@ public interface ErrorCodeConstants { // ========== 客户管理 1_020_006_000 ========== ErrorCode CUSTOMER_NOT_EXISTS = new ErrorCode(1_020_006_000, "客户不存在"); + ErrorCode CUSTOMER_POOL_CONFIG_ERROR = new ErrorCode(1_020_006_001, "客户公海规则设置不正确"); // ========== 权限管理 1_020_007_000 ========== ErrorCode CRM_PERMISSION_NOT_EXISTS = new ErrorCode(1_020_007_000, "数据权限不存在"); diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerPoolConfigServiceImpl.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerPoolConfigServiceImpl.java index 5c3099875..1ea6f98b4 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerPoolConfigServiceImpl.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerPoolConfigServiceImpl.java @@ -1,5 +1,7 @@ package cn.iocoder.yudao.module.crm.service.customer; +import cn.hutool.core.util.BooleanUtil; +import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.CrmCustomerPoolConfigUpdateReqVO; import cn.iocoder.yudao.module.crm.convert.customer.CrmCustomerConvert; @@ -11,6 +13,9 @@ import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; import java.util.Objects; +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.CUSTOMER_POOL_CONFIG_ERROR; + /** * 客户公海配置 Service 实现类 * @@ -39,6 +44,13 @@ public class CrmCustomerPoolConfigServiceImpl implements CrmCustomerPoolConfigSe */ @Override public void updateCustomerPoolConfig(CrmCustomerPoolConfigUpdateReqVO saveReqVO) { + if (BooleanUtil.isTrue(saveReqVO.getEnabled()) && (ObjectUtil.hasNull(saveReqVO.getContactExpireDays(), saveReqVO.getDealExpireDays()))) { + throw exception(CUSTOMER_POOL_CONFIG_ERROR); + } + if (BooleanUtil.isTrue(saveReqVO.getNotifyEnabled()) && (Objects.isNull(saveReqVO.getNotifyDays()))) { + throw exception(CUSTOMER_POOL_CONFIG_ERROR); + } + // 存在,则进行更新 CrmCustomerPoolConfigDO dbConfig = getCustomerPoolConfig(); if (Objects.nonNull(dbConfig)) {