diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/PtlEnumUtil.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/PtlEnumUtil.java index 465551f..f8e7e86 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/PtlEnumUtil.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/PtlEnumUtil.java @@ -1,5 +1,7 @@ package cn.estsh.i3plus.pojo.base.enumutil; +import com.fasterxml.jackson.annotation.JsonFormat; + /** * @author Wynne.Lu * @date 2020/2/12 17:41 @@ -7,4 +9,325 @@ package cn.estsh.i3plus.pojo.base.enumutil; */ public class PtlEnumUtil { + + /** + * 标签类型 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum PTL_TAG_TYPE { + LOCATION_TAG(10, "库位标签"), + COMPLATE_TAG(20, "完成器标签"), + TAG_MONITOR(30, "标签显示器"), + TAG_SCAN_INTERFACE(40, "标签扫描接口"); + + private int value; + private String description; + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + private PTL_TAG_TYPE(int value, String description) { + this.value = value; + this.description = 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; + } + } + + /** + * 亮灯状态 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum PTL_LIGHT_STATUS { + LIGHT_OFF(10, "灭灯"), + COMPLATE_ON(20, "亮点"); + + private int value; + private String description; + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + private PTL_LIGHT_STATUS(int value, String description) { + this.value = value; + this.description = 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; + } + } + + /** + * 标签状态 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum PTL_TAG_STATUS { + NORMAL(10, "正常"), + UNAVAILABLE(20, "不可用"); + + private int value; + private String description; + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + private PTL_TAG_STATUS(int value, String description) { + this.value = value; + this.description = 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; + } + } + + /** + * 亮灯方式 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum PTL_LIGHT_MODE { + LIGHT(10, "常亮"), + TWINKLE(20, "闪烁"); + + private int value; + private String description; + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + private PTL_LIGHT_MODE(int value, String description) { + this.value = value; + this.description = 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; + } + } + + /** + * 亮灯颜色 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum PTL_LIGHT_COLOR { + WHITE(10, "白色"), + RED(20, "红色"), + GREEN(30, "绿色"), + BLUE(40, "蓝色"), + YELLOW(50, "黄色"); + + private int value; + private String description; + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + private PTL_LIGHT_COLOR(int value, String description) { + this.value = value; + this.description = 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; + } + } + + /** + * 是否蜂鸣 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum PTL_IS_BUZZING { + YES(1, "是"), + NO(2, "否"); + + private int value; + private String description; + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + private PTL_IS_BUZZING(int value, String description) { + this.value = value; + this.description = 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; + } + } + + /** + * 控制器类型 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum PTL_CONTROL_TYPE { + ATOP(10, "上尚"), + AIOI(20, "爱欧"); + + private int value; + private String description; + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + private PTL_CONTROL_TYPE(int value, String description) { + this.value = value; + this.description = 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; + } + } + + /** + * 控制器状态 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum PTL_CONTROL_STATUS { + CONNECT(10, "连接"), + BREAK(20, "断开"); + + private int value; + private String description; + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + private PTL_CONTROL_STATUS(int value, String description) { + this.value = value; + this.description = 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; + } + } + + /** + * 物料类型 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum PTL_PART_TYPE { + RAW_MATERIAL(10, "原材料"), + PARTIALLY_PREPARED_PRODUCTS(20, "半成品"), + FINISHED_PRODUCT(30, "成品"); + + private int value; + private String description; + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + private PTL_PART_TYPE(int value, String description) { + this.value = value; + this.description = 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; + } + } } diff --git a/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/bean/PtlPart.java b/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/bean/PtlPart.java index 5fa6743..ec95884 100644 --- a/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/bean/PtlPart.java +++ b/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/bean/PtlPart.java @@ -43,7 +43,7 @@ public class PtlPart extends BaseBean implements Serializable { @Column(name = "PART_TYPE") @ApiParam("物料类型") - @DynamicField(webFieldType = WmsEnumUtil.FIELD_TYPE.TEXT) + @DynamicField(webFieldType = WmsEnumUtil.FIELD_TYPE.SELECT, enumName = "PTL_PART_TYPE") private String partType; @Column(name = "UNIT") diff --git a/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/bean/PtlTag.java b/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/bean/PtlTag.java index 6362be4..f3d4028 100644 --- a/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/bean/PtlTag.java +++ b/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/bean/PtlTag.java @@ -64,7 +64,7 @@ public class PtlTag extends BaseBean implements Serializable { @Column(name = "TAG_TYPE") @ApiParam("标签类型") - @DynamicField(webFieldType = WmsEnumUtil.FIELD_TYPE.TEXT) + @DynamicField(webFieldType = WmsEnumUtil.FIELD_TYPE.SELECT, enumName = "PTL_TAG_TYPE") private Integer tagType; @Column(name = "LIGHT_STATUS")