|
|
|
@ -142,21 +142,21 @@ public class MesPcnEnumUtil {
|
|
|
|
|
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
|
|
|
|
public enum MES_MATCH_TYPE {
|
|
|
|
|
|
|
|
|
|
ORGANIZATION("10", "工厂"),
|
|
|
|
|
PART("20", "物料"),
|
|
|
|
|
CUST_CODE("30", "客户代码"),
|
|
|
|
|
CUST_PART_NO("40", "客户物料号"),
|
|
|
|
|
WORK_CENTER("50", "产线");
|
|
|
|
|
ORGANIZATION(10, "工厂"),
|
|
|
|
|
PART(20, "物料"),
|
|
|
|
|
CUST_CODE(30, "客户代码"),
|
|
|
|
|
CUST_PART_NO(40, "客户物料号"),
|
|
|
|
|
WORK_CENTER(50, "产线");
|
|
|
|
|
|
|
|
|
|
private String value;
|
|
|
|
|
private int value;
|
|
|
|
|
private String description;
|
|
|
|
|
|
|
|
|
|
MES_MATCH_TYPE(String value, String description) {
|
|
|
|
|
MES_MATCH_TYPE(int value, String description) {
|
|
|
|
|
this.value = value;
|
|
|
|
|
this.description = description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getValue() {
|
|
|
|
|
public int getValue() {
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -164,7 +164,7 @@ public class MesPcnEnumUtil {
|
|
|
|
|
return description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String valueOfDescription(String val) {
|
|
|
|
|
public static String valueOfDescription(int val) {
|
|
|
|
|
String tmp = null;
|
|
|
|
|
for (int i = 0; i < values().length; i++) {
|
|
|
|
|
if (values()[i].value == val) {
|
|
|
|
@ -175,9 +175,9 @@ public class MesPcnEnumUtil {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 根据value返回枚举类型,主要在switch中使用
|
|
|
|
|
public static MES_MATCH_TYPE getByValue(String value) {
|
|
|
|
|
public static MES_MATCH_TYPE getByValue(int value) {
|
|
|
|
|
for (MES_MATCH_TYPE mesMatchType : values()) {
|
|
|
|
|
if (mesMatchType.getValue().equals(value)) {
|
|
|
|
|
if (mesMatchType.getValue() == value) {
|
|
|
|
|
return mesMatchType;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -191,19 +191,19 @@ public class MesPcnEnumUtil {
|
|
|
|
|
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
|
|
|
|
public enum MES_CODE_TYPE {
|
|
|
|
|
|
|
|
|
|
SERIAL_SN("10", "过程条码"),
|
|
|
|
|
PRODUCT_SN("20", "产品条码"),
|
|
|
|
|
PACK_SN("30", "包装条码");
|
|
|
|
|
SERIAL_SN(10, "过程条码"),
|
|
|
|
|
PRODUCT_SN(20, "产品条码"),
|
|
|
|
|
PACK_SN(30, "包装条码");
|
|
|
|
|
|
|
|
|
|
private String value;
|
|
|
|
|
private int value;
|
|
|
|
|
private String description;
|
|
|
|
|
|
|
|
|
|
MES_CODE_TYPE(String value, String description) {
|
|
|
|
|
MES_CODE_TYPE(int value, String description) {
|
|
|
|
|
this.value = value;
|
|
|
|
|
this.description = description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getValue() {
|
|
|
|
|
public int getValue() {
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -211,7 +211,7 @@ public class MesPcnEnumUtil {
|
|
|
|
|
return description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String valueOfDescription(String val) {
|
|
|
|
|
public static String valueOfDescription(int val) {
|
|
|
|
|
String tmp = null;
|
|
|
|
|
for (int i = 0; i < values().length; i++) {
|
|
|
|
|
if (values()[i].value == val) {
|
|
|
|
|