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

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

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Description :
 * @Reference :
 * @Author : alwaysfrin
 * @CreateDate : 2018-10-23 15:53
 * @Modify:
 **/
public class WmsEnumUtil {


    /**
     * 流程提交校验
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum GROUP_COMMIT_CHECK {
        DISABLE(1, "禁止提交"), CHECK_MOVE(2, "校验移动单"),
         NO_CHECK(3, "不校验"),CHECK_OLD_MOVE_NO(4, "校验是否已产生移动单");

        private int value;
        private String description;

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

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public static GROUP_COMMIT_CHECK codeOf(int value) {
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == value) {
                    return values()[i];
                }
            }
            return null;
        }
    }

    /**
     * 订单明细信息 是否免费
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum IS_FREE {
        CHARGING(1, "计费"), GRATIS(2, "免费");

        private int value;
        private String description;

        IS_FREE(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 PRIORITY {
        NORMAL(1, "正常"), URGENT(2, "紧急");
        private int value;
        private String description;

        PRIORITY(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 ORDER_TYPE {
        REG(10, "REG", "原物料采购"),
        SUB(20, "SUB", "委外采购"),
        TAR(30, "TAR", "多角贸易采购"),
        TAP(40, "TAP", "多角代采购"),
        AMP(50, "AMP", "AMP收货");

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

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


    /**
     * 单据主表状态(ASN,PO,MOVE,QC)
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum MASTER_ORDER_STATUS {
        CREATE(10, "CREATE", "新建"),
        RECEIPT(20, "RECEIPT", "处理中"),
        RECEIPT_FINISH(30, "RECEIPT_FINISH", "已完成"),
        CLOSED(40, "CLOSED", "已关闭"),
        CANCELLED(50, "CANCELLED", "已取消");

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

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

    /**
     * 订单明细状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum ORDER_DETAILS_STATUS {
        CREATE(10, "CREATE", "创建"),
        RECEIPTED(20, "FINISHED", "已完成"),
        CANCEL(30, "CANCLE", "行取消"),
        PRINTED(40, "PRINTED", "已打印");

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

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

    }

    /**
     * PO条码状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum PO_SN_STATUS {
        CREATE(10, "N", "创建"),
        RECEIPTED(20, "R", "已完成"),
        CANCEL(30, "C", "行取消"),
        PRINTED(40, "C", "已打印");

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

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

    /**
     * 产品入库，发运状态
     * WMS_产品报工明细信息 ：单据状态
     * WMS_发泡打箱包装
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum PRODUCT_INSTOCK_STATUS {
        CREATE(10, "创建"), FINISH(20, "已处理"), FAIL(30, "处理出错");

        private int value;
        private String description;

        PRODUCT_INSTOCK_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 PRINT_STATUS {
        PRINTED(1, "已打印"), NOPRINT(2, "未打印"), GENERATE(3, "退料生成条码");

        private int value;
        private String description;

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

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

    /**
     * 库位类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum LOCATE_TYPE {
        COLLECT_LOCATE(10, "I", "收货库"),
        BASICS_LOCATE(20, "P", "基础库"),
        MANEUVER_LOCATE(30, "R", "机动库"),
        COMBINATION_LOCATE(40, "D", "组合库"),
        LINE_LOCATE(50, "L", "线边库"),
        NC_LOCATE(60, "N", "NC库"),
        SPILLAGE_LOCATE(70, "Y", "溢料库"),
        TRANSIT_LOCATE(80, "T", "在途库");

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

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

        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 LOCATE_STATUS {
        EMPTY(10, "空库位"), NOT_EMPTY(20, "非空"), FULL(30, "已满");

        private int value;
        private String description;

        LOCATE_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 OUT_MOVEMENT_MOVE_TYPE {
        IN_STORE(10, "IN", "入库"),
        OUT_STORE(20, "OUT", "出库"),
        MOVE_STORE(30, "MOVE", "移库"),
        OTHER(40, "OTHER", "其他");

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

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

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

    /**
     * 移库单业务类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum OUT_MOVEMENT_BUSI_TYPE {
        PRODUCTION_MATERIAS(10, "PROD_MATERIALS", "生产领料"),
        CUSTOMER_SHPING(20, "CUS_SHPING", "客户发运"),
        OUTWARD_SHIPMENT(30, "OUT_SHIPMENT", "委外发运"),
        ALLOCATION(40, "ALLOCATION", "调拨"),
        SCATTERED_OUT(50, "SCATTERED_OUT", "零星出库"),
        SCATTERED_IN(60, "SCATTERED_IN", "零星入库"),
        NC_WAREHOSING_IN(70, "NC_WAREHOSING", "NC入库"),
        SUPPLIER_RETURN(80, "SUPPLIER_RETURN", "供应商退货"),//默认DMR
        CUSTOMER_RETURN(90, "CUSTOMER_RETURN", "客户退货"),
        PRODUCT_RETURN(100, "PRODUCT_RETURN", "生产退料"),
        INSTRUCTION_MOVE(110, "INSTRUCTION_MOVE", "指令移库"),
        SCRAPPING_OUT(120, "SCRAPPING_OUT", "报废出库"),
        RECEIVING_IN(130, "RECEIVING_IN", "收货入库"),
        OUTSOURCING_BACK(140, "OUTSOURCING_BACK", "委外退回"),
        NC_WAREHOSING_OUT(150, "NC_WAREHOSING_OUT", "NC出库"),
        SUPPLIER_RETURN_SMRR(190, "SUPPLIER_RETURN_SMRR", "供应商退货(SMRR)"),
        NC_DISMANTLING_PICKING(160, "NC_DISMANTLING_PICKING", "NC拆解领料"),
        NC_DISMANTLING_RETREAT(170, "NC_DISMANTLING_RETREAT", "NC拆解退料"),
        LINE_EDGE_SCRAPPING_OUT(180, "LINE_EDGE_SCRAPPING_OUT", "线边报废出库"),
        ASN(200, "ASN", "ASN"),
        PO(210, "PO", "PO"),
        QC(220, "QC", "QC"),
        AMPR(230, "AMPR", "AMPR"),
        FINISHGOODS(240, "FINISHGOODS", "VDA生产快速入库"),
        VDA_REPORT(250, "VDA_REPORT", "VDA生产报工"),
        VDA_PR_INSTOCK(260, "VDA_PR_INSTOCK", "VDA生产推荐入库"),
        VDA_PICKING_GOODS(270, "VDA_PICKING_GOODS", "VDA生产领料"),
        VDA_ONE_PICKING_GOODS(280, "VDA_ONE_PICKING_GOODS", "VDA单箱领料");


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

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

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


    /**
     * 物料：分类（ABC）
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum PART_ABC {
        A(1, "A"),
        B(2, "B"),
        C(3, "C"),
        D(4, "D"),
        E(5, "E");

        private int value;
        private String description;

        PART_ABC(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 LINK_ORDER_TYPE {
        ASN("ASN", "ASN"),
        PO("PO", "PO"),
        SO("SO", "SO"),
        MOVE("MOVE", "移库单"),
        IN_STOCK("IN_STOCK", "入库单"),
        SHIPPING("SHIPPING", "发运单"),
        QC("QC", "质检"),
        CS("CS", "盘点"),
        DR("DR", "直送收货"),
        AMPR("AMPR", "AMP拉动收货");

        private String value;
        private String description;

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

        public String getDescription() {
            return description;
        }

        public String getCode() {
            return value;
        }

        public String getValue() {
            return value;
        }

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

        public static String getDes(String 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 OP_TYPE_CODE {
        RC("RC", "收货"),
        QC("QC", "质检"),
        PICK("PICK", "拣货"),
        OUTSTOCK("OUTSTOCK", "出库"),
        INSTOCK("INSTOCK", "入库"),
        MOVESTOCK("MOVESTOCK", "移库"),
        CS("CS", "盘点"),
        VDARC("VDARC", "VDA收货"),
        VDAINSTOCK("VDAINSTOCK", "VDA入库"),
        VDAMOVESTOCK("VDAMOVESTOCK", "VDA内部移库"),
        VDA_FAST_STOCK("VDA_FAST_STOCK", "VDA采购快速入库"),
        VDAREPORT("VDAREPORT", "VDA生产报工"),
        VDA_FINISH_GOODS("VDA_FINISH_GOODS", "VDA生产快速入库"),
        VDA_PICKING_GOODS("VDA_PICKING_GOODS", "VDA生产领料"),
        VDA_NC_FREEZE("VDA_NC_FREEZE", "VDA_NC冻结"),
        VDA_ONE_PICKING_GOODS("VDA_ONE_PICKING_GOODS", "VDA单箱领料"),
        VDA_NC_UN_FREEZE("VDA_NC_UN_FREEZE", "VDA_NC解冻");

        private String value;
        private String description;

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

        public String getCode() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public String getValue() {
            return value;
        }
    }

    /**
     * 作业组件参数：组件执行方法名称
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum MODULE_METHOD_NAME {
        EXECUTE("execute", "执行方法"),
        GETOPTIONS("getOptions", "流程初始化方法"),
        PROMPT("prompt", "初始化方法"),
        GETLIST("getList", "获取列表数据"),
        DOCOMPLETE("doComplete", "执行完成方法"),
        SHOWINFORMATION("showInformation", "回显方法"),
        INSTALL("install", "安装组件"),
        UNINSTALL("unInstall", "卸载组件");
        private String value;
        private String description;

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

        public String getCode() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public String getValue() {
            return value;
        }

        public static MODULE_METHOD_NAME codeOf(String value) {
            if (value == null) {
                return null;
            } else {
                for (int i = 0; i < values().length; i++) {
                    if (StringUtils.equalsIgnoreCase(values()[i].value,value)) {
                        return values()[i];
                    }
                }
            }
            return null;
        }
    }


    /**
     * 作业任务状态、移库单条码操作状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum TASK_INFO_STATUS {
        CREATE(10, "创建"), FINISH(20, "处理中"), FAIL(30, "已处理");

        private int value;
        private String description;

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

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

    /**
     * 单据是否生成任务状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum IS_GENERAL_TASK {
        CREATE(10, "CREATE", "创建"),
        INIT(20, "INIT", "初始化"),
        IS_GENERAL(30, "IS_GENERAL", "已生成"),
        NO_GENERAL(40, "NO_GENERAL", "不生成"),
        CANCEL(50,"CANCEL","撤销");

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

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

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


    /**
     * 业务表：库存条码状态
     * 1=创建，10=质检中，20=待入库，30=入库，40=配料，50=出库，60=报废，70=在途
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum STOCK_SN_STATUS {
        CREATE(10, "创建"),
        QUALITY_CONTROL(20, "质检中"),
        PRE_INSTOCK(30, "待入库"),
        INSTOCKED(40, "入库"),
        PICKED(50, "配料"),
        OUT_STOCK(60, "出库"),
        COMMING(80, "在途");

        private int value;
        private String description;

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

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

        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 STOCK_SN_QC_STATUS {
        NORMAL(10, "EMPTY", "合格"), ABNORMAL(20, "ABNORMAL", "不合格"), ISOLATED(30, "ISOLATED", "隔离"), FRAZE(40, "ISOLATED", "报废");

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

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

        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 STOCK_SN_QC_STATUS codeOf(Integer value) {
            if (value == null) {
                return null;
            } else {
                for (int i = 0; i < values().length; i++) {
                    if (values()[i].value == value) {
                        return values()[i];
                    }
                }
            }
            return null;
        }
    }

    /**
     * 盘点主表 单据类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum CS_ORDER_TYPE {
        DAY_INVENTORY(10, "日常盘点"),
        MONTH_INVENTORY(20, "月度盘点"),
        SEASON_INVENTORY(30, "季度盘点"),
        YEAR_INVENTORY(40, "年度盘点"),
    	AJUST_INVENTORY(50, "库存调整盘点");
        private int value;
        private String description;

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

    /**
     * 盘点主表 盘点状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum CS_ORDER_STATUS {
        CREATE(10, "CREATE", "创建"),
        STARTING_INVENTORY(20, "STARTING_INVENTORY", "开启盘点"),
        IN_INVENTORY(30, "IN_INVENTORY", "盘点中"),
        INVENTORY_FINISH(40, "INVENTORY_FINISH", "盘点完成"),
        THAWING(50, "THAWING", "已解冻"),
        CLOSED(60, "CLOSED", "已关闭");

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

        CS_ORDER_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 CS_TRANS_STATUS {
        CREATE(10, "已创建"),
        INVENTORY(20, "已盘"),
        FROZEN(30, "已冻结"),
        THAWING(40, "已解冻"),
        RETURN_GOODS(50, "取消冻结");

        private int value;
        private String description;

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

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

    /**
     * 盘点实盘 处理状态;质检操作明细状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum CS_ITEM_STATUS {
        CREATE(10, "创建"), FINISH(20, "已处理");

        private int value;
        private String description;

        CS_ITEM_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 MOVE_ORDER_STATUS {
        CREATE(10, "创建"),
        BE_HANDLE(20, "待处理"),
        FINISH(30, "已处理"),
        HANDLE_ERROR(40, "处理出错");

        private int value;
        private String description;

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

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

    /**
     * 库存移动单明细状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum MOVE_ORDER_DETAILS_STATUS {
        CREATE(10, "创建"),
        BE_HANDLE(20, "待处理"),
        FINISH(30, "已处理");

        private int value;
        private String description;

        MOVE_ORDER_DETAILS_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 QC_INFO_TYPE {
        FEED(10, "进料检验"),
        ONLINE(20, "在线检验"),
        EMDPRODUCT(30, "成品检验"),
        SHIPMENTS(40, "出货检验");

        private int value;
        private String description;

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

    /**
     * 质检业务状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum QC_INFO_STATUS {
        CREATE(10, "新建"),
        FINISH(20, "处理中"),
        FAIL(30, "已完成"),
        CLOSE(40, "已关闭"),
        CANCEL(50, "已取消");

        private int value;
        private String description;

        QC_INFO_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 QC_ITEM_STATUS {
        NORMAL(10, "正常"),
        CANCELLATION(20, "已处理");

        private int value;
        private String description;

        QC_ITEM_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 ALD_EXECUTE_STATUS {
        CREATE(10, "创建"),
        PROCESSING(20, "处理中"),
        COMPLETED(30, "已完成");
        private int value;
        private String description;

        ALD_EXECUTE_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 ACTION_GROUP_DETAILS_VALUE_TYPE {
        ONETIMEONLY(10, "只输入一次"),
        MANYTIME(20, "输入多次"),
        MAYTIMEUNIQUE(30, "输入多次不允许重复"),
        ACTIONFINISH(40, "本流程结束");

        private int value;
        private String description;

        ACTION_GROUP_DETAILS_VALUE_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 ACTION_MOUDULE_PARAM_TYPE {
        CHECKLIST(1, "可选列表"),
        NUMBER(10, "数字"),
        STRING(20, "字符串"),
        CONFIGURABLE_STR(25, "可配字符串"),
        OUT_OR_UNNECESSARY(30, "出参或者不必需的参数");

        private int value;
        private String description;

        ACTION_MOUDULE_PARAM_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 RC_ORDER_TYPE {
        PO(10, "PO"),
        ASN(20, "ASN");

        private int value;
        private String description;

        RC_ORDER_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 PRINT_ORDER_TYPE {
        PO(10, "PO"),
        ASN(20, "ASN"),
        MOVEMENT(30, "MOVEMENT");

        private int value;
        private String description;

        PRINT_ORDER_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 RC_RESPONSE_TIPS {

        OK(1, true, "正确"),
        NG(2, false, "失败");

        private int value;
        private boolean codeStatus;
        private String description;

        RC_RESPONSE_TIPS(int value, boolean codeStatus, String description) {
            this.value = value;
            this.codeStatus = codeStatus;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public boolean getCodeStatus() {
            return codeStatus;
        }

        public String getDescription() {
            return description;
        }

    }

    /**
     * 流程管家中触发源
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum ACTION_BUTLER_SOURCE {

        SCANNER(10, "扫描枪"),
        SUBMIT(20, "提交按钮"),
        RESET(30, "重置按钮"),
        CHECK_DETAILS(40, "查看明细"),
        DELETE_DETAILS(50, "明细(删除)"),
        CLEAR_DETAILS(60, "明细（清空）"),
        CUSTOM_BUTTON(70, "自定义按钮");

        private int value;
        private String description;

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

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public static ACTION_BUTLER_SOURCE valueOf(Integer 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 AM_TYPE {

        PROCESS_HANDLING(10, "流程处理组件"),
        PROCESS_INITIALIZATION(20, "流程初始化组件"),
        PROCESS_COMMIT(30, "流程提交组件"),
        DETAIL_PROCESS(40, "明细处理组件"),
        BACK_DISPLAY(50, "回显方法"),
        PROCESS_END(60, "流程结束组件");

        private int value;
        private String description;

        AM_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 AM_TYPE switchGetValue(int val) {
            int tmp = 1;
            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 SN_TYPE {
        ONE_DIMENSIONAL_CODE(10, "1D"),
        QR_CODE(20, "2D"),
        ALL(30, "ALL");

        private int value;
        private String description;

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

    /**
     * 流程明细动作类型
     * 10=交互动作,20=后台动作,30=提交动作
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum AGD_VALUE_TYPE {
        INTERACTIVE_ACTION(10, "交互动作"),
        BACKSTAGE_ACTION(20, "后台动作"),
        SUBMIT_ACTION(30, "提交动作"),
        SELECT_ACTION(40, "选择动作");

        private int value;
        private String description;

        AGD_VALUE_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 RC_OK_VALUE {

        IS_TRUE(10, true, "成功"),
        IS_FALSE(20, false, "失败");

        private int value;
        private boolean codeValue;
        private String description;

        RC_OK_VALUE(int value, boolean codeValue, String description) {
            this.value = value;
            this.codeValue = codeValue;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public boolean getCodeValue() {
            return codeValue;
        }

        public String getDescription() {
            return description;
        }
    }

    /**
     * 通用序号编码枚举
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum COMMON_SEQ {
        TASK_MV_ORDERNO("TASK_MV_ORDERNO", "作业任务移动单号"),
        ROUTING_SEQ("ROUTING_SEQ", "物料路线序号"),
        LOCATE_SEQ("LOCATE_SEQ", "库位序号"),
        OP_SEQ("OP_SEQ", "作业类型序号"),
        TRAN_SEQ("TRAN_SEQ", "交易类型序号"),
        STEP_SEQ("STEP_SEQ", "步骤调用序号"),
        MOVE_ORDER_NO("MOVE_ORDER_NO", "移库单单号"),
        QC_ORDER_NO("QC_ORDER_NO", "质检单单号"),
        CHECK_ORDER_NO("CHECK_ORDER_NO", "盘点主表序号"),
        INITIALIZE_SN("INITIALIZE_SN", "库存初始化");

        private String code;
        private String description;
        int value;

        COMMON_SEQ(String code, String description) {
            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 COMMON_SN {
        PO_SN("PO_SN", "PO条码"),
        VDA_SN("VDA_SN", "VDA条码");

        private String code;
        private String description;
        int value;

        COMMON_SN(String code, String description) {
            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 OPTION_TYPE {
        OPTIONS(10, "OPTIONS", "可选项"),
        BUTTON(20, "BUTTON", "按钮");

        private String code;
        private String description;
        int value;

        OPTION_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 DATA_OBJ_TYPE {
        WAREHOUSE(10, "WAREHOUSE", "仓库对象"),
        ZONE(20, "ZONE", "存储区对象"),
        LOCATE(30, "LOCATE", "库位对象"),
        MATERIAL(40, "MATERIAL", "物料对象"),
        TRANS_TYPE(50, "TRANS_TYPE", "交易代码对象"),
        BUSI_TYPE(60, "BUSI_TYPE", "业务类型对象");

        private String code;
        private String description;
        int value;

        DATA_OBJ_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 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 String getDescription() {
            return description;
        }

        public static DATA_OBJ_TYPE codeOf(Integer 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 DATA_OBJ_OP_TYPE {
        ADD(10, "ADD", "新增"),
        DEL(20, "DEL", "删除"),
        UPD(30, "UPD", "修改"),
        QUERY(40, "QUERY", "查询");

        private String code;
        private String description;
        int value;

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

    /**
     * 库存交易记录生成标记
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum TRANS_QUAN_GENERAL_TAG {
        SRC(-1, "SRC", "一条：负"), ZERO(0, "ZERO", "一条：0"), DEST(1, "DEST", "一条：正"), TWO(2, "TWO", "两条：一正一负");

        private String code;
        private String description;
        int value;

        TRANS_QUAN_GENERAL_TAG(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 TRANS_QUAN_GENERAL_TAG codeOf(String code) {
            int tmp = 1;
            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 DATA_STATUS {
        YES(1, "TRUE", "fa fa-success cell-fa fa-check"),
        NO(2, "FALSE", "fa fa-disabled cell-fa fa-times-circle");

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

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

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

        //取反
        public static int getInvertValue(int val) {
            return val == 1 ? 2 : 1;
        }
    }

    /**
     * 打印模板
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum PRINT_TEMPLATE {
        SN_PRINT_TEMPLATE(10, "SN_PRINT_TEMPLATE", "条码打印模板"),
        ORDER_PRINT_TEMPLATE(20, "ORDER_PRINT_TEMPLATE", "订单打印模板"),
        RC_BACK_PRINT_TEMPLATE(30, "RC_BACK_PRINT_TEMPLATE", "收货回执打印模板");

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

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

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

    /**
     * 版本号
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum VERSION {
        PO_VERSION(10, "VERSION", "PO版本号");

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

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

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

    /**
     * 包装类型枚举
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum PACKAGE_TYPE {
        BOX(10, "BOX", "BOX（盒）"),
        CARTON(20, "CARTON", "CARTON（箱）"),
        PALLET(30, "PALLET", "PALLET（栈板）"),
        CONTAINER(40, "PALLET", "PALLET（集装箱）");

        private String code;
        private String description;
        int value;

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

    /**
     * NC处理 操作类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum NC_HANDLE_BUSI_TYPE {
        RECEPTION(10, "RECEPTION", "让步接收"),
        SCRAP(20, "SCRAP", "报废"),
        QUARANTINE(30, "QUARANTINE", "隔离"),
        BACK_QUARANTINE(40, "BACK_QUARANTINE", "反隔离"),
        DEFINITE_FAIL(50, "DEFINITE_FAIL", "不合格");

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

        NC_HANDLE_BUSI_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 CS_IS_ADJUST {
        IS_ADJUST(1, "是调差"), ADJUST(2, "否调差");

        private int value;
        private String description;

        CS_IS_ADJUST(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 IS_PART {
        IS_ADJUST(1, "散件"), ADJUST(2, "非散件");

        private int value;
        private String description;

        IS_PART(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 IS_CHECK_SN {
        IS_APPOINT_SN(1, "指定条码"), APPOINT_SN(2, "不指定条码");

        private int value;
        private String description;

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

    /**
     * 脚本类型
     * 10=组件脚本，20=表单脚本，30=报表脚本，40=JOB脚本，50=其他脚本
     */
    public enum SCRIPT_TYPE {
        MODUAL(10, "Modual", "组件脚本"),
        FORM(20, "Form", "表单脚本"),
        REPORT(30, "Report", "报表脚本"),
        JOB(40, "Job", "JOB脚本"),
        OTHER(50, "Other", "其他脚本");

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

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

