From 644af42dfed43c9bbdfb11adac6b3848eb6867d6 Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Sun, 1 Mar 2020 16:18:47 +0800 Subject: [PATCH] ptl enum --- .../i3plus/pojo/base/enumutil/PtlPcnEnumUtil.java | 64 ++++++++++++---------- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/PtlPcnEnumUtil.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/PtlPcnEnumUtil.java index 4929d69..45e5c53 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/PtlPcnEnumUtil.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/PtlPcnEnumUtil.java @@ -12,6 +12,41 @@ import org.springframework.util.StringUtils; public class PtlPcnEnumUtil { /** + * 控制器状态 + */ + @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; + } + } + + /** * 标签器LED数字解析枚举 */ @JsonFormat(shape = JsonFormat.Shape.OBJECT) @@ -555,6 +590,7 @@ public class PtlPcnEnumUtil { public enum MonitorProcessMessageType { CONNECT_CONTROL_CMD(10, "CONNECT_CONTROL_CMD", "connectControlService", "连接控制器"), DISCONNECT_CONTROL_CMD(20, "DISCONNECT_CONTROL_CMD", "disconnectControlService", "断开控制器"), + EXCEPTION__DISCONNECT_CONTROL_CMD(25, "EXCEPTION__DISCONNECT_CONTROL_CMD", "disconnectControlService", "断开控制器"), LIGHT_ON_CMD(30, "LIGHT_ON_CMD", "lightOnService", "亮灯命令"), LIGHT_OFF_CMD(40, "LIGHT_OFF_CMD", "lightOffService", "灭灯命令"), CONTROL_SIGNAL_CMD(50, "CONTROL_SIGNAL_CMD", "controlSignalService", "控制器反馈信号"), @@ -740,34 +776,6 @@ public class PtlPcnEnumUtil { } @JsonFormat(shape = JsonFormat.Shape.OBJECT) - public enum CONTROL_STATUS { - CONNECT(10, "CONNECT", "连接"), - DISCONNECT(20, "DISCONNECT", "断开"); - - private int value; - private String code; - private String description; - - CONTROL_STATUS(int value, String code, String description) { - this.value = value; - this.code = code; - this.description = description; - } - - public int getValue() { - return value; - } - - public String getCode() { - return code; - } - - public String getDescription() { - return description; - } - } - - @JsonFormat(shape = JsonFormat.Shape.OBJECT) public enum AREA_SECTION_TASK_DETAIL_STATUS { CREATE(10, "CREATE", "创建"), COMPLETE(20, "COMPLETE", "完成");