新增系统配置-配置项名称不允许重复

This commit is contained in:
liuzhaotian
2025-03-28 17:19:19 +08:00
parent 6740188283
commit b1006a91f8
7 changed files with 40 additions and 71 deletions
@@ -389,6 +389,7 @@ public class ErrorCodeConstants {
public static final ErrorCode SEALEDGE_CONFIG_MIN_VALUE_DATA_ERROR = new ErrorCode(1_002_040_024, "第 {} 条配置中,宽最小值大于宽取值,请修改数据");
public static final ErrorCode SEALEDGE_CONFIG_MAX_VALUE_DATA_ERROR = new ErrorCode(1_002_040_025, "第 {} 条配置中,宽最大值小于宽取值,请修改数据");
public static final ErrorCode SEALEDGE_CONFIG_DATA_ERROR = new ErrorCode(1_002_040_026, "当前封边条配置有误,请重新检查后新增");
public static final ErrorCode THIS_CONFIG_NAME_IS_EXISTS = new ErrorCode(1_002_040_027, "当前配置的名称已存在,请重新命名");
@@ -1,67 +0,0 @@
package com.cf.imes.module.system.service.systemconfig.factory.service.impl;
import com.cf.imes.module.system.controller.admin.systemconfig.vo.*;
import com.cf.imes.module.system.dal.dataobject.systemconfig.SystemConfigDO;
import com.cf.imes.module.system.service.systemconfig.factory.service.AbstractSystemConfigServiceHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author 高级筛选服务处理
*/
@Service("advancedScreenServiceHandler")
@Slf4j
public class AdvancedScreenServiceHandler extends AbstractSystemConfigServiceHandler {
@Override
public List<SystemConfigDO> selectList(ConfigPageReqVO pageReqVO) {
return null;
}
@Override
public void checkValid(String setting) {
// todo checkValid
}
@Override
public void beforeSaveConfig(ConfigSaveReqVO reqVO) {
// todo beforeSaveConfig
}
@Override
public void afterSaveConfig(SystemConfigDO systemConfigDO, ConfigSaveReqVO reqVO) {
// todo afterSaveConfig
}
@Override
public void deleteConfig(ConfigDeleteReqVO reqVO) {
// todo deleteConfig
}
@Override
public void updateConfigStatus(ConfigUpdateStatusReqVO reqVO) {
}
@Override
public void updateConfigSort(List<ConfigUpdateSortReqVO> reqVO) {
}
@Override
public SystemConfigDO getSystemConfig(Long id) {
return null;
}
@Override
public void modifySystemConfig(ConfigSaveReqVO reqVO) {
}
}
@@ -4,6 +4,7 @@ package com.cf.imes.module.system.service.systemconfig.factory.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.cf.imes.framework.common.util.Assert.AssertUtils;
import com.cf.imes.framework.common.util.object.BeanUtils;
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
@@ -24,6 +25,7 @@ import java.util.List;
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.cf.imes.framework.common.util.json.JsonUtils.parseArray;
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getUserOrganId;
import static com.cf.imes.module.system.enums.ErrorCodeConstants.*;
/**
@@ -61,7 +63,14 @@ public class DataProcessServiceHandler extends AbstractSystemConfigServiceHandle
@Override
public void beforeSaveConfig(ConfigSaveReqVO reqVO) {
// todo beforeSaveConfig
List<SystemConfigDataDO> systemConfigDataDOS = systemConfigDataMapper.selectList(new LambdaQueryWrapperX<SystemConfigDataDO>()
.eq(SystemConfigDataDO::getOrganId,getUserOrganId())
.eq(SystemConfigDataDO::getName, reqVO.getName())
.neIfPresent(SystemConfigDataDO::getId,reqVO.getId()));
AssertUtils.empty(systemConfigDataDOS,THIS_CONFIG_NAME_IS_EXISTS);
}
@Override
@@ -4,6 +4,7 @@ package com.cf.imes.module.system.service.systemconfig.factory.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.cf.imes.framework.common.enums.CommonStatusEnum;
import com.cf.imes.framework.common.util.Assert.AssertUtils;
import com.cf.imes.framework.common.util.object.BeanUtils;
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
@@ -20,7 +21,9 @@ import java.util.ArrayList;
import java.util.List;
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getUserOrganId;
import static com.cf.imes.module.system.enums.ErrorCodeConstants.SYSTEM_CONFIG_NOT_EXISTS;
import static com.cf.imes.module.system.enums.ErrorCodeConstants.THIS_CONFIG_NAME_IS_EXISTS;
/**
@@ -55,7 +58,12 @@ public class IntellectBranchingService extends AbstractSystemConfigServiceHandle
@Override
public void beforeSaveConfig(ConfigSaveReqVO reqVO) {
// todo beforeSaveConfig
List<SystemConfigFilterDO> systemConfigFilterDOS = systemConfigFilterMapper.selectList(new LambdaQueryWrapperX<SystemConfigFilterDO>()
.eq(SystemConfigFilterDO::getOrganId,getUserOrganId())
.eq(SystemConfigFilterDO::getName, reqVO.getName())
.neIfPresent(SystemConfigFilterDO::getId,reqVO.getId()));
AssertUtils.empty(systemConfigFilterDOS,THIS_CONFIG_NAME_IS_EXISTS);
}
@@ -5,6 +5,7 @@ import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.cf.imes.framework.common.enums.CommonStatusEnum;
import com.cf.imes.framework.common.util.Assert.AssertUtils;
import com.cf.imes.framework.common.util.object.BeanUtils;
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
@@ -27,6 +28,7 @@ import java.util.concurrent.atomic.AtomicLong;
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.cf.imes.framework.common.util.json.JsonUtils.parseArray;
import static com.cf.imes.framework.common.util.json.JsonUtils.toJsonString;
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getUserOrganId;
import static com.cf.imes.module.system.enums.ErrorCodeConstants.*;
/**
@@ -89,6 +91,13 @@ public class ProcessSchemeServiceHandler extends AbstractSystemConfigServiceHand
@Override
public void beforeSaveConfig(ConfigSaveReqVO reqVO) {
List<SystemConfigSchemeDO> systemConfigSchemeDOS = systemConfigSchemeMapper.selectList(new LambdaQueryWrapperX<SystemConfigSchemeDO>()
.eq(SystemConfigSchemeDO::getOrganId,getUserOrganId())
.eq(SystemConfigSchemeDO::getName, reqVO.getName())
.neIfPresent(SystemConfigSchemeDO::getId,reqVO.getId()));
AssertUtils.empty(systemConfigSchemeDOS,THIS_CONFIG_NAME_IS_EXISTS);
List<ProcessSchemeConfig> processSchemeConfigs = parseArray(reqVO.getSetting(), ProcessSchemeConfig.class);
AtomicLong sort = new AtomicLong(System.currentTimeMillis());
@@ -4,6 +4,7 @@ package com.cf.imes.module.system.service.systemconfig.factory.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.cf.imes.framework.common.util.Assert.AssertUtils;
import com.cf.imes.framework.common.util.object.BeanUtils;
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
@@ -24,6 +25,7 @@ import java.util.List;
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.cf.imes.framework.common.util.json.JsonUtils.parseArray;
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getUserOrganId;
import static com.cf.imes.module.system.enums.ErrorCodeConstants.*;
/**
@@ -61,7 +63,14 @@ public class ProcessScreeningServiceHandler extends AbstractSystemConfigServiceH
@Override
public void beforeSaveConfig(ConfigSaveReqVO reqVO) {
// todo beforeSaveConfig
List<SystemConfigProcessDO> systemConfigProcessDOS = systemConfigProcessMapper.selectList(new LambdaQueryWrapperX<SystemConfigProcessDO>()
.eq(SystemConfigProcessDO::getOrganId,getUserOrganId())
.eq(SystemConfigProcessDO::getName, reqVO.getName())
.neIfPresent(SystemConfigProcessDO::getId,reqVO.getId()));
AssertUtils.empty(systemConfigProcessDOS,THIS_CONFIG_NAME_IS_EXISTS);
}
@@ -28,7 +28,7 @@ import static com.cf.imes.module.system.enums.ErrorCodeConstants.*;
/**
* @author 多种颜色排单
* @author 封边条对应
*/
@Service("sealedgeServiceHandler")
@Slf4j