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

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.StringUtils;

/**
 * @Description :
 * @Reference :
 * @Author : alwaysfrin
 * @CreateDate : 2018-09-12 14:32
 * @Modify:
 **/
public class CommonEnumUtil {

    /**
     * 软件类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum SOFT_TYPE {
        IMPP(1, "impp-platform", "IMPP平台"),
        CORE(2, "i3core", "i3业务平台"),
        WMS(3, "i3wms", "仓库管理软件"),
        MES(4, "i3mes", "生产管理软件"),
        QMS(5, "i3qms", "质量管理软件"),
        MES_PCN(6, "i3mes-pcn", "生产管理软件-节点中心"),
        SWEB(7, "i3sweb", "供应商服务"),

        FORM(20,"block-form","智能表单"),
        REPORT(21,"block-report","智能报表"),
        WORKFLOW(22,"block-workflow","智能工作流"),
        JOBFLOW(23,"block-jobflow","智能作业流"),
        SOFTSWITCH(24,"block-softswitch","软件适配器"),
        HARDSWITCH(25,"block-hardswitch","硬件适配器"),
        LAC(26,"lac","连接适配器"),
        ANDON(27,"andon","安灯"),
        CENTER(99,"icloud-server","注册中心"),
        SURFACE(98,"i3surface","对外服务"),
        CLOUD(97,"i3cloud","微服务"),
        GATEWAY(96,"impp-gateway","服务网关"),
        CONSOLE(95,"impp-console","服务监控台");

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

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

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

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

    /**
     * 处理标识
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum TRUE_OR_FALSE {
        TRUE(1, "是"), FALSE(2, "否");

        private int value;
        private String description;

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

        public int getValue() {
            return value;
        }

        public String getValueStr() {
            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 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 int descOf(boolean desc) {
            return desc ? TRUE_OR_FALSE.TRUE.getValue() : TRUE_OR_FALSE.FALSE.getValue();
        }

        public static int descOf(int desc) {
            return desc == 0 ? TRUE_OR_FALSE.TRUE.getValue() : TRUE_OR_FALSE.FALSE.getValue();
        }

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

        public static boolean valueOfBoolean(int val) {
            if(val == TRUE.value){
                return true;
            }else {
                return false;
            }
        }

    }

    /**
     * 处理标识
     */
    public enum IS_DEAL {
        YES(1, "已处理"), NO(2, "未处理");

        private int value;
        private String description;

