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

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * @Description :
 * @Reference :
 * @Author : wei.peng
 * @Date : 2018-10-23 16:10
 * @Modify :
 **/
public class ImppEnumUtil {

    /**
     * 组织类型
     * 1.集团，2.公司，3.工厂
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum ORGANIZE_YTPE {

        TYPE_GROUP(1, "集团", "集团"),
        TYPE_COMPANY(2, "公司", "公司"),
        TYPE_FACTORY(3, "工厂", "工厂");

        private int value;
        private String name;
        private String description;

        ORGANIZE_YTPE() {
        }

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

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }

        public String getDescription() {
            return description;
        }

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

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

    /**
     * 定时任务方法类型
     * 1.Java Class 方法
     * 2.Http URL
     * 3.权限CODE
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum TASK_METHOD_TYPE {
        CLASS_METHOD(1, "类方法", "Java Class 方法");
//        TYPE_COMPANY(2,"链接","Http URL"),
//        TYPE_FACTORY(3,"权限CODE","权限CODE");

        private int value;
        private String name;
        private String description;

        TASK_METHOD_TYPE() {
        }

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

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }

        public String getDescription() {
            return description;
        }

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

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

    /**
     * 日志级别
     * 1.DEBUG：调试程序信息，
     * 2.INFO：程序运行信息，
     * 3.WARN：具有潜在危害的信息，
     * 4.ERROR：错误信息但允许程序继续运行，
     * 5.FATAL：非常严重的错误，可能导致程序中止
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum LOG_LEVEL {

        DEBUG(1, "DEBUG", "调试"),
        INFO(2, "INFO", "信息"),
        WARN(3, "WARN", "注意"),
        ERROR(4, "ERROR", "错误"),
        FATAL(5, "FATAL", "严重");

        private int value;
        private String name;
        private String description;

        LOG_LEVEL() {
        }

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

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }

        public String getDescription() {
            return description;
        }

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

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


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

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

    /**
     * 操作日志类型
     * 1.INSERT：添加，
     * 2.DELETE：删除，
     * 3.UPDATE：修改，
     * 4.SELECT：查询
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum OPERATE_TYPE {

        INSERT(1, "post", "新增"),    //POST
        DELETE(2, "put", "修改"),    //PUT
        UPDATE(3, "delete", "删除"),    //DELETE
        SELECT(4, "get", "查询"),    //GET
        BUSI(5, "busi", "处理");

        private int value;
        private String name;
        private String description;

        OPERATE_TYPE() {
        }

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

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }

        public String getDescription() {
            return description;
        }

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

        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 int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].name.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

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

    /**
     * 操作终端
     * 1.PC：个人计算机
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum OPERATE_TERMINAL {

        PC(1, "电脑端"), PDA(2, "PDA"), MOBILE(3, "手机");

        private int value;
        private String description;

        OPERATE_TERMINAL() {
        }

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

    }

    /**
     * 用户消息状态
     * 1.READ：已读
     * 2.UNREAD：未读
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum MESSAGE_STATUS {

        READ(1, "已读", "fa cell-fa fa-file-text"),
        UNREAD(2, "未读", "fa cell-fa fa-file-o");

        private int value;
        private String name;
        private String description;

        MESSAGE_STATUS() {
        }

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

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }

        public String getDescription() {
            return description;
        }

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

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

    /**
     * 用户消息发送状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum MESSAGE_SEND_STATUS {

        SENDING(1, "发送中"),
        SEND_SUCCESS(2, "发送成功"),
        SEND_FAIL(3, "发送失败");

        private int value;
        private String description;

        MESSAGE_SEND_STATUS() {
        }

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

    }

    /**
     * 用户消息类型
     * 1.NOTICE：通知
     * 2.STATION_LETTER：站内信
     * 3.SWEB_NOTICE：SWEB通知
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum MESSAGE_TYPE {

        MAIL(1, "邮件", "邮件"),
        LETTER(2, "站内信", "站内信"),
        SWEB_NOTICE(3, "SWEB通知", "SWEB通知"),
        SWEB_PUBLIC_NOTICE(4, "SWEB公告", "SWEB公告"),
        WORK_WECHAT_TASK_CARD(5, "企业微信任务卡片", "企业微信任务卡片");

        private int value;
        private String name;
        private String description;

        MESSAGE_TYPE() {
        }

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

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }

        public String getDescription() {
            return description;
        }

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

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

    /**
     * 硬件连接方式
     * 1.SERIAL_PORT：通知
     * 2.NETWORK_PORT：站内信
     * 3.OPC：OPC
     * 4.USB：USB
     * 5.MIDDLE_TABLE：中间表
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum TOOL_CONN_TYPE {

        SERIAL_PORT(1, "串口", "串口"),
        NETWORK_PORT(2, "网口", "网口"),
        OPC(3, "OPC", "OPC"),
        USB(4, "USB", "USB"),
        MIDDLE_TABLE(5, "中间表", "中间表");
        private int value;
        private String name;
        private String description;

        TOOL_CONN_TYPE() {
        }

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

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }

        public String getDescription() {
            return description;
        }

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

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

    /**
     * 硬件数据类型
     * 1.STRING：字符串
     * 2.TABLE：数据表
     * 3.BINARY_PACKET：二进制数据包
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum TOOL_DATA_TYPE {

        STRING(1, "字符串", "字符串"),
        TABLE(2, "数据表", "数据表"),
        BINARY_PACKET(3, "二进制数据包", "二进制数据包");

        private int value;
        private String name;
        private String description;

        TOOL_DATA_TYPE() {
        }

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

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }

        public String getDescription() {
            return description;
        }

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

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

    /**
     * 系统参数类型
     * 1.SYSTEM：系统参数
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum SYS_CONFIG_TYPE {

        SYSTEM(1, "系统参数", "系统参数");

        private int value;
        private String name;
        private String description;

        SYS_CONFIG_TYPE() {
        }

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

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }

        public String getDescription() {
            return description;
        }

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

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

    /**
     * 消息内容类型
     * 1.SYSTEM：系统参数
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum MESSAGE_TYPE_CONTENT {

        HTML(1, "HTML", "text/html;charset=UTF-8"),
        TEXT(2, "TEXT", "text/plain;charset=UTF-8");

        private int value;
        private String name;
        private String description;

        MESSAGE_TYPE_CONTENT() {
        }

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

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }

        public String getDescription() {
            return description;
        }

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

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

    /**
     * 动态表单类型
     * 1. String
     * 2. Number
     * 3. Date
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum DYN_TABLE_CELL_TYPE {

        STRING(1, "String", "字符串类型"),
        NUMBER(2, "Number", "数字类型"),
        DATE(3, "Date", "时间类型");

        private int value;
        private String name;
        private String description;

        DYN_TABLE_CELL_TYPE() {
        }

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

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }

        public String getDescription() {
            return description;
        }

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

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

    /**
     * 系统值类型
     * 1. String
     * 2. Number
     * 3. Date
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum SYS_VALUE_TYPE {

        STRING(1, "text", "文本"),
        NUMBER(2, "number", "数字"),
        DATE(3, "date", "时间"),
        SWITCH(4, "switch", "布尔"),
        SELECT(5, "select", "选择"),
        FILE(6, "select", "选择"),
        ARRAY(7, "array", "数组");

        private int value;
        private String name;
        private String description;

        SYS_VALUE_TYPE() {
        }

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

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }

        public String getDescription() {
            return description;
        }

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

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

    /**
     * 系统值类型
     * 1. String
     * 2. Number
     * 3. Date
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum SYS_CACHE_TYPE {

        REDIS(1, "Redis", "Redis 缓存方式");

        private int value;
        private String name;
        private String description;

        SYS_CACHE_TYPE() {
        }

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

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }

        public String getDescription() {
            return description;
        }

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

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

    /**
     * 导出列关系类型
     */
    public enum COL_REF_TYPE {
        REF_NO(1, "无"),
        REF_ENUM(2, "枚举"),
        REF_OBJECT(3, "对象"),
        REF_DICT(4, "字典");

