Commit 2915b46fa599b1215ed510dfbce93409e5939310

Authored by Wanwan
1 parent 9abff2c7

feat: CRM 客户公海配置

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 {
34 34  
35 35 // ========== 客户管理 1_020_006_000 ==========
36 36 ErrorCode CUSTOMER_NOT_EXISTS = new ErrorCode(1_020_006_000, "客户不存在");
  37 + ErrorCode CUSTOMER_POOL_CONFIG_ERROR = new ErrorCode(1_020_006_001, "客户公海规则设置不正确");
37 38  
38 39 // ========== 权限管理 1_020_007_000 ==========
39 40 ErrorCode CRM_PERMISSION_NOT_EXISTS = new ErrorCode(1_020_007_000, "数据权限不存在");
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerPoolConfigServiceImpl.java
1 1 package cn.iocoder.yudao.module.crm.service.customer;
2 2  
  3 +import cn.hutool.core.util.BooleanUtil;
  4 +import cn.hutool.core.util.ObjectUtil;
3 5 import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
4 6 import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.CrmCustomerPoolConfigUpdateReqVO;
5 7 import cn.iocoder.yudao.module.crm.convert.customer.CrmCustomerConvert;
... ... @@ -11,6 +13,9 @@ import org.springframework.validation.annotation.Validated;
11 13 import javax.annotation.Resource;
12 14 import java.util.Objects;
13 15  
  16 +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
  17 +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.CUSTOMER_POOL_CONFIG_ERROR;
  18 +
14 19 /**
15 20 * 客户公海配置 Service 实现类
16 21 *
... ... @@ -39,6 +44,13 @@ public class CrmCustomerPoolConfigServiceImpl implements CrmCustomerPoolConfigSe
39 44 */
40 45 @Override
41 46 public void updateCustomerPoolConfig(CrmCustomerPoolConfigUpdateReqVO saveReqVO) {
  47 + if (BooleanUtil.isTrue(saveReqVO.getEnabled()) && (ObjectUtil.hasNull(saveReqVO.getContactExpireDays(), saveReqVO.getDealExpireDays()))) {
  48 + throw exception(CUSTOMER_POOL_CONFIG_ERROR);
  49 + }
  50 + if (BooleanUtil.isTrue(saveReqVO.getNotifyEnabled()) && (Objects.isNull(saveReqVO.getNotifyDays()))) {
  51 + throw exception(CUSTOMER_POOL_CONFIG_ERROR);
  52 + }
  53 +
42 54 // 存在,则进行更新
43 55 CrmCustomerPoolConfigDO dbConfig = getCustomerPoolConfig();
44 56 if (Objects.nonNull(dbConfig)) {
... ...