系统配置去除多种颜色排单,禅道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
@@ -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>