优化枚举

yun-zuoyi
柯裕 6 years ago
parent c2e01000e5
commit 3d8b3983c3

@ -184,7 +184,7 @@ public class WmsEnumUtil {
}
/**
* PO
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum ORDER_DETAILS_STATUS {
@ -237,6 +237,59 @@ public class WmsEnumUtil {
}
/**
* PO
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum PO_SN_STATUS {
CREATE(10, "N", "创建"),
RECEIPTED(20, "R", "已完成"),
CANCEL(30, "C", "行取消"),
PRINTED(40, "C", "已打印");
private int value;
private String code;
private String description;
PO_SN_STATUS(int value, String code, String description) {
this.value = value;
this.code = code;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public String getCode() {
return code;
}
public static String valueOf(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
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;
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)

Loading…
Cancel
Save