|
|
|
@ -94,7 +94,8 @@ public class WmsEnumUtil {
|
|
|
|
|
REG(10, "REG", "原物料采购"),
|
|
|
|
|
SUB(20, "SUB", "委外采购"),
|
|
|
|
|
TAR(30, "TAR", "多角贸易采购"),
|
|
|
|
|
TAP(40, "TAP", "多角代采购");
|
|
|
|
|
TAP(40, "TAP", "多角代采购"),
|
|
|
|
|
AMP(50, "AMP", "AMP拉动");
|
|
|
|
|
|
|
|
|
|
private int value;
|
|
|
|
|
private String code;
|
|
|
|
@ -2690,7 +2691,8 @@ public class WmsEnumUtil {
|
|
|
|
|
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
|
|
|
|
public enum SRC_STATUS {
|
|
|
|
|
ZMMES("ZMMES", "知明MES"),
|
|
|
|
|
TBMES("TBMES", "MES接口");
|
|
|
|
|
TBMES("TBMES", "MES接口"),
|
|
|
|
|
AMP("AMP","AMP系统");
|
|
|
|
|
|
|
|
|
|
private String value;
|
|
|
|
|
private String description;
|
|
|
|
@ -2709,55 +2711,144 @@ public class WmsEnumUtil {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Map<String, Object> getEnumByName(String enumName) throws Exception{
|
|
|
|
|
Class innerClazz[] = WmsEnumUtil.class.getDeclaredClasses();// 获取常量类中的所有内部类
|
|
|
|
|
Class<Enum> clazz;
|
|
|
|
|
Enum[] enumConstants;
|
|
|
|
|
public static Map<String, Object> getEnumByName(String enumName) throws Exception {
|
|
|
|
|
Class innerClazz[] = WmsEnumUtil.class.getDeclaredClasses();// 获取常量类中的所有内部类
|
|
|
|
|
Class<Enum> clazz;
|
|
|
|
|
Enum[] enumConstants;
|
|
|
|
|
|
|
|
|
|
Map<String, Object> enumMap;// 枚举类
|
|
|
|
|
List<Map<String, Object>> values;// 枚举实例【enumName:{“”:},{“”:},{“”:}】
|
|
|
|
|
Map<String, Object> value;// 枚举实例属性
|
|
|
|
|
Map<String, Object> enumMap;// 枚举类
|
|
|
|
|
List<Map<String, Object>> values;// 枚举实例【enumName:{“”:},{“”:},{“”:}】
|
|
|
|
|
Map<String, Object> value;// 枚举实例属性
|
|
|
|
|
|
|
|
|
|
Method getValue;
|
|
|
|
|
Method getCode;
|
|
|
|
|
Method getDescription;
|
|
|
|
|
Method getValue;
|
|
|
|
|
Method getCode;
|
|
|
|
|
Method getDescription;
|
|
|
|
|
|
|
|
|
|
// 遍历内部类
|
|
|
|
|
String simpleName;//内部类的类名
|
|
|
|
|
for (Class class1 : innerClazz) {
|
|
|
|
|
//获取内部内的类名
|
|
|
|
|
simpleName = class1.getSimpleName();
|
|
|
|
|
if (simpleName.equals(enumName)) {
|
|
|
|
|
// 判断类是不是枚举类
|
|
|
|
|
clazz = (Class<Enum>) Class.forName("cn.estsh.i3plus.pojo.base.enumutil.WmsEnumUtil$" + simpleName);
|
|
|
|
|
// 遍历内部类
|
|
|
|
|
String simpleName;//内部类的类名
|
|
|
|
|
for (Class class1 : innerClazz) {
|
|
|
|
|
//获取内部内的类名
|
|
|
|
|
simpleName = class1.getSimpleName();
|
|
|
|
|
if (simpleName.equals(enumName)) {
|
|
|
|
|
// 判断类是不是枚举类
|
|
|
|
|
clazz = (Class<Enum>) Class.forName("cn.estsh.i3plus.pojo.base.enumutil.WmsEnumUtil$" + simpleName);
|
|
|
|
|
|
|
|
|
|
// 枚举类方法初始化
|
|
|
|
|
getCode = null;
|
|
|
|
|
try {
|
|
|
|
|
getCode = clazz.getMethod("getCode");
|
|
|
|
|
} catch (NoSuchMethodException e) {
|
|
|
|
|
}
|
|
|
|
|
getValue = clazz.getMethod("getValue");
|
|
|
|
|
getDescription = clazz.getMethod("getDescription");
|
|
|
|
|
|
|
|
|
|
// 获取所有枚举实例
|
|
|
|
|
enumConstants = clazz.getEnumConstants();
|
|
|
|
|
enumMap = new HashMap<>();
|
|
|
|
|
values = new ArrayList<>();
|
|
|
|
|
for (Enum enum1 : enumConstants) {
|
|
|
|
|
value = new HashMap<>();
|
|
|
|
|
value.put("value", getValue.invoke(enum1));
|
|
|
|
|
if (getCode != null) {
|
|
|
|
|
value.put("code", getCode.invoke(enum1));
|
|
|
|
|
}
|
|
|
|
|
value.put("description", getDescription.invoke(enum1));
|
|
|
|
|
values.add(value);
|
|
|
|
|
// 枚举类方法初始化
|
|
|
|
|
getCode = null;
|
|
|
|
|
try {
|
|
|
|
|
getCode = clazz.getMethod("getCode");
|
|
|
|
|
} catch (NoSuchMethodException e) {
|
|
|
|
|
}
|
|
|
|
|
getValue = clazz.getMethod("getValue");
|
|
|
|
|
getDescription = clazz.getMethod("getDescription");
|
|
|
|
|
|
|
|
|
|
// 获取所有枚举实例
|
|
|
|
|
enumConstants = clazz.getEnumConstants();
|
|
|
|
|
enumMap = new HashMap<>();
|
|
|
|
|
values = new ArrayList<>();
|
|
|
|
|
for (Enum enum1 : enumConstants) {
|
|
|
|
|
value = new HashMap<>();
|
|
|
|
|
value.put("value", getValue.invoke(enum1));
|
|
|
|
|
if (getCode != null) {
|
|
|
|
|
value.put("code", getCode.invoke(enum1));
|
|
|
|
|
}
|
|
|
|
|
enumMap.put("enumName", clazz.getSimpleName());
|
|
|
|
|
enumMap.put("valuesList", values);
|
|
|
|
|
return enumMap;
|
|
|
|
|
value.put("description", getDescription.invoke(enum1));
|
|
|
|
|
values.add(value);
|
|
|
|
|
}
|
|
|
|
|
enumMap.put("enumName", clazz.getSimpleName());
|
|
|
|
|
enumMap.put("valuesList", values);
|
|
|
|
|
return enumMap;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 库存数量类型
|
|
|
|
|
*/
|
|
|
|
|
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
|
|
|
|
public enum STOCK_QUAN_QTY_TYPE {
|
|
|
|
|
QTY("qty", "可用数量"),
|
|
|
|
|
FAIL_QTY("failQty", "不合格数量"),
|
|
|
|
|
HOLD_QTY("holdQty", "隔离数量"),
|
|
|
|
|
QC_QTY("qcQty", "质检中数量"),
|
|
|
|
|
RIN_QTY("rinQty", "待入库数量"),
|
|
|
|
|
FREEZE_QTY("freezeQty", "冻结数量"),
|
|
|
|
|
CONSIGN_QTY("consignQty", "寄售数量"),
|
|
|
|
|
LOCK_QTY("lockQty", "锁定数量"),
|
|
|
|
|
SCRAP_QTY("scrapQty", "报废数量");
|
|
|
|
|
|
|
|
|
|
private String code;
|
|
|
|
|
private String description;
|
|
|
|
|
|
|
|
|
|
STOCK_QUAN_QTY_TYPE(String code, String description) {
|
|
|
|
|
this.code = code;
|
|
|
|
|
this.description = description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getDescription() {
|
|
|
|
|
return description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getCode() {
|
|
|
|
|
return code;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getValue() {
|
|
|
|
|
return code;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static STOCK_QUAN_QTY_TYPE codeOf(String code) {
|
|
|
|
|
for (int i = 0; i < values().length; i++) {
|
|
|
|
|
if (values()[i].code.equals(code)) {
|
|
|
|
|
return values()[i];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String getDescription(String code) {
|
|
|
|
|
String tmp = null;
|
|
|
|
|
for (int i = 0; i < values().length; i++) {
|
|
|
|
|
if (values()[i].code == code) {
|
|
|
|
|
tmp = values()[i].description;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ERP同步标识 10=待同步,20=同步成功,30=同步失败
|
|
|
|
|
*/
|
|
|
|
|
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
|
|
|
|
public enum WMS_ERP_SYNC_FLAG {
|
|
|
|
|
CREATE(10, "待同步"), SUCCESS(20, "同步成功"), FAIL(30, "同步失败");
|
|
|
|
|
|
|
|
|
|
private int value;
|
|
|
|
|
private String description;
|
|
|
|
|
|
|
|
|
|
WMS_ERP_SYNC_FLAG(int value, String description) {
|
|
|
|
|
this.value = value;
|
|
|
|
|
this.description = description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getValue() {
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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].value == val) {
|
|
|
|
|
tmp = values()[i].description;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|