diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/PtlPcnEnumUtil.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/PtlPcnEnumUtil.java index 1205a9c..614df60 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/PtlPcnEnumUtil.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/PtlPcnEnumUtil.java @@ -1457,16 +1457,6 @@ public class PtlPcnEnumUtil { return tmp; } - public static int descOf(String desc) { - int tmp = 1; - for (int i = 0; i < values().length; i++) { - if (values()[i].description.equals(desc)) { - tmp = values()[i].value; - } - } - return tmp; - } - public static String valueOfDescription(int val) { return valueOf(val); } @@ -1514,16 +1504,6 @@ public class PtlPcnEnumUtil { return tmp; } - public static int descOf(String desc) { - int tmp = 1; - for (int i = 0; i < values().length; i++) { - if (values()[i].description.equals(desc)) { - tmp = values()[i].value; - } - } - return tmp; - } - public static String valueOfDescription(int val) { return valueOf(val); } @@ -1569,16 +1549,6 @@ public class PtlPcnEnumUtil { return tmp; } - public static int descOf(String desc) { - int tmp = 1; - for (int i = 0; i < values().length; i++) { - if (values()[i].description.equals(desc)) { - tmp = values()[i].value; - } - } - return tmp; - } - public static String valueOfDescription(int val) { return valueOf(val); } @@ -1625,11 +1595,47 @@ public class PtlPcnEnumUtil { return tmp; } - public static int descOf(String desc) { - int tmp = 1; + public static String valueOfDescription(int val) { + return valueOf(val); + } + } + + /** + * 主任务类型 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum MAIN_TASK_TYPE { + CREATE(10, "JIT_TASK", "JIT任务"), + RECEIPT(20, "DOCUMENT_TASK", "单据任务"), + RECEIPT_FINISH(30, "SINGLE_POINT_TASK", "单点任务"); + + private int value; + private String code; + private String description; + + MAIN_TASK_TYPE(int value, String code, String description) { + this.value = value; + this.code = code; + this.description = description; + } + + public int getValue() { + return value; + } + + public String getCode() { + return code; + } + + public String getDescription() { + return description; + } + + public static String valueOf(int val) { + String tmp = null; for (int i = 0; i < values().length; i++) { - if (values()[i].description.equals(desc)) { - tmp = values()[i].value; + if (values()[i].value == val) { + tmp = values()[i].description; } } return tmp; @@ -1678,15 +1684,5 @@ public class PtlPcnEnumUtil { } return tmp; } - - public static String valueOfDescription2(int val) { - String tmp = null; - for (int i = 0; i < values().length; i++) { - if (values()[i].value == val) { - tmp = values()[i].description.equals("已审批") ? "审批" : values()[i].description; - } - } - return tmp; - } } }