系统配置去除多种颜色排单,禅道1281 修改

This commit is contained in:
liuzhaotian
2025-02-26 09:17:37 +08:00
parent 045456c99b
commit d3e13a0135
8 changed files with 84 additions and 23 deletions
@@ -137,6 +137,7 @@ public class ErrorCodeConstants {
public static final ErrorCode ORGAN_DATA_CODE_NOT_EXISTS = new ErrorCode(1_002_015_006, "组织未配置数据源标识");
public static final ErrorCode ORGAN_ALREADY_EXISTS = new ErrorCode(1_002_015_007, "该新增组织已授权机台数量无需重复新增!");
public static final ErrorCode ORGAN_USER_OPER_NOT_ALLOW = new ErrorCode(1_002_015_008, "不允许操作用户自身组织");
public static final ErrorCode ORGAN_CONTACTMOBILE_DUPLICATE = new ErrorCode(1_002_015_009, "手机号为【{}】的组织已存在");
// ========== 组织套餐 1-002-016-000 ==========
public static final ErrorCode TENANT_PACKAGE_NOT_EXISTS = new ErrorCode(1_002_016_000, "组织套餐不存在");
@@ -378,4 +379,17 @@ public class ErrorCodeConstants {
public static final ErrorCode SYSTEM_PROCESS_SCHEME_CONFIG_IS_PLAN = new ErrorCode(1_002_040_018, "当前方案组已在排单中使用,无法删除");
public static final ErrorCode SYSTEM_PROCESS_SCHEME_CONFIG_MACHINE_LABEL = new ErrorCode(1_002_040_019, "当前方案组对应的解析器的机台的标签数据为空,请检查机台的标签配置信息");
public static final ErrorCode THIS_CONFIG_DATA_ERROR = new ErrorCode(1_002_040_020, "当前系统配置的数据有误,请重新尝试排序");
//=========== 系统配置 1-002-041-000 ============
public static final ErrorCode TOKEN_APP_TYPE_EXIST = new ErrorCode(1_002_041_001, "当前应用以存在token配置,无法继续新增");
public static final ErrorCode TOKEN_CONFIG_NOT_EXISTS = new ErrorCode(1_002_041_002, "当前应用的token配置不存在");
public static final ErrorCode TOKEN_TIME_IS_EXPIRES = new ErrorCode(1_002_041_003, "当前token已过期,请重新配置或延长时间");
public static final ErrorCode TOKEN_DATA_ERROR = new ErrorCode(1_002_041_004, "token解析失败,请重新配置token");
public static final ErrorCode TOKEN_APP_TYPE_ERROR = new ErrorCode(1_002_041_005, "token解析失败,当前token和应用不匹配,请重新配置");
public static final ErrorCode TOKEN_APP_TYPE_NO_UPDATE = new ErrorCode(1_002_041_006, "应用名称不允许更改");
public static final ErrorCode TOKEN_DATA_IS_NULL = new ErrorCode(1_002_041_007, "当前token的配置为空,无需删除");
public static final ErrorCode TOKEN_EXPIRES_TIME_IS_NULL = new ErrorCode(1_002_041_008, "当前未选择有效时间,请选择再进行新增");
public static final ErrorCode TOKEN_EXPIRES_TIME_DATA_ERROR = new ErrorCode(1_002_041_009, "当前选择的有效时间已过期,请增加有效时间");
}
@@ -268,10 +268,11 @@ public class SystemConfigApiImpl implements SystemConfigApi {
@Override
public CommonResult<Boolean> getMultiColorConfigStatus() {
List<SystemConfigDO> systemConfigDOS = systemConfigMapper.selectSystemConfigList(SystemConfigTypeEnum.MULTI_COLOR_ORDER_PLAN.getType(), CommonStatusEnum.ENABLE.getStatus());
return success(CollUtil.isNotEmpty(systemConfigDOS));
// List<SystemConfigDO> systemConfigDOS = systemConfigMapper.selectSystemConfigList(SystemConfigTypeEnum.MULTI_COLOR_ORDER_PLAN.getType(), CommonStatusEnum.ENABLE.getStatus());
//
// return success(CollUtil.isNotEmpty(systemConfigDOS));
return success(Boolean.TRUE);
}
@@ -50,6 +50,8 @@ public interface OrganMapper extends BaseMapperX<OrganizationDO> {
return selectOne(OrganizationDO::getWebsite, website);
}
List<OrganizationDO> selectByContactMobile(@Param("contactMobile") String contactMobile,@Param("organId") Long organId);
default Long selectCountByPackageId(Long packageId) {
return selectCount(OrganizationDO::getPackageId, packageId);
}
@@ -119,4 +121,14 @@ public interface OrganMapper extends BaseMapperX<OrganizationDO> {
.select(OrganizationDO::getId));
}
default OrganizationDO selectByOrganIdAndMobile(Long organId,String mobile) {
return selectOne(new LambdaQueryWrapperX<OrganizationDO>()
.eqIfPresent(OrganizationDO::getDeleted,false)
.eq(OrganizationDO::getId,organId)
.eq(OrganizationDO::getContactMobile,mobile));
}
}
@@ -41,12 +41,12 @@ public enum SystemConfigTypeEnum {
/**
* 加工方案
*/
PROCESS_SCHEME(6, "加工方案组"),
PROCESS_SCHEME(6, "加工方案组");
/**
* 支持多种颜色排单
*/
MULTI_COLOR_ORDER_PLAN(7, "支持多种颜色排单");
// /**
// * 支持多种颜色排单
// */
// MULTI_COLOR_ORDER_PLAN(7, "支持多种颜色排单");
/**
@@ -148,6 +148,8 @@ public class OrganServiceImpl implements OrganService {
validTenantNameDuplicate(createReqVO.getName(), null);
// 校验组织域名是否重复
validTenantWebsiteDuplicate(createReqVO.getWebsite(), null);
// 校验组织手机号是否重复
validContactMobileDuplicate(createReqVO.getContactMobile(),null);
// 校验套餐被禁用
TenantPackageDO tenantPackage = tenantPackageService.validTenantPackage(createReqVO.getPackageId());
@@ -221,6 +223,8 @@ public class OrganServiceImpl implements OrganService {
validTenantNameDuplicate(updateReqVO.getName(), organId);
// 校验组织域名是否重复
validTenantWebsiteDuplicate(updateReqVO.getWebsite(), organId);
// 校验组织手机号是否重复
validContactMobileDuplicate(updateReqVO.getContactMobile(),organId);
// 校验套餐被禁用
TenantPackageDO tenantPackage = tenantPackageService.validTenantPackage(updateReqVO.getPackageId());
if(!Objects.equals(tenant.getName(), updateReqVO.getName())) {
@@ -275,6 +279,20 @@ public class OrganServiceImpl implements OrganService {
}
}
private void validContactMobileDuplicate(String contactMobile,Long organId) {
List<OrganizationDO> organizationDOS = organMapper.selectByContactMobile(contactMobile,organId);
if(CollUtil.isNotEmpty(organizationDOS)){
throw exception(ORGAN_CONTACTMOBILE_DUPLICATE,contactMobile);
}
}
@Override
@DSTransactional
public void updateOrganRoleMenu(Long organId, Set<Long> menuIds) {
@@ -57,8 +57,8 @@ public class SystemConfigServiceFactory {
case PROCESS_SCHEME:
return applicationContext.getBean(ProcessSchemeServiceHandler.class);
// 多种颜色排单
case MULTI_COLOR_ORDER_PLAN:
return applicationContext.getBean(MultiColorOrderPlanServiceHandler.class);
// case MULTI_COLOR_ORDER_PLAN:
// return applicationContext.getBean(MultiColorOrderPlanServiceHandler.class);
default:
throw new ServiceException(ErrorCodeConstants.SYSTEM_CONFIG_TYPE_NOT_SUPPORT);
@@ -72,19 +72,19 @@ public class DefaultSystemConfigServiceHandler extends AbstractSystemConfigServi
continue;
}
// 支持多种颜色排单
if(configTypeEnum.getType().equals(SystemConfigTypeEnum.MULTI_COLOR_ORDER_PLAN.getType())){
SystemConfigDO systemConfigDO = SystemConfigDO
.builder()
.id(null)
.name(configTypeEnum.getName())
.type(configTypeEnum.getType())
.status(CommonStatusEnum.DISABLE.getStatus())
.build();
systemConfigMapper.insert(systemConfigDO);
resultList.add(systemConfigDO);
continue;
}
// // 支持多种颜色排单
// if(configTypeEnum.getType().equals(SystemConfigTypeEnum.MULTI_COLOR_ORDER_PLAN.getType())){
// SystemConfigDO systemConfigDO = SystemConfigDO
// .builder()
// .id(null)
// .name(configTypeEnum.getName())
// .type(configTypeEnum.getType())
// .status(CommonStatusEnum.DISABLE.getStatus())
// .build();
// systemConfigMapper.insert(systemConfigDO);
// resultList.add(systemConfigDO);
// continue;
// }
resultList.add(initConfig);
} else {
@@ -78,4 +78,20 @@
group by date;
</select>
<select id="selectByContactMobile"
resultType="com.cf.imes.module.system.dal.dataobject.organ.OrganizationDO">
select *
from system_organization
where contact_mobile = #{contactMobile}
<if test="organId !=null ">
and id != #{organId}
</if>
</select>
</mapper>