        private IS_DEAL(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 SYS_LOCALE_RESOURCE_TYPE {
        COMMON(1, "通用"),
        EXCEPTION(2, "异常"),
        EXCEPTION_DETAIL(3, "异常明细"),
        EXCEPTION_SOLUTION(4, "解决方案"),
        ENUM(5, "枚举"),
        MODULE(10, "模块"),
        METHOD(11, "功能"),
        BUTTON(12, "按钮"),
        WEB(13, "前端");

        private int value;
        private String description;

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

    /**
     * 用户类型
     * user 通过权限设置分配权限
     * admin 包含所有模块及功能权限
     * sa 包含admin权限，以及后台管理权限
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum USER_TYPE {
        USER(1, "user", "普通用户"),
        ADMIN(2, "admin", "系统管理员"),
        SA(3, "sa", "超级管理员");

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

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

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public String getCode() {
            return code;
        }

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

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

    /**
     * 用户状态
     * 1正常
     * 2冻结
     * 3账号异常
     * 4离职
     * 5服务到期
     * 6锁定
     * 7启用
     * 8禁止
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum USER_STATUS {
//        EMPTY(1, "fa fa-success cell-fa fa-check", "正常"),
//        FREEZE(2, "冻结", "冻结_FREEZE"),
//        ABERRANT(3, "异常", "异常_ABERRANT"),
//        RESIGNATION(4, "离职", "离职_RESIGNATION"),
//        EXPIRE(5, "服务到期", "服务到期_EXPIRE"),
        LOCKING(3, "fa cell-fa fa-lock", "锁定"),
        ENABLE(1, "fa fa-success cell-fa fa-check", "启用"),
        DISABLE(2, "fa fa-disabled cell-fa fa-times-circle", "禁用");

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

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

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public String getCode() {
            return code;
        }

        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;
        }
    }
    /**
     * 数据类型
     * 1库存移动数据
     * 2质检数据
     * 3已配料待出库
     * 4JIS发运扣减
     * 5报工待汇总
     * 6报工汇总待处理
     * 7erp接口待同步
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum NUM_TYPE {
        MOVE_DETAILS(1, "MOVE_DETAILS", "库存移动数据"),
        QC_DETAILS(2, "QC_DETAILS", "质检数据"),
        DOC_MOVEMENT(3, "DOC_MOVEMENT", "已配料待出库"),
        DOC_SHIPPING(4, "DOC_SHIPPING", "JIS发运扣减"),
        FG_DETAILS(5, "FG_DETAILS", "报工待汇总"),
        FG_SUM(6, "FG_SUM", "报工汇总待处理"),
        ERP_INTERFACE(7, "ERP_INTERFACE", "ERP接口待同步");
        private int value;
        private String code;
        private String description;

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

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public String getCode() {
            return code;
        }

        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;
        }
    }
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum USER_INFO_STATUS {
        INCUMBENT(1, "正常", "正常_NORMAL"),
        RESIGNATION(2, "离职", "离职_RESIGNATION");

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

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

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public String getCode() {
            return code;
        }

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

    /**
     * 数据状态
     *  1 启用
     *  2 禁用
     *  3 锁定
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum DATA_STATUS {
        ENABLE(1, "启用", "fa fa-success cell-fa fa-check"),
        DISABLE(2, "禁用", "fa fa-disabled cell-fa fa-times-circle"),
        LOCKING(3, "锁定", "fa cell-fa fa-lock");

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

        DATA_STATUS() {
        }

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

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public String getName() {
            return name;
        }

        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].getName();
                }
            }
            return tmp;
        }

        public static int descOf(String desc) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].name.equals(desc)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }
    }

    /**
     * 功能级别
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum METHOD_LEVEL {
        PLUGIN(1, "插件"),
        MODULE(2, "顶级目录"),
        METHOD(3, "二级目录"),
        BUTTON(4, "按钮");

        private int value;
        private String description;

        private METHOD_LEVEL(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 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;
        }
    }

    /**
     * 是否有效
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum IS_VAILD {
        VAILD(1, "有效"), INVAILD(2, "无效");

        private int value;
        private String description;

        public int getValue() {
            return value;
        }

        public String getValueStr() {
            return value + "";
        }

        public String getDescription() {
            return description;
        }

        private IS_VAILD(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 enum ASC_OR_DESC {
        ASC(1, "正序"), DESC(2, "倒序");

        private int value;
        private String description;

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        private ASC_OR_DESC(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 enum PARENT{

        DEFAULT(-1L,"根节点");

        private Long value = -1L;
        private String description = null;

        public Long getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        private PARENT(Long 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 USER_ESX {
        MALE(1, "男"),
        FEMALE(2, "女");

        private int value;
        private String description;

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        private USER_ESX(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 CLOUD_APP_STATUS {
        UP(1,"UP" ,"在线"),
        DOWN(2, "DOWN","断线");

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

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

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

    /**
     * 客户端登录标识
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum LOG_LOGIN_PLATFORM {
        PC_IMPP_CORE(10, "PC-IMPP", "PC后台管理端"),
        PC_WMS_SWEB(20, "PC-SWEB", "PC SWEB后台管理端"),
        Mobile_PDA(30, "Mobile-PDA", "移动设备PDA操作端");

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

        LOG_LOGIN_PLATFORM() {
        }

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

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public String getName() {
            return name;
        }

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

        /**
         * -1 未识别操作系统
         * @param desc
         * @return
         */
        public static int descOf(String desc) {
            int tmp = -1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].name.equals(desc)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }
    }

    /**
     * 用户登录状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum USER_LOGIN_STATUS {
        LOGIN_SUCCESS(1, "登录成功", "登录成功"),
        WRONG_PASSWORD(3, "密码错误", "Linux 密码错误"),
        WRONG_USERNAME_OR_PASSWORD(2, "用户名或密码错误", "用户名或密码错误"),
        USER_LOGIN_LOCKING(4, "账号已锁定", "账号已锁定"),
        USER_INFO_NULL(5, "用户信息不存在", "用户信息不存在"),
        SYSTEM_ERROR(6, "系统异常", "系统异常");

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

        USER_LOGIN_STATUS() {
        }

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

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public String getName() {
            return name;
        }

        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].getName();
                }
            }
            return tmp;
        }

        public static int descOf(String desc) {
            int tmp = -1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].name.equals(desc)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }
    }

    /**
     * Content-Type
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum CONTENT_TYPE {
        FORM("x-www-form-urlencoded", "表单"),
        FILE("multipart/form-data", "文件"),
        JSON("application/json", "JSON"),
        NONE("default", "默认不需要设置Content-Type"),
        XML("application/xml", "XML");

        private String value;
        private String description;

        public String getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        private CONTENT_TYPE(String value, String description) {
            this.value = value;
            this.description = description;
        }
        public static CONTENT_TYPE valueOfContenType(String val) {
            CONTENT_TYPE tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (StringUtils.equalsIgnoreCase(values()[i].value, val)) {
                    tmp = values()[i];
                }
            }
            return tmp;
        }

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

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

    /**
     * HTTP 请求方式
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum HTTP_METHOD_TYPE {
        GET(1,"GET" ,"GET"),
        POST(2, "POST","POST"),
        DELETE(3, "DELETE","DELETE"),
        PUT(4, "PUT","PUT");

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

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

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

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

    /**
     * 变量类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum  BASIS_TYPE {
        INT(1, "int"),
        DOUBLE(2, "double"),
        LONG(3, "long"),
        FLOAT(4, "float"),
        CHAR(5, "char"),
        BOOLEAN(6,"boolean"),
        BYTE(7, "byte"),
        SHORT(8, "short");

        private int value;
        private String description;

        private BASIS_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 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 final int VALID = CommonEnumUtil.IS_VAILD.VAILD.getValue();
    // 数据未删除的静态常量
    public static final int FALSE = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();

}
