package cn.estsh.i3plus.pojo.base.enumutil;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.StringUtils;

/**
 * @author Wynne.Lu
 * @date 2020/2/12 17:41
 * @desc
 */

public class PtlPcnEnumUtil {

    /**
     * 状态机异常处理状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum FINISH_PICK_SEND_FLAG {
        SECTION(10, "10", "区段"),
        AREA(10, "20", "区域");

        private int value;
        private String code;
        private String description;

        FINISH_PICK_SEND_FLAG(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 ROUTE_STATUS_ERROR_RECORD_HANDLE_STATUS {
        TRUE(10, "已处理"),
        FALSE(20, "未处理");

        private int value;
        private String description;

        ROUTE_STATUS_ERROR_RECORD_HANDLE_STATUS(int value, String description) {
            this.value = value;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }
    }

    /**
     * 控制器状态
     */
    @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)
    public enum TAG_LED_CONTENT_CMD {
        TAG_0("30", "0", "0"),
        TAG_1("31", "1", "1"),
        TAG_2("32", "2", "2"),
        TAG_3("33", "3", "3"),
        TAG_4("34", "4", "4"),
        TAG_5("35", "5", "5"),
        TAG_6("36", "6", "6"),
        TAG_7("37", "7", "7"),
        TAG_8("38", "8", "8"),
        TAG_9("39", "9", "9"),
        TAG_A("41", "A", "A"),
        TAG_b("62", "b", "b"),
        TAG_C("43", "C", "C"),
        TAG_d("64", "d", "d"),
        TAG_E("45", "E", "E"),
        TAG_F("46", "F", "F"),
        TAG_c("63", "c", "c"),
        TAG_H("48", "H", "H"),
        TAG_L("4C", "L", "L"),
        TAG_SPACE("20", " ", " "),
        TAG_n("6E", "n", "n"),
        TAG_o("6F", "o", "o"),
        TAG_h("68", "h", "h"),
        TAG_r("72", "r", "r"),
        TAG_u("75", "u", "u"),
        TAG_i("69", "i", "i"),
        TAG_y("79", "y", "y"),
        TAG_t("74", "t", "t"),
        TAG_q("71", "q", "q"),
        TAG_G("47", "G", "G"),
        TAG_S("53", "S", "S"),
        TAG_l("6C", "l", "l"),
        TAG_O("4F", "O", "O"),
        TAG_SQUARE_BRACKET_LEFT("5B", "[", "["),
        TAG_SQUARE_BRACKET_RIGHT("5D", "]", "]"),
        TAG_P("50", "P", "P"),
        TAG_U("55", "U", "U"),
        TAG_HYPHEN("2D", "-", "-");

        private String code;
        private String value;
        private String description;

        TAG_LED_CONTENT_CMD(String code, String value, String description) {
            this.code = code;
            this.value = value;
            this.description = description;
        }

        public String getCode() {
            return code;
        }

        public String getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(String value) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value.equals(value)) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }
    }

    /**
     * 标签器LED小数点解析枚举
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum TAG_LED_POINT_CMD {
        TAG_POINT_0("00", "000000", "000000"),
        TAG_POINT_1("01", "000000.", "000000."),
        TAG_POINT_2("02", "00000.0", "00000.0"),
        TAG_POINT_12("03", "00000.0.", "00000.0."),
        TAG_POINT_3("04", "0000.00", "0000.00"),
        TAG_POINT_13("05", "0000.00.", "0000.00."),
        TAG_POINT_23("06", "0000.0.0", "0000.0.0"),
        TAG_POINT_123("07", "0000.0.0.", "0000.0.0."),
        TAG_POINT_4("08", "000.000", "000.000"),
        TAG_POINT_14("09", "000.000.", "000.000."),
        TAG_POINT_24("0A", "000.00.0", "000.00.0"),
        TAG_POINT_124("0B", "000.00.0.", "000.00.0."),
        TAG_POINT_34("0C", "000.0.00", "000.0.00"),
        TAG_POINT_134("0D", "000.0.00.", "000.0.00."),
        TAG_POINT_234("0E", "000.0.0.0", "000.0.0.0"),
        TAG_POINT_1234("0F", "000.0.0.0.", "000.0.0.0."),
        TAG_POINT_5("10", "00.0000", "00.0000"),
        TAG_POINT_15("11", "00.0000.", "00.0000."),
        TAG_POINT_25("12", "00.000.0", "00.000.0"),
        TAG_POINT_125("13", "00.000.0.", "00.000.0."),
        TAG_POINT_35("14", "00.00.00", "00.00.00"),
        TAG_POINT_135("15", "00.00.00.", "00.00.00."),
        TAG_POINT_235("16", "00.00.0.0", "00.00.0.0"),
        TAG_POINT_1235("17", "00.00.0.0.", "00.00.0.0."),
        TAG_POINT_45("18", "00.0.000", "00.0.000"),
        TAG_POINT_145("19", "00.0.000.", "00.0.000."),
        TAG_POINT_245("1A", "00.0.00.0", "00.0.00.0"),
        TAG_POINT_1245("1B", "00.0.00.0.", "00.0.00.0."),
        TAG_POINT_345("1C", "00.0.0.00", "00.0.0.00"),
        TAG_POINT_1345("1D", "00.0.0.00.", "00.0.0.00."),
        TAG_POINT_2345("1E", "00.0.0.0.0", "00.0.0.0.0"),
        TAG_POINT_12345("1F", "00.0.0.0.0.", "00.0.0.0.0."),
        TAG_POINT_6("20", "0.00000", "0.00000"),
        TAG_POINT_16("21", "0.00000.", "0.00000."),
        TAG_POINT_26("22", "0.0000.0", "0.0000.0"),
        TAG_POINT_126("23", "0.0000.0.", "0.0000.0."),
        TAG_POINT_36("24", "0.000.00", "0.000.00"),
        TAG_POINT_136("25", "0.000.00.", "0.000.00."),
        TAG_POINT_236("26", "0.000.0.0", "0.000.0.0"),
        TAG_POINT_1236("27", "0.000.0.0.", "0.000.0.0."),
        TAG_POINT_46("28", "0.00.000", "0.00.000"),
        TAG_POINT_146("29", "0.00.000.", "0.00.000."),
        TAG_POINT_246("2A", "0.00.00.0", "0.00.00.0"),
        TAG_POINT_1246("2B", "0.00.00.0.", "0.00.00.0."),
        TAG_POINT_346("2C", "0.00.0.00", "0.00.0.00"),
        TAG_POINT_1346("2D", "0.00.0.00.", "0.00.0.00."),
        TAG_POINT_2346("2E", "0.00.0.0.0", "0.00.0.0.0"),
        TAG_POINT_12346("2F", "0.00.0.0.0.", "0.00.0.0.0."),
        TAG_POINT_56("30", "0.0.0000", "0.0.0000"),
        TAG_POINT_156("31", "0.0.0000.", "0.0.0000."),
        TAG_POINT_256("32", "0.0.000.0", "0.0.000.0"),
        TAG_POINT_1256("33", "0.0.000.0.", "0.0.000.0."),
        TAG_POINT_356("34", "0.0.00.00", "0.0.00.00"),
        TAG_POINT_1356("35", "0.0.00.00.", "0.0.00.00."),
        TAG_POINT_2356("36", "0.0.00.0.0", "0.0.00.0.0"),
        TAG_POINT_12356("37", "0.0.00.0.0.", "0.0.00.0.0."),
        TAG_POINT_456("38", "0.0.0.000", "0.0.0.000"),
        TAG_POINT_1456("39", "0.0.0.000.", "0.0.0.000."),
        TAG_POINT_2456("3A", "0.0.0.00.0", "0.0.0.00.0"),
        TAG_POINT_12456("3B", "0.0.0.00.0.", "0.0.0.00.0."),
        TAG_POINT_3456("3C", "0.0.0.0.00", "0.0.0.0.00"),
        TAG_POINT_13456("3D", "0.0.0.0.00.", "0.0.0.0.00."),
        TAG_POINT_23456("3E", "0.0.0.0.0.0", "0.0.0.0.0.0"),
        TAG_POINT_123456("3F", "0.0.0.0.0.0.", "0.0.0.0.0.0.");

        private String code;
        private String value;
        private String description;

        TAG_LED_POINT_CMD(String code, String value, String description) {
            this.code = code;
            this.value = value;
            this.description = description;
        }

        public String getCode() {
            return code;
        }

        public String getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(String value) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value.equals(value)) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }
    }

    /**
     * 标签控制器子命令枚举
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum TAG_CONTROL_CHILD_CMD {
        CHILD_CMD_00H("00", "在标签上显示字母数字(备注)"),
        CHILD_CMD_01H("01", "关闭标签所有字符/清除缓冲区中的所有显示"),
        CHILD_CMD_02H("02", "打开灯光指示器"),
        CHILD_CMD_03H("03", "关闭灯光指示器"),
        CHILD_CMD_04H("04", "蜂鸣器打开"),
        CHILD_CMD_05H("05", "蜂鸣器关闭"),
        CHILD_CMD_06H("06", "按钮返回确认消息"),
        CHILD_CMD_07H("07", "按下按钮返回缺货信息"),
        CHILD_CMD_08H("08", "设置最大地址轮询值"),
        CHILD_CMD_09H("09", "连接的现场设备的返回状态"),
        CHILD_CMD_0AH("0A", "现场设备超时"),
        CHILD_CMD_0BH("0B", "查询设备故障，返回设备故障"),
        CHILD_CMD_0CH("0C", "设备无法执行命令"),
        CHILD_CMD_0DH("0D", "返回按钮锁定消息 (只有在从本机发送消息到设备后才激活)"),
        CHILD_CMD_FCH("FC", "设备重置 OK，获取设备详细信息，返回设备的详细信息(与重置 OK 相同)"),
        CHILD_CMD_0FH("0F", "返回库存模式下的缺货量"),
        CHILD_CMD_10H("10", "在标签上闪烁字母数字"),
        CHILD_CMD_11H("11", "指示灯闪烁"),
        CHILD_CMD_12H("12", "设置闪烁时间间隔"),
        CHILD_CMD_13H("13", "显示标签地址"),
        CHILD_CMD_14H("14", "重置设备"),
        CHILD_CMD_15H("15", "禁用缺货按钮"),
        CHILD_CMD_16H("16", "启用缺货按钮"),
        CHILD_CMD_17H("17", "模拟确认按钮"),
        CHILD_CMD_18H("18", "模拟缺货按键"),
        CHILD_CMD_19H("19", "切换为盘点模式"),
        CHILD_CMD_1AH("1A", "切换为拣货模式"),
        CHILD_CMD_1BH("1B", "禁用确认键"),
        CHILD_CMD_1CH("1C", "启用确认和缺货按钮"),
        CHILD_CMD_1EH("1E", "设置计数位"),
        CHILD_CMD_1FH("1F", "设置标签多个配置"),
        CHILD_CMD_3AH("3A", "设置设备地址"),
        CHILD_CMD_64H("64", "设备返回"),
        CHILD_CMD_FAH("FA", "获取设备的 F/W 模型信息，返回设备的 F/W 模型信息"),
        CHILD_CMD_F7H("F7", "获取/启用/禁用警报自动蜂鸣器功能,获取/启用/禁用报警自动报告模式");

        private String code;
        private String description;

        TAG_CONTROL_CHILD_CMD(String code, String description) {
            this.code = code;
            this.description = description;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

    }

    /**
     * 反馈信号子命令(灭灯状态)
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum SIGNAL_CHILD_CMD {
        CHILD_CMD_06H("06", 6, "正常"),
        CHILD_CMD_07H("07", 7, "缺货"),
        CHILD_CMD_09H("09", 9, "连接的现场设备的返回状态"),
        CHILD_CMD_FFH("FF", 255, "无效消息"),
        CHILD_CMD_0AH("0A", 10, "现场设备超时"),
        CHILD_CMD_0BH("0B", 11, "查询设备故障，返回设备故障"),
        CHILD_CMD_0CH("0C", 12, "设备无法执行命令,用错命令"),
        CHILD_CMD_0DH("0D", 13, "返回按钮锁定消息,卡键,按键卡住"),
        CHILD_CMD_0FH("0F", 15, "返回库存模式下的缺货量"),
        CHILD_CMD_64H("64", 100, "熄灭情况下返回"),
        CHILD_CMD_FAH("FA", 250, "设备的 F/W 模型信息"),
        CHILD_CMD_FCH("FC", 252, "标签产品信息");

        private String code;
        private Integer value;
        private String description;

        SIGNAL_CHILD_CMD(String code, Integer value, String description) {
            this.code = code;
            this.value = value;
            this.description = description;
        }

        public static SIGNAL_CHILD_CMD getByValue(String code) {
            for (SIGNAL_CHILD_CMD signalChildCmd : values()) {
                if (signalChildCmd.getCode().equals(code)) {
                    return signalChildCmd;
                }
            }
            return null;
        }

        public static Integer codeOfValue(String code) {
            Integer tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }


        public String getCode() {
            return code;
        }

        public Integer getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

    }

    /**
     * 标签显示器亮灯颜色枚举
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum TAG_LIGHT_COLOR_CMD {
        TAG_LIGHT_COLOR_RED("00", 1, "红"),
        TAG_LIGHT_COLOR_GREEN("01", 2, "绿"),
        TAG_LIGHT_COLOR_ORANGE("02", 3, "橙"),
        TAG_LIGHT_COLOR_BLUE("03", 4, "蓝"),
        TAG_LIGHT_COLOR_PINK_RED("04", 5, "粉红"),
        TAG_LIGHT_COLOR_BLUE_GREEN("05", 6, "蓝绿");

        private String code;
        private Integer value;
        private String description;

        TAG_LIGHT_COLOR_CMD(String code, Integer value, String description) {
            this.code = code;
            this.value = value;
            this.description = description;
        }

        public static TAG_LIGHT_COLOR_CMD getByValue(String code) {
            for (TAG_LIGHT_COLOR_CMD tagLightColorCmd : values()) {
                if (tagLightColorCmd.getCode().equals(code)) {
                    return tagLightColorCmd;
                }
            }
            return null;
        }

        public static String valueOf(int value) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == value) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public String getCode() {
            return code;
        }

        public Integer getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

    }

    /**
     * 标签亮灯方式枚举
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum TAG_LIGHT_TYPE {
        TAG_LIGHT_TYPE_LIGHT(10, "常亮"),
        TAG_LIGHT_TYPE_TWINKLE(20, "闪烁");

        private int value;
        private String description;

        TAG_LIGHT_TYPE(int value, String description) {
            this.value = value;
            this.description = description;
        }

        public static TAG_LIGHT_TYPE getByValue(int value) {
            for (TAG_LIGHT_TYPE tagLightType : values()) {
                if (tagLightType.getValue() == value) {
                    return tagLightType;
                }
            }
            return null;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

    }

    /**
     * 完成器音乐枚举
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum FINISH_TAG_LIGHT_MUSIC_CMD {
        FINISH_TAG_LIGHT_MUSIC_00H("00", 1, "Jingle bells"),
        FINISH_TAG_LIGHT_MUSIC_01H("01", 2, "Carmen"),
        FINISH_TAG_LIGHT_MUSIC_02H("02", 3, "Happy Chinese new year"),
        FINISH_TAG_LIGHT_MUSIC_03H("03", 4, "Edelweiss"),
        FINISH_TAG_LIGHT_MUSIC_04H("04", 5, "Going home"),
        FINISH_TAG_LIGHT_MUSIC_05H("05", 6, "PAPALA"),
        FINISH_TAG_LIGHT_MUSIC_06H("06", 7, "Classical"),
        FINISH_TAG_LIGHT_MUSIC_07H("07", 8, "Listen to the rhythm of the falling rain"),
        FINISH_TAG_LIGHT_MUSIC_08H("08", 9, "Rock and roll"),
        FINISH_TAG_LIGHT_MUSIC_09H("09", 10, "Happy birthday"),
        FINISH_TAG_LIGHT_MUSIC_0AH("0A", 11, "Do Re Me"),
        FINISH_TAG_LIGHT_MUSIC_0BH("0B", 12, "Strauss");

        private String code;
        private Integer value;
        private String description;

        FINISH_TAG_LIGHT_MUSIC_CMD(String code, Integer value, String description) {
            this.code = code;
            this.value = value;
            this.description = description;
        }

        public static FINISH_TAG_LIGHT_MUSIC_CMD getByValue(String code) {
            for (FINISH_TAG_LIGHT_MUSIC_CMD finishTagLightMusicCmd : values()) {
                if (finishTagLightMusicCmd.getCode().equals(code)) {
                    return finishTagLightMusicCmd;
                }
            }
            return null;
        }

        public static String valueOf(int value) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == value) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public String getCode() {
            return code;
        }

        public Integer getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

    }

    /**
     * 完成器音量枚举
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum FINISH_TAG_LIGHT_VOLUME_CMD {
        FINISH_TAG_LIGHT_VOLUME_00H("00", "0"),
        FINISH_TAG_LIGHT_VOLUME_01H("01", "1"),
        FINISH_TAG_LIGHT_VOLUME_02H("02", "2"),
        FINISH_TAG_LIGHT_VOLUME_03H("03", "3"),
        FINISH_TAG_LIGHT_VOLUME_04H("04", "4"),
        FINISH_TAG_LIGHT_VOLUME_05H("05", "5"),
        FINISH_TAG_LIGHT_VOLUME_06H("06", "6"),
        FINISH_TAG_LIGHT_VOLUME_07H("07", "7"),
        FINISH_TAG_LIGHT_VOLUME_08H("08", "8"),
        FINISH_TAG_LIGHT_VOLUME_09H("09", "9"),
        FINISH_TAG_LIGHT_VOLUME_0AH("0A", "10"),
        FINISH_TAG_LIGHT_VOLUME_0BH("0B", "11"),
        FINISH_TAG_LIGHT_VOLUME_0CH("0C", "12"),
        FINISH_TAG_LIGHT_VOLUME_0DH("0D", "13"),
        FINISH_TAG_LIGHT_VOLUME_0EH("0E", "14"),
        FINISH_TAG_LIGHT_VOLUME_0FH("0F", "15");

        private String code;
        private String description;

        FINISH_TAG_LIGHT_VOLUME_CMD(String code, String description) {
            this.code = code;
            this.description = description;
        }

        public static FINISH_TAG_LIGHT_VOLUME_CMD getByValue(String code) {
            for (FINISH_TAG_LIGHT_VOLUME_CMD finishTagLightVolumeCmd : values()) {
                if (finishTagLightVolumeCmd.getCode().equals(code)) {
                    return finishTagLightVolumeCmd;
                }
            }
            return null;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

    }

    /**
     * 状态机执行方法
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum ROUTE_STATUS_ACTION_TYPE {
        TRIGGER("10", "trigger", "触发"),
        ENTRY("20", "entry", "进入状态"),
        EXIT("30", "exit", "离开状态");

        private String value;
        private String code;
        private String description;

        ROUTE_STATUS_ACTION_TYPE(String value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public String getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }
    }

    /**
     * 流程状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum ROUTE_STATE {
        START(10, "START", "开启流程"),
        TERMINATE(20, "TERMINATE", "终止流程"),
        FINISH(30, "FINISH", "结束流程");

        private int value;
        private String code;
        private String description;

        ROUTE_STATE(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 TAG_TYPE {
        BIN_TAG(10, "库位标签"),
        FINALIZER_TAG(20, "完成器标签"),
        SCREEN_TAG(30, "标签显示器"),
        TAG_SCAN_API(40, "标签扫描接口");

        private int value;
        private String description;

        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;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }
    }

    /**
     * 流程状态-触发类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum ROUTE_STATUS_TRIGGER_TYPE {
        INNER_TRIGGER(10, "内部触发"),
        OUTER_TRIGGER(20, "外部触发");

        private int value;
        private String description;

        ROUTE_STATUS_TRIGGER_TYPE(int value, String description) {
            this.value = value;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }
    }

    /**
     * 作业流程类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum ACTION_ROUTE_TYPE {
        GEN_TASK(10, "GEN_TASK", "生成任务"),
        OFF_TAG(20, "OFF_TAG", "灭灯");

        private int value;
        private String code;
        private String description;

        ACTION_ROUTE_TYPE(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;
        }
    }

    /**
     * websocket业务类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum WS_BUSI_TYPE {
        MONITOR_PROCESS(10, "MONITOR_PROCESS", "控制器相关"),
        INTERFACE_PROCESS(20, "INTERFACE_PROCESS", "界面处理");

        private int value;
        private String code;
        private String description;

        WS_BUSI_TYPE(int value, String code, String description) {
            this.value = value;
            this.description = description;
            this.code = code;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }
    }

    /**
     * websocket消息类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum WS_DATA_TYPE {
        TEXT(10, "TEXT", "正常信息"),
        EXP_TEXT(20, "EXP_TEXT", "异常信息"),
        TABLE(30, "TABLE", "表格");

        private int value;
        private String code;
        private String description;

        WS_DATA_TYPE(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 ROUTE_STATUS_TYPE {
        START(10, "START", "开始状态"),
        EXECUTING(20, "EXECUTING", "执行中状态"),
        FINISH(30, "FINISH", "完成状态");

        private int value;
        private String code;
        private String description;

        ROUTE_STATUS_TYPE(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;
        }
    }

    /**
     * PTL_区段亮灯任务明细状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum AREA_SECTION_TASK_DETAIL_STATUS {
        CREATE(10, "CREATE", "创建"),
        COMPLETE(20, "COMPLETE", "完成"),
        CLOSE(30, "CLOSE", "关闭");

        private int value;
        private String code;
        private String description;

        AREA_SECTION_TASK_DETAIL_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;
        }
    }

    /**
     * PTL_区段亮灯任务状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum AREA_SECTION_TASK_STATUS {
        CREATE(10, "CREATE", "创建"),
        COMPLETE(20, "COMPLETE", "完成"),
        CLOSE(30, "CLOSE", "关闭");

        private int value;
        private String code;
        private String description;

        AREA_SECTION_TASK_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;
        }

        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;
        }

        public static String valueOfDescription(int val) {
            return valueOf(val);
        }
    }

    /**
     * PTL_主任务状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum PTL_MAIN_TASK_STATUS {
        CREATE(10, "CREATE", "创建"),
        COMPLETE(20, "COMPLETE", "完成"),
        CLOSE(30, "CLOSE", "关闭"),
        EXECUTION(40, "EXECUTION", "执行中");

        private int value;
        private String code;
        private String description;

        PTL_MAIN_TASK_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;
        }

        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;
        }

        public static String valueOfDescription(int val) {
            return valueOf(val);
        }
    }

    /**
     * PTL_主任务明细物料种类
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum MAIN_TASK_DETAIL_PART_CATEGORY {
        DOOR_LOCK_PART_NO(10, "DOOR_LOCK_PART_NO", "门锁零件号");

        private int value;
        private String code;
        private String description;

        MAIN_TASK_DETAIL_PART_CATEGORY(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;
        }

        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;
        }

        public static String valueOfDescription(int val) {
            return valueOf(val);
        }
    }

    /**
     * 打印类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum PRINT_TYPE {
        PART_NO(10, "PART_NO");

        private int value;
        private String description;

        PRINT_TYPE(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;
        }
    }

    /**
     * 打印状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum ETC_PRINT_STATUS {
        NOT_HIT(10, "未打"),
        ALREADY_HIT(20, "已打");

        private int value;
        private String description;

        ETC_PRINT_STATUS(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;
        }
    }

    /**
     * 系统配置表枚举
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum CONFIG_TYPE {
        FASTDFS_SAVE_PATH(10, "SAVE_PATH", ""),
        NGINX_HOST(20, "NGINX_HOST", ""),
        MES_STATION_SOCKET(30, "mes_station_socket", ""),
        GATEWAY_IP(40, "GATEWAY_HOST", ""),
        UPDATE_SYNC_TIME(50, "SYNC_DATA_URL", "UPDATE_SYNC_TIME"),
        PCN_PULL(60, "SYNC_DATA_URL", "PCN_PULL"),
        PCN_PUSH(70, "SYNC_DATA_URL", "PCN_PUSH"),
        FDFS_DOWNLOAD(80, "SYNC_DATA_URL", "FDFS_DOWNLOAD"),
        REWORK_REPAIR(90, "REWORK_REPAIR", ""),
        OPC_LINK_SERVER_URL(100, "OPC_LINK", "OPC_LINK_SERVER_URL"),
        OPC_LINK_USERNAME(110, "OPC_LINK", "OPC_LINK_USERNAME"),
        OPC_LINK_PASSWORD(120, "OPC_LINK", "OPC_LINK_PASSWORD"),
        OPC_LINK_REALM(130, "OPC_LINK", "OPC_LINK_REALM"),
        OPC_LINK_CALLBACK(140, "OPC_LINK", "OPC_LINK_CALLBACK"),
        SUPPLY_SWITCH(150, "SUPPLY_SWITCH", ""),
        PCN_LOGIN(160, "PCN_LOGIN", ""),
        PCN_MENU(170, "PCN_MENU", ""),
        PCN_MODULE(180, "PCN_MODULE", ""),
        PCN_LOGOUT(190, "PCN_LOGOUT", ""),
        UPDATE_LOCALE_RES(200, "LOCALE_RES_URL", "LOCALE_RES_URL"),
        PCN_SYS_LOCALE_LANGUAGE(210, "PCN_SYS_LOCALE_LANGUAGE", ""),
        PCN_SYS_ALL_LANGUAGE(220,"PCN_SYS_ALL_LANGUAGE","PCN_SYS_ALL_LANGUAGE"),
        PCN_SYS_RESOURCE_KEY_LANGUAGE(230,"PCN_SYS_RESOURCE_KEY_LANGUAGE","PCN_SYS_RESOURCE_KEY_LANGUAGE");

        private int value;
        private String code;
        private String description;

        CONFIG_TYPE(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;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    /**
     * PCN同步PTL主数据同步类型枚举
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum SYNC_TYPE {

        GET_PTL_DATA(1, "pcn获取Ptl数据"),
        DATA_TO_PTL(2, "pcn推送数据至ptl");

        private int value;
        private String description;

        SYNC_TYPE(int value, String description) {
            this.value = value;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfDescription(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 Integer descriptionOfValue(String description) {
            Integer tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].description.equals(description)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }
    }

    /**
     * PCN同步PTL主数据同步方式枚举
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum SYNC_PATTERN {

        UPDATE(1, "新增或修改"),
        INSERT(2, "新增");

        private int value;
        private String description;

        SYNC_PATTERN(int value, String description) {
            this.value = value;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfDescription(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 Integer descriptionOfValue(String description) {
            Integer tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].description.equals(description)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }
    }

    /**
     * ptl-pcn定时任务状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum PTL_PCN_TASK_STATUS {

        OPEN(1, "开启"),
        CLOSE(2, "关闭");

        private int value;
        private String description;

        PTL_PCN_TASK_STATUS(int value, String description) {
            this.value = value;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    /**
     * ptl-pcn定时任务同步结果状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum PTL_PCN_TASK_SYNC_STATUS {

        SUCCESS(1, "ptl主服务定时任务工作清单同步成功"),
        ERROR(2, "ptl主服务定时任务工作清单同步失败");

        private int value;
        private String description;

        PTL_PCN_TASK_SYNC_STATUS(int value, String description) {
            this.value = value;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    /**
     * 单据主表类型(ASN,PO,MOVE,QC)
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum MASTER_ORDER_TYPE {
        CREATE(10, "NORMAL", "正常");

        private int value;
        private String code;
        private String description;

        MASTER_ORDER_TYPE(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;
        }

        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 String valueOfDescription(int val) {
            return valueOf(val);
        }
    }


    /**
     * 区段任务类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum AREA_SECTION_TASK_TYPE {
        JIT_TASK(10, "JIT_TASK", "JIT任务"),
        DOCUMENT_TASK(20, "DOCUMENT_TASK", "单据任务"),
        SINGLE_POINT_TASK(30, "SINGLE_POINT_TASK", "单点任务");

        private int value;
        private String code;
        private String description;

        AREA_SECTION_TASK_TYPE(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;
        }

        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 String valueOfDescription(int val) {
            return valueOf(val);
        }
    }

    /**
     * 区域任务状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum AREA_TASK_STATUS {
        CREATE(10, "CREATE", "创建"),
        COMPLETE(20, "COMPLETE", "完成"),
        CLOSE(30, "CLOSE", "关闭");

        private int value;
        private String code;
        private String description;

        AREA_TASK_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;
        }

        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 String valueOfDescription(int val) {
            return valueOf(val);
        }
    }

    /**
     * 区域任务类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum AREA_TASK_TYPE {
        JIT_TASK(10, "JIT_TASK", "JIT任务"),
        DOCUMENT_TASK(20, "DOCUMENT_TASK", "单据任务"),
        SINGLE_POINT_TASK(30, "SINGLE_POINT_TASK", "单点任务");

        private int value;
        private String code;
        private String description;

        AREA_TASK_TYPE(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;
        }

        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 String valueOfDescription(int val) {
            return valueOf(val);
        }
    }

    /**
     * 主任务类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum MAIN_TASK_TYPE {
        JIT_TASK(10, "JIT_TASK", "JIT任务"),
        DOCUMENT_TASK(20, "DOCUMENT_TASK", "单据任务"),
        SINGLE_POINT_TASK(30, "SINGLE_POINT_TASK", "单点任务");

        private int value;
        private String code;
        private String description;

        MAIN_TASK_TYPE(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;
        }

        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 String valueOfDescription(int val) {
            return valueOf(val);
        }
    }

    /**
     * redis过期时间
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum EXPIRE_TIME {

        NEVER(-1, "不过期"),
        ONE_HOUR(3600, "一小时"),
        FIVE_MINS(300, "5分钟"),
        HALF_HOUR(1800, "半小时"),
        ONE_QUARTER(900, "一刻钟"),
        ONE_MIN(60, "一分钟");

        private int value;
        private String description;

        EXPIRE_TIME(int value, String description) {
            this.value = value;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfDescription(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 SYNC_FLAG {

        UNSYNC(1, "未同步"),
        SYNCED(2, "已同步");

        private int value;
        private String description;

        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 valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }
}