        private int value;
        private String description;

        private COL_REF_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 int descriptionOfValue(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;
        }
    }

    /**
     * 系统表达式组
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum SYS_CONFIG_GROUP {
        EXCEL(1, "excel导入导出"),
        PASSWORD(2, "密码安全策略"),
        MAIL(3, "邮件配置"),
        CONTACT(4, "联系人"),
        BASIS(5, "基础"),
        CONFIG(6, "系统配置"),
        LOG(7, "日志配置"),
        WORK_WECHAT(8, "企业微信配置");

        private int value;
        private String description;

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        private SYS_CONFIG_GROUP(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 MESSAGE_RECEIVER_TYPE {
        INTERNAL(1, "内部人员"),
        EXTERNAL(2, "外部人员"),
        URGENT(3, "紧急联系人"),
        SUPPLIER(4, "供应商");
        private int value;
        private String description;

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

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

    /**
     * 附件来源
     * 1.NOTICE：通知
     * 2.STATION_LETTER：站内信
     * 3.SWEB_NOTICE：SWEB通知
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum FILE_ATTACH_SOURCE {
        MAIL(1, "邮件", "邮件"),
        LETTER(2, "站内信", "站内信"),
        SWEB_NOTICE(3, "SWEB通知", "SWEB通知"),
        SWEB_PUBLIC_NOTICE(4, "SWEB公告", "SWEB公告");

        private int value;
        private String name;
        private String description;

        FILE_ATTACH_SOURCE() {
        }

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

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }

        public String getDescription() {
            return description;
        }

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

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


    /**
     * 字典分组
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum DICTIONARY_GROUP {
        SYSTEM(1, "系统字典"),
        EXTERNAL(2, "业务字典");
        private int value;
        private String description;

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        private DICTIONARY_GROUP(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 LOG_STORAGE {
//        MONGO(1, "MongoDB"),
        ELASTICSEARCH(2, "Elasticsearch");
        private int value;
        private String description;

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        private LOG_STORAGE(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 static LOG_STORAGE valueOfEnum(int val) {
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }
    }

    /**
     * 密码策略
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum CHECK_TEXT {
        PASSWORD_VERIFY(1, "保存策略"),
        PASSWORD_LOGIN(2, "登录策略");
        private int value;
        private String description;

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        private CHECK_TEXT(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 static CHECK_TEXT valueOfEnum(int val) {
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }
    }

    /**
     * 用户定制化配置类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum USER_CUSTOMIZE_CONFIG_TYPE {
        WEB_TABLE_SHOW_COL(10, "前端表格显示列");

        private int value;
        private String description;

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


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

    /**
     * 用户外部关系
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum USER_EXTERNAL_REF {
        WORK_WECHAT(10, "企业微信");

        private int value;
        private String description;

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


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

    /**
     * 用户绑定属性
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum USER_BIND_PROPERTY{
        USER_LOGIN_NAME("userId", "登录名称"),
        USER_NAME("userName", "用户名称"),
        EMAIL("email", "邮箱"),
        USER_PHONE("phone", "手机号"),
        USER_EMP_NO("empNo", "工号"),
        USER_WECHAT_NO("userWeChatNo", "微信号");

        private String value;
        private String description;

        private USER_BIND_PROPERTY(String value, String description) {
            this.value = value;
            this.description = description;
        }

        public String getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

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

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