        public String getCode() {
            return this.code;
        }

        public int getIndex() {
            return this.value;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }
    }

    /**
     * 脚本语言类型
     * 10=Groovy, 20=Jython, 30=JavaScript, 40=Scala, 50=JRuby
     */
    public enum LANGUAGE_TYPE {
        GROOVY(1, "Groovy", 10),
        PYTHON(2, "jython", 20), // "jython" string can not change
        JS(3, "JavaScript", 30);
        // 下面这2种语言没人会写，暂不支持
        //SCALA(40,"scala"),
        //JRUBY(50,"jruby");

        private int index;
        private String description;
        private int value;

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

        public String getDescription() {
            return description;
        }

        public int getIndex() {
            return this.index;
        }

        public int getValue() {
            return value;
        }

        // 根据枚举编号获取语言代码
        public static String getCodeByIndex(Integer index) {
            for (LANGUAGE_TYPE languageType : LANGUAGE_TYPE.values()) {
                if (languageType.getValue() == index.intValue()) {
                    return languageType.getDescription();
                }
            }

            return null;
        }
    }

    /**
     * 系统参数类型
     * 1.SYSTEM：系统参数
     * 2.BUSI：业务参数
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum WMS_CONFIG_TYPE {

        SYSTEM(10, "系统参数", "系统参数"),
        BUSI(20, "业务参数", "业务参数");

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

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

    /**
     * 系统配置值类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum WMS_CONFIG_VALUE_TYPE {
        CHECKLIST(10, "可选列表"),
        NUMBER(20, "数字"),
        STRING(30, "字符串");

        private int value;
        private String description;

        WMS_CONFIG_VALUE_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 IS_SN_CONTROL {
        SN_CONTROL(1, "条码管控"), NOT_SN_CONTROL(2, "非条码管控");

        private int value;
        private String description;

        IS_SN_CONTROL(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 STEP {
        ONE_STEP(1, "一步法"), TWO_STEP(2, "两步法");

        private int value;
        private String description;

        STEP(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 IMPORT_ORDER_TYPE {
        PO("PO", "要货计划"),
        ASN("ASN", "ASN"),
        INSTRUCTIONS("INSTRUCTIONS", "指令"),
        SCATTERED_OUT("C00", "零星出库指令"),
        SCATTERED_INT("C01", "零星入指令"),
        NC_DISMANTLING_PICKING("C02", "NC拆解领料"),
        NC_DISMANTLING_RETURN("C03", "NC拆解退料"),
        NC_SCRAPPED("C04", "NC报废指令"),
        NOT_JIS("NOTJIS", "非JIS指令"),
        STOCK_DUMP("D00", "库存转储指令"),
        NC_INSTOCK("D01", "NC入库指令"),
        SMRR("B00", "SMRR退货"),
        DMR("B01", "DMR退货"),
        OUT_SOURCING("A00", "委外发料指令"),
        OUT_REBACK("A01", "委外退料指令"),
        OUT_RETURN_SOURCING("A02", "委外返工发料指令"),
        OUT_RETURN_("A03", "委外返工退料指令"),
        SALES_RETURN_REBACK("SALES_RETURN", "销售退货指令"),
        CS("CS", "盘点指令"),
        CS_ADUJUST("CS_ADUJUST", "盘点调差指令");
        private String value;
        private String description;

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

        public String getDescription() {
            return description;
        }

        public String getCode() {
            return value;
        }

        public String getValue() {
            return value;
        }

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

        public static String getDes(String 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 WMS_PART_TYPE {
        RAW_MATERIAL(10, "原材料"), PARTIALLY_PREPARED_PRODUCTS(20, "半成品"), FINISHED_PRODUCT(30, "成品");

        private int value;
        private String description;

        WMS_PART_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 TRUE_OR_FALSE {
        TRUE(1, "是"), FALSE(2, "否");

        private int value;
        private String description;

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


    /**
     * 库存交易表状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum WMS_TRANS_QUAN_STATUS {
        CREATE(1, "创建"), SUCCESS(10, "处理成功"), FAIL(30, "处理失败");

        private int value;
        private String description;

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

    /**
     * PO ASN 收货状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum PO_RECEIVE_STATUS {
        WAITING_RECEIVE_TIME_EARLY("R0001", "待收货"),
        RECEIVEING_TIME_EARLY("R0002", "提前收货中"),
        RECEIVED_IIME_EARLY("R0003", "提前收货完成"),
        WAITING_RECEIVE_TIME_IN("R0004", "待收货"),
        RECEIVEING_TIME_IN("R0005", "正常收货中"),
        RECEIVED_TIME_IN("R0006", "正常收货完成"),
        WAITING_RECEIVE_TIME_LATE("R0007", "延迟未收货"),
        RECEIVEING_TIME_LATE("R0008", "延迟收货中"),
        RECEIVED_TIME_LATE("R0009", "延迟收货完成"),
        STATUS_NEED_TO_CHECK("R0010", "待查询");

        private String value;
        private String description;

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

        public String getDescription() {
            return description;
        }

        public String getCode() {
            return value;
        }

        public String getValue() {
            return value;
        }

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

        public static String getDes(String 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 STOCK_LEVEL_STATUS {
        LOW("LOW", "低于最低库存"),
        HIGH("HIGH", "高于最高库存"),
        NORMAL("CREATE", "安全库存");

        private String value;
        private String description;

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

        public String getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }
    }

    /**
     * 外部接口单据来源枚举
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum SRC_STATUS {
        ZMMES("ZMMES", "知明MES"),
        TBMES("TBMES", "MES接口"),
        AMP("AMP", "AMP系统"),
        DR("DR", "直送拉动");

        private String value;
        private String description;

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

        public String getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }
    }

    public static Map<String, Object> getEnumByName(String enumName) throws Exception {
        Class innerClazz[] = WmsEnumUtil.class.getDeclaredClasses();// 获取常量类中的所有内部类
        Class<Enum> clazz;
        Enum[] enumConstants;

        Map<String, Object> enumMap;// 枚举类
        List<Map<String, Object>> values;// 枚举实例【enumName：{“”：}，{“”：}，{“”：}】
        Map<String, Object> value;// 枚举实例属性

        Method getValue;
        Method getCode;
        Method getDescription;

        // 遍历内部类
        String simpleName;//内部类的类名
        for (Class class1 : innerClazz) {
            //获取内部内的类名
            simpleName = class1.getSimpleName();
            if (simpleName.equals(enumName)) {
                // 判断类是不是枚举类
                clazz = (Class<Enum>) Class.forName("cn.estsh.i3plus.pojo.base.enumutil.WmsEnumUtil$" + simpleName);

                // 枚举类方法初始化
                getCode = null;
                try {
                    getCode = clazz.getMethod("getCode");
                } catch (NoSuchMethodException e) {
                }
                getValue = clazz.getMethod("getValue");
                getDescription = clazz.getMethod("getDescription");

                // 获取所有枚举实例
                enumConstants = clazz.getEnumConstants();
                enumMap = new HashMap<>();
                values = new ArrayList<>();
                for (Enum enum1 : enumConstants) {
                    value = new HashMap<>();
                    value.put("value", getValue.invoke(enum1));
                    if (getCode != null) {
                        value.put("code", getCode.invoke(enum1));
                    }
                    value.put("description", getDescription.invoke(enum1));
                    values.add(value);
                }
                enumMap.put("enumName", clazz.getSimpleName());
                enumMap.put("valuesList", values);
                return enumMap;
            }
        }
        return null;
    }

    /**
     * 库存数量类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum STOCK_QUAN_QTY_TYPE {
        QTY("qty", "可用数量"),
        FAIL_QTY("failQty", "不合格数量"),
        HOLD_QTY("holdQty", "隔离数量"),
        QC_QTY("qcQty", "质检中数量"),
        RIN_QTY("rinQty", "待入库数量"),
        FREEZE_QTY("freezeQty", "冻结数量"),
        CONSIGN_QTY("consignQty", "寄售数量"),
        LOCK_QTY("lockQty", "锁定数量"),
        SCRAP_QTY("scrapQty", "报废数量");

        private String value;
        private String description;

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

        public String getDescription() {
            return description;
        }

        public String getCode() {
            return value;
        }

        public String getValue() {
            return value;
        }

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

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

    /**
     * ERP同步标识 10=待同步，20=同步成功，30=同步失败
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum WMS_ERP_SYNC_FLAG {
        CREATE(10, "待同步"), SUCCESS(20, "同步成功"), FAIL(30, "同步失败");

        private int value;
        private String description;

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

    /**
     * ERP同步标识 10=待同步，20=同步成功，30=同步失败
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum WMS_SN_GENERATE_RULE {
        SOURCE(10, "源"), TARGET(20, "目标"), NON_ASSIGNMENT(30, "不赋值");

        private int value;
        private String description;

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

    /**
     * PDA顶级菜单
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum PDA_TOP_MENU {
        RC("RC", "收货"),
        QC("QC", "质检"),
        PICK("PICK", "拣货"),
        OUTSTOCK("OUTSTOCK", "出库"),
        INSTOCK("INSTOCK", "入库"),
        MOVESTOCK("MOVESTOCK", "移库"),
        ASSIST("ASSIST", "辅助"),
        NC("NC", "NC"),
        CS("CS", "盘点");

        private String value;
        private String description;

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

        public String getCode() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public String getValue() {
            return value;
        }
    }

    /**
     * 条码类型 10=实物条码，20=虚拟条码
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum WMS_STOCK_TYPE {
        SOURCE(10, "实物条码"), TARGET(20, "虚拟条码");

        private int value;
        private String description;

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

    /**
     * 库位校验源库位目标库位参数
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum SRC_DEST_LOCATE {
        SRC(10, "SRC", "源库位"),
        DEST(20, "DEST", "目标库位");

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

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

        public int getValue() {
            return value;
        }

        public static SRC_DEST_LOCATE codeOf(int value) {
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == (value)) {
                    return values()[i];
                }
            }
            return null;
        }

        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 OUT_CLOSE_FLAG {
        INTERNAL_SETTLEMENT("1", "内部结算"),
        NOMAL_SETTLEMENT("2", "正常结算");

        private String value;
        private String description;

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

        public String getDescription() {
            return description;
        }

        public String getCode() {
            return value;
        }

        public String getValue() {
            return value;
        }


        public static String getDes(String 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 OUT_CLOSE_TYPE {
        OFF_LINE_SETTLEMENT("10", "下线结算"),
        PICK_SETTLEMENT("20", "配料结算");

        private String value;
        private String description;

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

        public String getDescription() {
            return description;
        }

        public String getCode() {
            return value;
        }

        public String getValue() {
            return value;
        }


        public static String getDes(String 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 STOCK_INITIALIZE_STATUS {
        CREATE(10, "创建"),
        FINISH(20, "完成");

        private int value;
        private String description;

        STOCK_INITIALIZE_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 INVENTORY_DIFFERENCE_TYPE {
        INVENTORY_FLAT(10, "INVENTORY_FLAT", "盘平"),
        INVENTORY_LOSSES(20, "INVENTORY_LOSSES", "盘亏"),
        INVENTORY_WIN(30, "INVENTORY_WIN", "盘赢"),
        INVENTORY_DIS(40, "INVENTORY_DIS", "库位不一致"),
        INVENTORY_WITHOUT(60, "INVENTORY_WITHOUT", "未盘");

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

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

        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 REC_STATUS{
        UNRECEIVED("UNRECEIVED", "未收货"),
        COMPLETE_RECEIPT("COMPLETE_RECEIPT", "完成收货"),
        PARTIAL_RECEIPT("PARTIAL_RECEIPT", "部分收货"),
        OVER_RECEIVED_GOODS("OVER_RECEIVED_GOODS", "超量收货"),
        OTHER("ELSE", "其他"),;

        private String value;
        private String description;

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

        public String getDescription() {
            return description;
        }

        public String getCode() {
            return value;
        }

        public String getValue() {
            return value;
        }


        public static String getDes(String 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(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;
        }
    }

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

        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 PART_ASSOCIATE_TYPE {
        LINE(10, "LINE", "产线"),
        CUSTOMER(20, "CUSTOMER", "客户"),
        VENDOR(30, "VENDOR", "供应商");

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

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

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

    /**
     * 条码操作记录信息 操作类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum SN_OPERATE_TYPE {
        REPORT(10, "REPORT", "生产报工"),
        BOXING_ERROR_PROOFING(20, "BOXING_ERROR_PROOFING", "装箱防错");

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

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

        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 ROUTING_RULE_MODE {
        CREATE_TASK(10, "CREATE_TASK", "生成任务"),
        AUTO_OPT(20, "AUTO_OPT", "自动操作"),
    	MENU_OPT(30, "MENU_OPT", "手工操作"),
    	AUTO_OPT_NON_TRANS(40, "AUTO_OPT_NON_TRANS", "自动操作无交易");
        private int value;
        private String code;
        private String description;

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

        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 ROUTING_RULE_TYPE {
    	PROMOTION_TYPE(10, "REPLENISH_TYPE", "推动规则"),
    	REPLENISH_TYPE(20, "PROMOTION_TYPE", "补货规则");
        private int value;
        private String code;
        private String description;

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

        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 ROUTING_DELAY_UNIT {
    	M(10, "M", "分"),
        D(20, "D", "天");
        private int value;
        private String code;
        private String description;

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

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

}