|
|
|
@ -2,6 +2,12 @@ package cn.estsh.i3plus.pojo.base.enumutil;
|
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
|
|
|
|
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description :
|
|
|
|
|
* @Reference :
|
|
|
|
@ -296,6 +302,7 @@ public class WmsEnumUtil {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 产品入库,发运状态
|
|
|
|
|
* WMS_产品报工明细信息 :单据状态
|
|
|
|
|
*/
|
|
|
|
|
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
|
|
|
|
public enum PRODUCT_INSTOCK_STATUS {
|
|
|
|
@ -601,7 +608,10 @@ public class WmsEnumUtil {
|
|
|
|
|
IN_STOCK("IN_STOCK", "入库单"),
|
|
|
|
|
SHIPPING("SHIPPING", "发运单"),
|
|
|
|
|
QC("QC", "质检"),
|
|
|
|
|
CS("CS", "盘点");
|
|
|
|
|
CS("CS", "盘点"),
|
|
|
|
|
DR("DR", "直送收货"),
|
|
|
|
|
AMPR("AMPR", "AMP拉动收货");
|
|
|
|
|
|
|
|
|
|
private String value;
|
|
|
|
|
private String description;
|
|
|
|
|
|
|
|
|
@ -2673,4 +2683,81 @@ public class WmsEnumUtil {
|
|
|
|
|
return description;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 外部接口单据来源枚举
|
|
|
|
|
*/
|
|
|
|
|
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
|
|
|
|
public enum SRC_STATUS {
|
|
|
|
|
ZMMES("ZMMES", "知明MES"),
|
|
|
|
|
TBMES("TBMES", "MES接口");
|
|
|
|
|
|
|
|
|
|
private String value;
|
|
|
|
|
private String description;
|
|
|
|
|
|
|
|
|
|
SRC_STATUS(String value, String description) {
|
|
|
|
|
this.value = value;
|
|
|
|
|
this.description = description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getValue() {
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getDescription() {
|
|
|
|
|
return description;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;// 枚举实例属性
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
// 枚举类方法初始化
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
enumMap.put("enumName", clazz.getSimpleName());
|
|
|
|
|
enumMap.put("valuesList", values);
|
|
|
|
|
return enumMap;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|