字典修改

This commit is contained in:
guojunyun
2025-10-21 09:19:57 +08:00
parent bcdab44cda
commit 2732a45220
2 changed files with 12 additions and 21 deletions

View File

@@ -1,8 +1,11 @@
package com.zt.plat.module.contractorder.enums.contract; package com.zt.plat.module.contractorder.enums.contract;
import lombok.Getter;
/** /**
* 字典枚举 * 字典枚举
*/ */
@Getter
public enum DictEnum { public enum DictEnum {
/** ERP请求状态 */ /** ERP请求状态 */
@@ -60,19 +63,7 @@ public enum DictEnum {
*/ */
private final String remark; private final String remark;
public String getLabel() { public static DictEnum getByCodeAndType(String code, String dictType) {
return label;
}
public String getCode() {
return code;
}
public String getRemark() {
return remark;
}
public static DictEnum getByCode(String code, String dictType) {
return DictEnum.valueOf(dictType + "_" +code); return DictEnum.valueOf(dictType + "_" +code);
} }
} }

View File

@@ -706,7 +706,7 @@ public class ContractServiceImpl implements ContractService {
|| DictEnum.BSE_CTRT_STS_IN_PROGRESS.getCode().equals(oldContractMainDO.getStatus()))) { || DictEnum.BSE_CTRT_STS_IN_PROGRESS.getCode().equals(oldContractMainDO.getStatus()))) {
throw exception(CONTRACT_STATUS_NOT_UPDATE, throw exception(CONTRACT_STATUS_NOT_UPDATE,
DictEnum.getByCode(oldContractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel()); DictEnum.getByCodeAndType(oldContractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel());
} }
// 校验合同名称是否重复 // 校验合同名称是否重复
@@ -952,7 +952,7 @@ public class ContractServiceImpl implements ContractService {
String msg = id.toString() String msg = id.toString()
+ ":" + ":"
+ CONTRACT_STATUS_NOT_DELETE.getMsg() + CONTRACT_STATUS_NOT_DELETE.getMsg()
.replace("{}", DictEnum.getByCode(contractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel()); .replace("{}", DictEnum.getByCodeAndType(contractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel());
result.add(new JSONObject().putOnce("deleted", false).putOnce("msg", msg)); result.add(new JSONObject().putOnce("deleted", false).putOnce("msg", msg));
} }
@@ -1032,7 +1032,7 @@ public class ContractServiceImpl implements ContractService {
|| DictEnum.BSE_CTRT_STS_WAIT_AUDIT.getCode().equals(contractMainDO.getStatus()))) { || DictEnum.BSE_CTRT_STS_WAIT_AUDIT.getCode().equals(contractMainDO.getStatus()))) {
throw exception(CONTRACT_STATUS_NOT_SUBMIT_APPROVAL, throw exception(CONTRACT_STATUS_NOT_SUBMIT_APPROVAL,
DictEnum.getByCode(contractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel()); DictEnum.getByCodeAndType(contractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel());
} }
// 合同内容校验 // 合同内容校验
@@ -1119,7 +1119,7 @@ public class ContractServiceImpl implements ContractService {
if (!DictEnum.BSE_CTRT_STS_UNDER_REVIEW.getCode().equals(contractMainDO.getStatus())) { if (!DictEnum.BSE_CTRT_STS_UNDER_REVIEW.getCode().equals(contractMainDO.getStatus())) {
throw exception(CONTRACT_STATUS_NOT_APPROVAL, throw exception(CONTRACT_STATUS_NOT_APPROVAL,
DictEnum.getByCode(contractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel()); DictEnum.getByCodeAndType(contractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel());
} }
// 获取当前流程正在审批的任务节点 // 获取当前流程正在审批的任务节点
@@ -1305,7 +1305,7 @@ public class ContractServiceImpl implements ContractService {
|| DictEnum.BSE_CTRT_STS_TERMINATED.getCode().equals(contractMainDO.getStatus()))) { || DictEnum.BSE_CTRT_STS_TERMINATED.getCode().equals(contractMainDO.getStatus()))) {
throw exception(CONTRACT_STATUS_NOT_SUBMIT_ERP, throw exception(CONTRACT_STATUS_NOT_SUBMIT_ERP,
DictEnum.getByCode(contractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel()); DictEnum.getByCodeAndType(contractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel());
} }
// 生成ERP合同映射表 // 生成ERP合同映射表
@@ -1439,7 +1439,7 @@ public class ContractServiceImpl implements ContractService {
// 合同状态校验 // 合同状态校验
if (!DictEnum.BSE_CTRT_STS_TERMINATED.getCode().equals(contractMainDO.getStatus())) { if (!DictEnum.BSE_CTRT_STS_TERMINATED.getCode().equals(contractMainDO.getStatus())) {
throw exception(CONTRACT_STATUS_NOT_ARCHIVE, throw exception(CONTRACT_STATUS_NOT_ARCHIVE,
DictEnum.getByCode(contractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel()); DictEnum.getByCodeAndType(contractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel());
} }
// 设置归档状态 // 设置归档状态
@@ -1467,7 +1467,7 @@ public class ContractServiceImpl implements ContractService {
// 合同状态校验 // 合同状态校验
if (!DictEnum.BSE_CTRT_STS_IN_PROGRESS.getCode().equals(contractMainDO.getStatus())) { if (!DictEnum.BSE_CTRT_STS_IN_PROGRESS.getCode().equals(contractMainDO.getStatus())) {
throw exception(CONTRACT_STATUS_NOT_ARCHIVE, throw exception(CONTRACT_STATUS_NOT_ARCHIVE,
DictEnum.getByCode(contractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel()); DictEnum.getByCodeAndType(contractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel());
} }
// 设置作废状态 // 设置作废状态
@@ -1498,7 +1498,7 @@ public class ContractServiceImpl implements ContractService {
// 合同状态校验 // 合同状态校验
if (!DictEnum.BSE_CTRT_STS_IN_PROGRESS.getCode().equals(contractMainDO.getStatus())) { if (!DictEnum.BSE_CTRT_STS_IN_PROGRESS.getCode().equals(contractMainDO.getStatus())) {
throw exception(CONTRACT_STATUS_NOT_ARCHIVE, throw exception(CONTRACT_STATUS_NOT_ARCHIVE,
DictEnum.getByCode(contractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel()); DictEnum.getByCodeAndType(contractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel());
} }
// 设置完结状态 // 设置完结状态