package com.muchinfo.mtp3common.enumtype;

import java.util.HashMap;
import java.util.Map;

public class SysEnums {

    public static enum OrganRole {

        /**
         * 2--运营 operate
         * 3--营销 marketing
         * 4--仓库 warehouse
         * 5--三方 tpart
         * 6--自营 selfsupport
         * 7--经纪 broker
         * 8--做市 marketer
         * 9--产业 industry
         */
        exchange(1, "平台"),
        operate(2, "运营机构"),
        marketing(3, "营销中心"),
        warehouse(4, "仓库机构"),
        tpart(5, "第三方服务机构"),
        selfsupport(6, "自营会员"),
        broker(7, "经纪会员"),
        marketer(8, "做市会员"),
        industry(9, "产业会员"),
        supply(10, "金融机构"),
        shoping(11, "商城店铺"),
        sonarea(12, "代理商"),
        quoter(13, "报价商"),
        integral(14, "积分服务商"),
        supplier(15, "供货商"),
        ringdealing(16, "圈内会员"),
        logistics(17, "物流机构"),
        quoterorgan(18, "报价配置机构"),
        //		listingtransaction(67, "挂牌交易"),
//		outboundbonded(66, "出境保税"),
        seller(69, "卖方管理"),//6+9
        ordinarymember(96, "普通会员"),
        coremember(97, "核心会员"),
        outoption(19, "场外期权做市商");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private OrganRole(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static OrganRole getStatus(Integer code) {
            OrganRole enumStatus = null;
            for (int i = 0; i < OrganRole.values().length; i++) {
                enumStatus = OrganRole.values()[i];
                if (enumStatus.getCode().equals(code)) {
                    break;
                }
            }
            return enumStatus;
        }
    }

    /**
     * 通用状态枚举---要修改
     * 2-注销 1-正常
     */
    public static enum CommonStatus {
        /**
         * 1-正常
         */
        WORK(1, "正常"),
        /**
         * 2-注销
         */
        DEL(2, "注销");
        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private CommonStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static CommonStatus getStatus(Integer code) {
            CommonStatus enumStatus = null;
            for (int i = 0; i < CommonStatus.values().length; i++) {
                enumStatus = CommonStatus.values()[i];
                if (enumStatus.getCode().equals(code)) {
                    break;
                }
            }
            return enumStatus;
        }
    }

    //运行状态枚举  市场表openStatus
    public static enum OpenStatusEnum {
        DOPEN(0, "待开市"),
        YOPEN(1, "已开市"),
        YCLOSE(2, "已闭市"),
        PAUSE(9, "暂停");

        private final String code;
        private final Integer type;

        public String getCode() {
            return code;
        }

        public Integer getType() {
            return type;
        }

        private OpenStatusEnum(Integer type, String code) {
            this.type = type;
            this.code = code;
        }

        public static OpenStatusEnum getByStatus(Integer type) {
            OpenStatusEnum openStatusEnum = null;
            for (int i = 0; i < OpenStatusEnum.values().length; i++) {
                openStatusEnum = OpenStatusEnum.values()[i];
                if (openStatusEnum.getType().equals(type)) {
                    break;
                }
            }
            return openStatusEnum;
        }
    }

    /**
     * 用户销户处理状态
     *
     * @author zhang.kun
     * @date 2018-04-25
     */
    public static enum AccountOffStatusEnum {
        /**
         * 待审核
         */
        PENDING(0, "待审核"),
        /**
         * 审核通过
         */
        PASS(1, "审核通过"),
        /**
         * 审核拒绝
         */
        REFUSED(2, "审核拒绝"),
        /**
         * 处理中
         */
        HANDLING(3, "处理中");

        private final String code;
        private final Integer type;

        public String getCode() {
            return code;
        }

        public Integer getType() {
            return type;
        }

        private AccountOffStatusEnum(Integer type, String code) {
            this.type = type;
            this.code = code;
        }

        public static OpenStatusEnum getByStatus(Integer type) {
            OpenStatusEnum openStatusEnum = null;
            for (int i = 0; i < OpenStatusEnum.values().length; i++) {
                openStatusEnum = OpenStatusEnum.values()[i];
                if (openStatusEnum.getType().equals(type)) {
                    break;
                }
            }
            return openStatusEnum;
        }
    }

    /**
     * 用户销户处理状态
     *
     * @author zhang.kun
     * @date 2018-04-25
     */
    public static enum AccountOffApplyEnum {
        /**
         * 待处理
         */
        APPLY(0, "待处理"),
        /**
         * 处理中
         */
        HANDLING(1, "处理中"),
        /**
         * 完成
         */
        FINISH(2, "完成");

        private final String code;
        private final Integer type;

        public String getCode() {
            return code;
        }

        public Integer getType() {
            return type;
        }

        private AccountOffApplyEnum(Integer type, String code) {
            this.type = type;
            this.code = code;
        }

        public static OpenStatusEnum getByStatus(Integer type) {
            OpenStatusEnum openStatusEnum = null;
            for (int i = 0; i < OpenStatusEnum.values().length; i++) {
                openStatusEnum = OpenStatusEnum.values()[i];
                if (openStatusEnum.getType().equals(type)) {
                    break;
                }
            }
            return openStatusEnum;
        }
    }

    /**
     * 用户开户处理状态
     *
     * @author zhang.kun
     * @date 2018-04-25
     */
    public static enum AccountStatusEnum {
        /**
         * 待激活
         */
        TOBEACTIVATE(1, "待激活"),
        /**
         * 待审核
         */
        TOBEAUDIT(2, "待审核"),
        /**
         * 待复审
         */
        RETRIAL(3, "待复审"),
        /**
         * 正常
         */
        NORMAL(4, "正常"),
        /**
         * 审核拒绝
         */
        REFUSED(5, "审核拒绝"),
        /**
         * 已注销
         */
        CANCELED(6, "已注销");

        private final String code;
        private final Integer type;

        public String getCode() {
            return code;
        }

        public Integer getType() {
            return type;
        }

        private AccountStatusEnum(Integer type, String code) {
            this.type = type;
            this.code = code;
        }

        public static OpenStatusEnum getByStatus(Integer type) {
            OpenStatusEnum openStatusEnum = null;
            for (int i = 0; i < OpenStatusEnum.values().length; i++) {
                openStatusEnum = OpenStatusEnum.values()[i];
                if (openStatusEnum.getType().equals(type)) {
                    break;
                }
            }
            return openStatusEnum;
        }
    }

    /**
     * 资金账户状态
     *
     * @author zhang.kun
     * @date 2018-04-25
     */
    public static enum TradeStatusEnum {
        /**
         * 正常
         */
        NORMAL(1, "正常"),
        /**
         * 受限
         */
        LIMITED(2, "受限"),
        /**
         * 冻结
         */
        FROZEN(3, "冻结"),
        /**
         * 人工受限(禁止建仓)
         */
        LIMITEDMANUAL(4, "人工受限(禁止建仓)"),
        /**
         * 人工冻结(禁止交易)
         */
        FROZENMANUAL(5, "人工冻结(禁止交易)"),
        /**
         * 待激活
         */
        TOBEACTIVATE(6, "待激活"),
        /**
         * 已注销
         */
        CANCELED(7, "已注销");

        private final String code;
        private final Integer type;

        public String getCode() {
            return code;
        }

        public Integer getType() {
            return type;
        }

        private TradeStatusEnum(Integer type, String code) {
            this.type = type;
            this.code = code;
        }

        public static String getColumntype(Integer type) {
            String e = null;
            for (int i = 0; i < TradeStatusEnum.values().length; i++) {
                if (TradeStatusEnum.values()[i].getType().equals(type)) {
                    e = TradeStatusEnum.values()[i].getCode();
                    break;
                }
            }
            return e;
        }
    }

    /**
     * 用户操作变更类型
     *
     * @author zhang.kun
     * @date 2018-05-09
     */
    public static enum UserOperateTypeEnum {
        /**
         * 新增用户
         */
        ADD(0, "新增用户"),
        /**
         * 删除用户
         */
        DEL(1, "删除用户"),
        /**
         * 修改用户
         */
        UPDATE(2, "修改用户"),
        /**
         * 修改用户个性化
         */
        UPDATEPERSONAL(3, "修改用户个性化");

        private final String code;
        private final Integer type;

        public String getCode() {
            return code;
        }

        public Integer getType() {
            return type;
        }

        private UserOperateTypeEnum(Integer type, String code) {
            this.type = type;
            this.code = code;
        }

        public static OpenStatusEnum getByStatus(Integer type) {
            OpenStatusEnum openStatusEnum = null;
            for (int i = 0; i < OpenStatusEnum.values().length; i++) {
                openStatusEnum = OpenStatusEnum.values()[i];
                if (openStatusEnum.getType().equals(type)) {
                    break;
                }
            }
            return openStatusEnum;
        }
    }

    /**
     * 账户操作变更类型
     *
     * @author zhang.kun
     * @date 2018-05-09
     */
    public static enum AccountOperateTypeEnum {
        /**
         * 新增用户
         */
        ADD(0, "新增用户"),
        /**
         * 删除用户
         */
        DEL(1, "删除用户"),
        /**
         * 修改用户
         */
        UPDATE(2, "修改用户"),
        /**
         * 修改用户个性化
         */
        UPDATEPERSONAL(3, "修改用户个性化"),
        /**
         * 修改账户权限
         */
        UPDATERIGHT(4, "修改账户权限");

        private final String code;
        private final Integer type;

        public String getCode() {
            return code;
        }

        public Integer getType() {
            return type;
        }

        private AccountOperateTypeEnum(Integer type, String code) {
            this.type = type;
            this.code = code;
        }

        public static OpenStatusEnum getByStatus(Integer type) {
            OpenStatusEnum openStatusEnum = null;
            for (int i = 0; i < OpenStatusEnum.values().length; i++) {
                openStatusEnum = OpenStatusEnum.values()[i];
                if (openStatusEnum.getType().equals(type)) {
                    break;
                }
            }
            return openStatusEnum;
        }
    }

    /**
     * 消息通知模式
     *
     * @author zhang.kun
     * @date 2018-05-09
     */
    public static enum NotifyModeEnum {
        /**
         * 单播
         */
        UNICAST(0, "单播"),
        /**
         * 组播
         */
        MULTICAST(1, "组播"),
        /**
         * 完成
         */
        BROADCAST(2, "广播");

        private final String code;
        private final Integer type;

        public String getCode() {
            return code;
        }

        public Integer getType() {
            return type;
        }

        private NotifyModeEnum(Integer type, String code) {
            this.type = type;
            this.code = code;
        }

        public static OpenStatusEnum getByStatus(Integer type) {
            OpenStatusEnum openStatusEnum = null;
            for (int i = 0; i < OpenStatusEnum.values().length; i++) {
                openStatusEnum = OpenStatusEnum.values()[i];
                if (openStatusEnum.getType().equals(type)) {
                    break;
                }
            }
            return openStatusEnum;
        }
    }

    //市场状态枚举
    public static enum EnumMarketStatus {
        /**
         * 待生效
         */
        UN_ACTIVE(1, "待生效"),
        /**
         * 正常
         */
        NORMAL(2, "正常"),
        /**
         * 注销
         */
        DELETE(3, "注销");

        private final String code;
        private final Integer type;

        public String getCode() {
            return code;
        }

        public Integer getType() {
            return type;
        }

        private EnumMarketStatus(Integer type, String code) {
            this.type = type;
            this.code = code;
        }

        public static EnumMarketStatus getByStatus(Integer type) {
            EnumMarketStatus enumMarketStatus = null;
            for (int i = 0; i < EnumMarketStatus.values().length; i++) {
                enumMarketStatus = EnumMarketStatus.values()[i];
                if (enumMarketStatus.getType().equals(type)) {
                    break;
                }
            }
            return enumMarketStatus;
        }
    }


    /**
     * 市场运行状态枚举
     */
    public static enum MarketRunStatus {
        /**
         * 开市
         */
        RUN(2, "开市"),
        CLOSE(5, "闭市"),
        /**
         * 日终处理开始
         */
        BEGIN_RECKON(10, "日终处理开始"),
        /**
         * 日终处理成功
         */
        RECKON_SUCCESS(11, "日终处理成功"),
        /**
         * 日终处理失败
         */
        RECKON_FAIL(12, "日终处理失败"),

        SYSTEM_RECKON_SUCCESS(26, "系统结算成功");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private MarketRunStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static MarketRunStatus getByStatus(Integer code) {
            MarketRunStatus runStatus = null;
            for (int i = 0; i < MarketRunStatus.values().length; i++) {
                runStatus = MarketRunStatus.values()[i];
                if (runStatus.getCode().equals(code)) {
                    break;
                }
            }
            return runStatus;
        }
    }


    /**
     * 交易模式
     */
    public static enum TradeMode {
        /**
         * 做市
         */
        MAKER(10, "做市"),
        /**
         * 竞价
         */
        Quoter(13, "竞价"),
        /**
         * 通道交易
         */
        TDJY(15, "通道交易 "),
        /**
         * 挂牌点选
         */
        GPDX(16, "挂牌点选 "),
        /**
         * 仓单贸易
         */
        CDMY(17, "仓单贸易"),
        /**
         * 期权交易
         */
        QQJY(18, "期权交易 "),

        /**
         * 受托竞价
         */
        STJJ(22, "受托竞价 "),

        /**
         * 挂牌期权
         */
        GPQQ(26, "挂牌期权"),

        /**
         * 竞拍-竞价式
         */
        JPJJS(20, "挂牌期权"),

        /**
         * 竞拍-大宗式
         */
        JPDZS(21, "竞拍-大宗式"),

        /**
         * 挂牌交易
         */
        GPJY2(67, "挂牌交易"),

        /**
         * 竞拍-荷兰式
         */
        JPHLS(34, "竞拍-荷兰式"),

        OUTQQ(33, "场外期权"),
        BBDH(32, "币币兑换"),
        DQ(46, "掉期贸易"),
        DJZR(49, "定金转让"),
        DDGP(50, "订单挂牌"),
        DDZS(52, "订单做市"),

        GZ62(62, "集采交易"),
        GZ63(63, "预售交易"),

        BJB(69, "铂金宝"),
        SCSC(70, "商城市场"),
        XHSC(77, "现货商城"),
        BJJY(78, "报价交易"),
        GPJY(79, "挂牌交易"),
        FJYSC(97, "非交易市场"),
        CKHQ(99, "参考行情"),

        // 合约预售模式
        YSYKJ(40, "预售一口价"),
        YSJP(41, "预售竞拍(大宗)"),
        GPYS(71, "挂牌预售"),
        DJYSB(48, "定金预售(大宗)"),
        DJYSZQ(51, "定金预售(中签)"),

        ;
        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private TradeMode(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static TradeMode getTradeMode(Integer code) {
            TradeMode e = null;
            for (int i = 0; i < TradeMode.values().length; i++) {
                e = TradeMode.values()[i];
                if (e.getCode().equals(code)) {
                    break;
                }
            }
            return e;
        }
    }

    public static enum TradeProperty {
        GAIN(1, "收益权"),
        OWNER(2, "所有权"),
        OPTION(3, "期权"),
        CANGOODS(4, "现货"),
        Quote(5, "参考行情"),
        OUTTRATE(6, "通道交易"),
        C2C(7, "币交易"),
        QTO(8, "场外期权");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private TradeProperty(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getTradeProperty(Integer code) {
            String e = null;
            for (int i = 0; i < TradeProperty.values().length; i++) {
                if (TradeProperty.values()[i].getCode().equals(code)) {
                    e = TradeProperty.values()[i].getName();
                    break;
                }
            }
            return e;
        }
    }

    /**
     * 费用类型 ---要修改
     */
    public static enum FeeKindMode {
        //		INSUER(1, "保证金"),
        FEE(101, "建仓手续费"),
        DELIVERY(102, "平仓手续费"),
        OUT(103, "买递延费"),
        IN(104, "卖递延费"),
        DELAY(105, "买交收手续费"),
        PAY(106, "卖交收手续费");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private FeeKindMode(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getKindMode(Integer code) {
            String enumStatus = null;
            for (int i = 0; i < FeeKindMode.values().length; i++) {
                if (FeeKindMode.values()[i].getCode().equals(code)) {
                    enumStatus = FeeKindMode.values()[i].getName();
                    break;
                }
            }
            return enumStatus;
        }
    }

    /**
     * 商品状态- 1:待审核 2:未上市 3:上市 4:已注销 5:核拒绝 6:退市 7:待退市
     */
    public static enum GoodsStatus {
        PENDING(1, "待审核"),
        PENDING_WORK(2, "未上市"),
        WORK(3, "上市"),
        DEL(4, "已注销"),
        notpass(5, "审核拒绝"),
        OUT(6, "退市"),
        PENDING_OUT(7, "待退市");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private GoodsStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static GoodsStatus getStatus(Integer code) {
            GoodsStatus enumStatus = null;
            for (int i = 0; i < GoodsStatus.values().length; i++) {
                enumStatus = GoodsStatus.values()[i];
                if (enumStatus.getCode().equals(code)) {
                    break;
                }
            }
            return enumStatus;
        }
    }


    /** 企业性质
     public static enum Biznature {

     nationalised(1, "国有控股企业"),
     personality (2, "个体控股企业"),
     privately   (3, "私人控股企业"),
     hk          (4, "港澳台商控股企业"),
     foreign     (5, "外商控股企业");

     private final Integer code;
     private final String name;
     public Integer getCode() {
     return code;
     }
     public String getName() {
     return name;
     }
     private Biznature(Integer code, String name){
     this.code=code;
     this.name=name;
     }
     public static String getStatus(Integer code){
     String enumStatus = null;
     for(int i=0;i<Biznature.values().length;i++){
     if(Biznature.values()[i].getCode().equals(code)){
     enumStatus = Biznature.values()[i].getName();
     break;
     }
     }
     return enumStatus;
     }
     }*/


    /**
     * 用户登录状态
     */
    public static enum LoginStatus {

        loginout(1, "未登录"),
        loginon(2, "已登录");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private LoginStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getStatus(Integer code) {
            String enumStatus = null;
            for (int i = 0; i < LoginStatus.values().length; i++) {
                if (LoginStatus.values()[i].getCode().equals(code)) {
                    enumStatus = LoginStatus.values()[i].getName();
                    break;
                }
            }
            return enumStatus;
        }
    }


    /**
     * 用户状态
     */
    public static enum SysStatus {

        ok(1, "启用"),
        stop(2, "停用"),
        lock(3, "锁定");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private SysStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getStatus(Integer code) {
            String enumStatus = null;
            for (int i = 0; i < SysStatus.values().length; i++) {
                if (SysStatus.values()[i].getCode().equals(code)) {
                    enumStatus = SysStatus.values()[i].getName();
                    break;
                }
            }
            return enumStatus;
        }
    }


    /**
     * 变更状态
     */
    public static enum Modifystatus {

        nochange(0, "未变更"),
        change(1, "变更中"),
        audit(2, "变更待审核"),
        notpass(3, "审核拒绝");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private Modifystatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getStatus(Integer code) {
            String enumStatus = null;
            for (int i = 0; i < Modifystatus.values().length; i++) {
                if (Modifystatus.values()[i].getCode().equals(code)) {
                    enumStatus = Modifystatus.values()[i].getName();
                    break;
                }
            }
            return enumStatus;
        }
    }


    /**
     * 账务类别
     */
    public static enum AccType {
        ASSET(1, "资产类"),
        LIABILITIES(2, "负债类"),
        EQUITY(3, "权益类"),
        OTHER(4, "其他类");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private AccType(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getStatus(Integer code) {
            String enumStatus = null;
            for (int i = 0; i < AccType.values().length; i++) {
                if (AccType.values()[i].getCode().equals(code)) {
                    enumStatus = AccType.values()[i].getName();
                    break;
                }
            }
            return enumStatus;
        }
    }

    /**
     * 总科目
     */
    public static enum AccSubject {
        DEPOSIT(1, "银行存款"),
        CLEARING(2, "代理清算资金"),
        INCOME(3, "收入"),
        OTHER(4, "其它类");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private AccSubject(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getStatus(Integer code) {
            String enumStatus = null;
            for (int i = 0; i < AccSubject.values().length; i++) {
                if (AccSubject.values()[i].getCode().equals(code)) {
                    enumStatus = AccSubject.values()[i].getName();
                    break;
                }
            }
            return enumStatus;
        }
    }

    /**
     * 明细科目
     * 3301:平台手续费，3302:汇率换算 3303:平台违约收入 2201:机构手续费
     * 2202:履约扣款  2203:商城扣款 2299:其它金额  11**银行存款
     **/
    public static enum DetailSubject {
        DEPOSIT(3301, "平台手续费"),
        AGENCY(3302, "汇率换算"),
        AGENCY_PROCEDURE(3303, "平台违约收入"),
        PROCEDURE(2201, "机构手续费"),
        PAYFOR_PROCEDURE(2202, "履约扣款"),
        PAYFOR_MALL(2209, "商城扣款"),
        OTHER(2299, "其它金额"),
        BANK(11, "银行存款"),
        PAY_CREDIT(4202, "交易授信");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private DetailSubject(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getStatus(Integer code) {
            String enumStatus = null;
            for (int i = 0; i < DetailSubject.values().length; i++) {
                if (DetailSubject.values()[i].getCode().equals(code)) {
                    enumStatus = DetailSubject.values()[i].getName();
                    break;
                }
            }
            return enumStatus;
        }
    }

    /**
     * 资金变动类型
     */
    public static enum ChangeType {
        OUT(1, "客户入金"),
        IN(2, "客户出金"),
        PROCEDURE(3, "扣客户手续费"),
        FEEDIVIDE(4, "分润"),
        FEEDIVIDE_TRANSFER(5, "分润划拨");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private ChangeType(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getStatus(Integer code) {
            String enumStatus = null;
            for (int i = 0; i < ChangeType.values().length; i++) {
                if (ChangeType.values()[i].getCode().equals(code)) {
                    enumStatus = ChangeType.values()[i].getName();
                    break;
                }
            }
            return enumStatus;
        }
    }

    /**
     * 代持流水变动类型
     *
     * @author liu.bingbing
     * @Title: EXChangeType
     * @Company: 多元世纪
     * @date 2017年4月11日
     * @Description:
     */
    public static enum EXChangeType {

        tabker(1, "提货"),
        delivery(2, "交割"),
        back(3, "未销售退回仓单"),
        input(9, "仓单转入");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private EXChangeType(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getStatus(Integer code) {
            String enumStatus = null;
            for (int i = 0; i < EXChangeType.values().length; i++) {
                if (EXChangeType.values()[i].getCode().equals(code)) {
                    enumStatus = EXChangeType.values()[i].getName();
                    break;
                }
            }
            return enumStatus;
        }
    }

    /**
     * <p>平台账户流水表 ——> 资金变动方向 </p>
     */
    public static enum RecIndex {

        add(1, "增加"),
        sub(2, "减少");
        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private RecIndex(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getStatus(Integer code) {
            String enumStatus = null;
            for (int i = 0; i < RecIndex.values().length; i++) {
                if (RecIndex.values()[i].getCode().equals(code)) {
                    enumStatus = RecIndex.values()[i].getName();
                    break;
                }
            }
            return enumStatus;
        }
    }


    /**
     * 机构分润状态
     */
    public static enum FeeStutas {
        PENDING_AUDIT(1, "待审核"),
        PENDING_PAYFOR(3, "待付款"),
        YET_PAYFOR(5, "已付款");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private FeeStutas(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getStatus(Integer code) {
            String enumStatus = null;
            for (int i = 0; i < FeeStutas.values().length; i++) {
                if (FeeStutas.values()[i].getCode().equals(code)) {
                    enumStatus = FeeStutas.values()[i].getName();
                    break;
                }
            }
            return enumStatus;
        }
    }


    /***  通知公告——> 推送方式   ****/
    public static enum SendTypeEnum {

        /**
         * 全体广播
         */
        ALLSEND(1, "全体广播"),
        /**
         * 按会员广播
         */
        MEMBERSEND(2, "按会员广播"),
        /**
         * 个人推送
         */
        PERSONSEND(3, "个人推送"),
        /**
         * 按会员广播(仅会员)
         */
        ONLYMEMBERSEND(4, "按会员广播(仅会员)"),
        /**
         * 全体交易商
         */
        ALLUSER(5, "全体交易商");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private SendTypeEnum(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getStatus(Integer code) {
            String sendTypeEnum = null;
            for (int i = 0; i < SendTypeEnum.values().length; i++) {
                if (SendTypeEnum.values()[i].getCode().equals(code)) {
                    sendTypeEnum = SendTypeEnum.values()[i].getName();
                    break;
                }
            }
            return sendTypeEnum;
        }
    }

    /***  通知公告——> 短信查询 --> 发送状态   ****/
    public static enum SMSCollectionStatusEnum {
        // 发送状态 		01：待发送	  03：已发送	 	04：发送失败
        toSend(1, "待发送"),
        sent(3, "已发送"),
        failSend(4, "发送失败");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private SMSCollectionStatusEnum(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getStatus(Integer code) {
            String sendTypeEnum = null;
            for (int i = 0; i < SMSCollectionStatusEnum.values().length; i++) {
                if (SMSCollectionStatusEnum.values()[i].getCode().equals(code)) {
                    sendTypeEnum = SMSCollectionStatusEnum.values()[i].getName();
                    break;
                }
            }
            return sendTypeEnum;
        }
    }

    /***  通知公告——> 短信查询 --> 发送状态   ****/
    public static enum SMSCollectionPriorityEnum {
        // 优先级别		1：正常 		2：加急 		3：紧急
        normal(1, "正常 "),
        urgent(2, "加急 "),
        critical(3, "紧急");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private SMSCollectionPriorityEnum(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getStatus(Integer code) {
            String sendTypeEnum = null;
            for (int i = 0; i < SMSCollectionPriorityEnum.values().length; i++) {
                if (SMSCollectionPriorityEnum.values()[i].getCode().equals(code)) {
                    sendTypeEnum = SMSCollectionPriorityEnum.values()[i].getName();
                    break;
                }
            }
            return sendTypeEnum;
        }
    }


    public static enum ProcessStatusEnum {
        NEW(1, "待处理"), DEAL(2, "正在处理"), FINISH(3, "完成");
        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private ProcessStatusEnum(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getString(Integer code) {
            String pstatusEnum = null;
            for (int i = 0; i < ProcessStatusEnum.values().length; i++) {
                if (ProcessStatusEnum.values()[i].getCode().equals(code)) {
                    pstatusEnum = ProcessStatusEnum.values()[i].getName();
                    break;
                }
            }
            return pstatusEnum;
        }
    }

    /**
     * a交割履约表
     * 状态 '0: 待执行 1: 执行中 2; 执行完毕 8： 已冻结 9： 已取消'
     **/
    public static enum DPStatusEnum {
        PENDING(0, "待执行"),
        DOING(1, "执行中"),
        SUCCESS(2, "执行完毕"),
        LOCK(8, "已冻结"),
        CANCEL(9, "已取消");
        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private DPStatusEnum(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getString(Integer code) {
            String pstatusEnum = null;
            for (int i = 0; i < DPStatusEnum.values().length; i++) {
                if (DPStatusEnum.values()[i].getCode().equals(code)) {
                    pstatusEnum = DPStatusEnum.values()[i].getName();
                    break;
                }
            }
            return pstatusEnum;
        }
    }

    /**
     * 交割履约支付状态
     * 0 ：待处理   1：待审核   2： 待付款    9： 已付款    8：付款失败
     **/
    public static enum DPPayStatusEnum {
        PENDING_DO(0, "待处理"),
        PENDING_AUDIT(1, "待审核"),
        PENDING_PAY(2, "待付款"),
        YET_PAY(8, "已付款"),
        PAY_FAILURE(9, "付款失败");
        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private DPPayStatusEnum(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getString(Integer code) {
            String pstatusEnum = null;
            for (int i = 0; i < DPPayStatusEnum.values().length; i++) {
                if (DPPayStatusEnum.values()[i].getCode().equals(code)) {
                    pstatusEnum = DPPayStatusEnum.values()[i].getName();
                    break;
                }
            }
            return pstatusEnum;
        }
    }


    /**
     * 要素类型
     * PP-1品牌 PZ-2品质，GG-3规格，CK-4仓库 YF-5月份
     **/
    public static enum PriceMoveTypeEnum {
        PP(1, "品牌"),
        PZ(2, "品质"),
        GG(3, "规格"),
        CK(4, "仓库"),
        YF(5, "月份");
        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private PriceMoveTypeEnum(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getString(Integer code) {
            String pstatusEnum = null;
            for (int i = 0; i < PriceMoveTypeEnum.values().length; i++) {
                if (PriceMoveTypeEnum.values()[i].getCode().equals(code)) {
                    pstatusEnum = PriceMoveTypeEnum.values()[i].getName();
                    break;
                }
            }
            return pstatusEnum;
        }
    }

    /**
     * SCF供应链金融 商品状态枚举
     */
    public static enum ScfGoodsStateEnum {
        NORMAL(1, "正常"),
        CANCEL(2, "已注销");
        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private ScfGoodsStateEnum(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getString(Integer code) {
            String pstatusEnum = null;
            for (int i = 0; i < ScfGoodsStateEnum.values().length; i++) {
                if (ScfGoodsStateEnum.values()[i].getCode().equals(code)) {
                    pstatusEnum = ScfGoodsStateEnum.values()[i].getName();
                    break;
                }
            }
            return pstatusEnum;
        }
    }

    /**
     * SCF供应链商品管理 报价方式枚举
     */
    public static enum ScfQuoteTypeEnum {
        HANDMOVE(1, "手动"),
        AUTO(2, "自动");
        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private ScfQuoteTypeEnum(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getString(Integer code) {
            String pstatusEnum = null;
            for (int i = 0; i < ScfQuoteTypeEnum.values().length; i++) {
                if (ScfQuoteTypeEnum.values()[i].getCode().equals(code)) {
                    pstatusEnum = ScfQuoteTypeEnum.values()[i].getName();
                    break;
                }
            }
            return pstatusEnum;
        }
    }

    /**
     * SCF供应链合同模板类型
     */
    public static enum ScfContractTypeEnum {
        WAREHOUSEBUYBACK(1, "仓单回购"),
        WAREHOUSEPLEDGE(2, "仓单质押"),
        COOPERATIONINSURANCE(3, "合作套保"),
        CAPITALLOAN(4, "资金贷款");
        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private ScfContractTypeEnum(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getString(Integer code) {
            String pstatusEnum = null;
            for (int i = 0; i < ScfContractTypeEnum.values().length; i++) {
                if (ScfContractTypeEnum.values()[i].getCode().equals(code)) {
                    pstatusEnum = ScfContractTypeEnum.values()[i].getName();
                    break;
                }
            }
            return pstatusEnum;
        }
    }

    /**
     * SCF供应链利率类型
     */
    public static enum ScfInterestRateModeEnum {
        WAREHOUSEBUYBACK(1, "年利率"),
        WAREHOUSEPLEDGE(2, "日利率");
        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private ScfInterestRateModeEnum(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getString(Integer code) {
            String pstatusEnum = null;
            for (int i = 0; i < ScfInterestRateModeEnum.values().length; i++) {
                if (ScfInterestRateModeEnum.values()[i].getCode().equals(code)) {
                    pstatusEnum = ScfInterestRateModeEnum.values()[i].getName();
                    break;
                }
            }
            return pstatusEnum;
        }
    }

    /**
     * scf风险率模式
     */
    public static enum ScfRiskModeEnum {
        RATE(1, "比率"),
        FIXED(2, "固定");
        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private ScfRiskModeEnum(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getString(Integer code) {
            String pstatusEnum = null;
            for (int i = 0; i < ScfRiskModeEnum.values().length; i++) {
                if (ScfRiskModeEnum.values()[i].getCode().equals(code)) {
                    pstatusEnum = ScfRiskModeEnum.values()[i].getName();
                    break;
                }
            }
            return pstatusEnum;
        }
    }

    /**
     * 委托状态
     *
     * @author Administrator
     * 1： 委托请求 2：待冻结 3：委托成功 4： 委托失败 5：配对成功 6： 已撤销 7：部分成交
     * 8：已成交 9：部成部撤 10：成交失败 11：已拒绝 12:经过摘牌(先摘后挂专用)
     */
    public static enum OrderStatus {
        OrderRequest(1, "委托请求"),
        Waitfreeze(2, "待冻结"),
        OrderSucceed(3, "委托成功"),
        OrderFailed(4, "委托失败"),
        Matched(5, "配对成功"),
        Canceled(6, "已撤销"),
        Partialdeal(7, "部分成交"),
        Dealed(8, "已成交"),
        PartialCanceled(9, "部成部撤"),
        Dealfailed(10, "成交失败"),
        OrderDenied(11, "已拒绝"),
        Match(12, "经过摘牌"),
        FreezeSuccess(13, "冻结成功"),
        ChannelCanceled(14, "通道已撤"),
        ChannelPartialCanceled(15, "通道部成部撤");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private OrderStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getOrderStatus(Integer code) {
            String orderstatus = null;
            for (int i = 0; i < OrderStatus.values().length; i++) {
                if (OrderStatus.values()[i].getCode().equals(code)) {
                    orderstatus = OrderStatus.values()[i].getName();
                    break;
                }
            }
            return orderstatus;
        }
    }

    /**
     * 订单操作类型
     *
     * @author Administrator
     */
    public static enum OperateType {
        NORMAL(1, "正常下单"),
        RISK(2, "斩仓"),
        TRANSFER(3, "转单"),
        RECKON_CANCEL(4, "结算撤单"),
        SYS_CLOSE(5, "系统卖出"),
        QUOTEPRICE(6, "行情源报价"),
        ONTIME_CLOSE(7, "(结算)到期强平"),
        DEAL_CLOSE(8, "(结算)协议转让"),
        SYS_HEDGE(9, "系统对冲单"),
        RECKON_INVALID(10, "(结算)到期无效");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private OperateType(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getOperateType(Integer code) {
            String operatetype = null;
            for (int i = 0; i < OperateType.values().length; i++) {
                if (OperateType.values()[i].getCode().equals(code)) {
                    operatetype = OperateType.values()[i].getName();
                    break;
                }
            }
            return operatetype;
        }
    }

    /**
     * 账户服务资金操作类型
     *
     * @author Administrator
     */
    public static enum AccountFundCmdOp {
        DEPOSIT(101, "入金"),
        DEPOSIT_FEE(102, "入金手续费"),
        WITHDRAW(103, "出金"),
        WITHDRAW_FREEZE(104, "出金冻结"),
        WITHDRAW_UNFREEZE(105, "出金解冻"),
        WITHDRAW_FEE(106, "出金手续费"),
        WITHDRAW_FEE_FREEZE(107, "出金手续费冻结"),
        WITHDRAW_FEE_UNFREEZE(108, "出金手续费解冻"),
        TRADE_FREEZE(201, "交易冻结"),
        TRADE_UNFREEZE(202, "交易解冻"),
        TRADE_OCCUPY(203, "交易占用"),
        TRADE_FREE(204, "交易解占用"),
        TRADE_FEE_FREEZE(205, "交易手续费冻结"),
        TRADE_FEE_UNFREEZE(206, "交易手续费解冻"),
        TRADE_FEE(207, "交易手续费"),
        TRADE_GOODS_PAYMENT(208, "交易货款"),
        TRADE_PROFIT_LOSS(209, "交易盈亏"),
        DELIVERY_FREEZE(301, "交收冻结"),
        DELIVERY_UNFREEZE(302, "交收解冻"),
        DELIVERY_FEE(303, "交收手续费"),
        DELIVERY_FEE_FREEZE(304, "交收手续费冻结"),
        DELIVERY_FEE_UNFREEZE(305, "交收手续费解冻"),
        DELIVERY_GOODS_PAYMENT(306, "交收货款"),
        DELIVERY_TAX(307, "交收税款"),
        SETTLE_PROFIT_LOSS(401, "结算盈亏"),
        SETTLE_DEFERRED_FEE(402, "结算递延费"),
        SHARE_PROFIT(403, "分润收入"),
        STAY_SHARE_PROFIT(404, "延期分润"),
        SHARE_PROFIT_CONFIRM(405, "分润确认"),
        SETTLE_OVERNIGHT_FEE(406, "结算隔夜费"),
        CREDIT_INCREASE(501, "授信增加"),
        CREDIT_DECREASE(502, "授信减少"),
        PAY_POINTS(503, "转积分"),
        TRANSFER_IN(504, "转入"),
        TRANSFER_OUT(505, "转出"),
        TRANSFER_OUT_FREEZE(506, "转出冻结"),
        TRANSFER_OUT_UNFREEZE(507, "转出解冻"),
        PERFORMANCE_FREEZE(601, "履约金额冻结"),
        PERFORMANCE_MAX_FREEZE(602, "履约最大冻结"),
        PERFORMANCE_UNFREEZE(603, "履约金额解冻"),
        PERFORMANCE_DEDUCT(604, "履约扣款"),
        PERFORMANCE_RECEIVE(605, "履约收款"),
        PERFORMANCE_DEFAULT_FEE(606, "履约违约手续费"),
        PERFORMANCE_DEFAULT_INCOME(607, "履约违约收入"),
        PERFORMANCE_MAX_DEDUCT(608, "履约最大扣款"),
        PERFORMANCE_STAY_PAYMENT(609, "履约待付款"),
        SCF_FREEZE(701, "供应链金融冻结"),
        SCF_UNFREEZE(702, "供应链金融解冻"),
        SCF_MAX_FREEZE(703, "供应链金融最大冻结"),
        SCF_INTEREST(704, "供应链金融利息"),
        SCF_GOODS_PAYMENT(705, "供应链金融货款"),
        SCF_CASH_DEPOSIT(706, "供应链金融押金"),
        SCF_MAX_DEDUCT(707, "供应链金融最大扣款"),
        WRTRADE_FREEZE(801, "仓单贸易冻结"),
        WRTRADE_UNFREEZE(802, "仓单贸易解冻"),
        WRTRADE_DOWNPAYMENT(803, "仓单贸易首付款"),
        WRTRADE_MAX_DEDUCT(804, "仓单贸易最大扣款"),
        MALL_FREEZE(901, "商城扣款冻结"),
        MALL_UNFREEZE(902, "商城扣款解冻"),
        MALL_DEDUCT(903, "商城扣款"),
        MALL_RECEIVE(904, "商城收款"),
        OPTION_FREEZE(1001, "期权冻结"),
        OPTION_UNFREEZE(1002, "期权解冻"),
        OPTION_PREMIUM(1003, "期权定货金"),
        OPTION_FEE_FREEZE(1004, "期权手续费冻结"),
        OPTION_FEE_UNFREEZE(1005, "期权手续费解冻"),
        OPTION_FEE(1006, "期权手续费"),
        OPTION_PROFIT_LOSS(1007, "期权盈亏"),
        MARKETING_DEDUCT(1101, "扩展扣款"),
        MARKETING_RECEIVE(1102, "扩展收款"),
        MARKETING_FREEZE(1103, "扩展扣款冻结"),
        MARKETING_UNFREEZE(1104, "扩展扣款解冻"),
        AUCTION_FREEZE(1201, "竞拍冻结保证金"),
        AUCTION_UNFREEZE(1202, "竞拍解冻保证金"),
        AUCTION_DEDUCT(1203, "竞拍扣款"),
        AUCTION_RECEIVE(1204, "竞拍收款"),
        AUCTION_FEE_FREEZE(1205, "竞拍手续费冻结"),
        AUCTION_FEE_UNFREEZE(1206, "竞拍手续费解冻"),
        AUCTION_FEE(1207, "竞拍手续费"),
        AUCTION_PAYMENT_FREEZE(1208, "竞拍货款冻结"),
        AUCTION_PAYMENT_UNFREEZE(1209, "竞拍货款解冻"),
        AUCTION_FEE_INCOME(1210, "竞拍手续费收入"),
        AUCTION_FAIL_CHARGE(1211, "流拍手续费");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private AccountFundCmdOp(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getAccountFundCmdOp(Integer code) {
            String accountfund = null;
            for (int i = 0; i < AccountFundCmdOp.values().length; i++) {
                if (AccountFundCmdOp.values()[i].getCode().equals(code)) {
                    accountfund = AccountFundCmdOp.values()[i].getName();
                    break;
                }
            }
            return accountfund;
        }
    }

    /**
     * 仓单贸易枚举
     */
    public static enum WrTradeOrderStatusEnum {
        OrderReq(1, "委托请求"),
        Freeze(2, "待冻结"),
        OrderSuccess(3, "委托成功"),
        OrderFail(4, "委托失败"),
        PairSuccess(5, "配对成功"),
        Canceled(6, "已撤销"),
        Done(7, "已成交"),
        DoneFail(8, "成交失败"),
        OrderRefuse(9, "委托拒绝"),
        DonePart(10, "部分成交"),
        WareFail(11, "仓单生成失败"),
        PayAmountFail(12, "首付扣款失败"),
        PerformanceFail(13, "履约失败"),
        CancelOrderUnFreezeFail(14, "撤单解冻贷款失败"),
        DonePartCancelPart(15, "部成部撤");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private WrTradeOrderStatusEnum(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getString(Integer code) {
            String pstatusEnum = null;
            for (int i = 0; i < WrTradeOrderStatusEnum.values().length; i++) {
                if (WrTradeOrderStatusEnum.values()[i].getCode().equals(code)) {
                    pstatusEnum = WrTradeOrderStatusEnum.values()[i].getName();
                    break;
                }
            }
            return pstatusEnum;
        }
    }

    public static enum MsZyShipperStatus {
        WAITING_AUDIT(1, "待审核"),
        NOSHIPPER(2, "待发货"),
        SHIPPERED(3, "已发货"),
        RECIVED(4, "已收货"),
        FAILED(5, "申请失败"),
        PROCESSING(6, "待发货处理中"),
        REJECT(7, "审核拒绝");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private MsZyShipperStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getMsZyShipperStatus(Integer code) {
            String e = null;
            for (int i = 0; i < MsZyShipperStatus.values().length; i++) {
                if (MsZyShipperStatus.values()[i].getCode().equals(code)) {
                    e = MsZyShipperStatus.values()[i].getName();
                    break;
                }
            }
            return e;
        }
    }

    public static enum MsZyHanleStatus {
        NOHANLE(1, "未处理"),
        HANLING(2, "处理中"),
        HANLEDSUCCESS(3, "处理成功"),
        HANLEDFAIL(4, "处理失败"),
        AUDIT_DOING(5, "申请处理中(确认行权)");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private MsZyHanleStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getMsZyHanleStatus(Integer code) {
            String e = null;
            for (int i = 0; i < MsZyHanleStatus.values().length; i++) {
                if (MsZyHanleStatus.values()[i].getCode().equals(code)) {
                    e = MsZyHanleStatus.values()[i].getName();
                    break;
                }
            }
            return e;
        }
    }

    public static enum MsZyReceiptStatus {
        NOAPPLY(1, "未申请开票"),
        APPLY(2, "已申请开票"),
        APPLIED(3, "发票已发");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private MsZyReceiptStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getMsZyReceiptStatus(Integer code) {
            String e = null;
            for (int i = 0; i < MsZyReceiptStatus.values().length; i++) {
                if (MsZyReceiptStatus.values()[i].getCode().equals(code)) {
                    e = MsZyReceiptStatus.values()[i].getName();
                    break;
                }
            }
            return e;
        }
    }

    public static enum Clearstatus {
        no_clear(1, "未清算"),
        Success_clear(2, "清算成功"),
        fail_clear(3, "清算失败");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private Clearstatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getClearstatus(Integer code) {
            String e = null;
            for (int i = 0; i < Clearstatus.values().length; i++) {
                if (Clearstatus.values()[i].getCode().equals(code)) {
                    e = Clearstatus.values()[i].getName();
                    break;
                }
            }
            return e;
        }
    }

    public static enum Handlestatus {
        nohandle(1, "未处理"),
        handling(2, "处理中"),
        handled(3, "处理完成");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private Handlestatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getHandlestatus(Integer code) {
            String e = null;
            for (int i = 0; i < Handlestatus.values().length; i++) {
                if (Handlestatus.values()[i].getCode().equals(code)) {
                    e = Handlestatus.values()[i].getName();
                    break;
                }
            }
            return e;
        }
    }

    //提货方式  订单提货、预定款提货、提货券提货
    public static enum PickUpMode {
        orderpick(3, "定单提货"),
        prepick(2, "预定款提货"),
        consumepick(1, "提货券提货");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private PickUpMode(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getPickUpMode(Integer code) {
            String e = null;
            for (int i = 0; i < PickUpMode.values().length; i++) {
                if (PickUpMode.values()[i].getCode().equals(code)) {
                    e = PickUpMode.values()[i].getName();
                    break;
                }
            }
            return e;
        }
    }

    //分润角色类型(尚志)
    public static enum SZDivideTargetType {
        SUP(1, "供货商"),
        EXCH(2, "平台"),
        DIS(3, "总经销商"),
        BROKER(4, "经销商"),
        INVESTOR(5, "投资者");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private SZDivideTargetType(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getSZDivideTargetType(Integer code) {
            String e = null;
            for (int i = 0; i < SZDivideTargetType.values().length; i++) {
                if (SZDivideTargetType.values()[i].getCode().equals(code)) {
                    e = SZDivideTargetType.values()[i].getName();
                    break;
                }
            }
            return e;
        }
    }

    //出入金操作类型
    public static enum Executetype {
        OUTORIN_OUT(1, "出金"),
        OUTORIN_IN(2, "入金"),
        OUTORIN_SINGLESIDE_IN(3, "单边帐调整:入金"),
        OUTORIN_SINGLESIDE_OUT(4, "单边帐调整:出金");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private Executetype(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getExecutetype(Integer code) {
            String e = null;
            for (int i = 0; i < Executetype.values().length; i++) {
                if (Executetype.values()[i].getCode().equals(code)) {
                    e = Executetype.values()[i].getName();
                    break;
                }
            }
            return e;
        }
    }

    // 银行出入金  申请状态
    public static enum ApplyStatus {
        PENDING(1, "待审核"),
        PASS(2, "审核通过"),
        REJECT(3, "审核拒绝"),
        IN_TRAD_EFREEZE(4, "交易冻结中"),
        IN_TRADE_UNFREEZE(5, "交易解冻中"),
        IN_TRADE_UNFREEZE_DEDUCT(6, "交易解冻扣款中"),
        IN_TRADE_IN(7, "交易入金中"),
        IN_TRADE_FREEZE_UNFREEZE_DEDUCT(8, "交易冻结/解冻/扣款中(银行发起出金时用)"),
        IN_BANK_OUT(9, "银行出金中"),
        IN_BANK_IN(10, "银行入金中"),
        SUCCESS(11, "成功"),
        FAILED(12, "失败"),
        BANK_PENDING(13, "银行端审核中"),
        ACCOUNT_BANK_INFAILED(14, "账户服务入金失败"),
        ACCOUNT_UNFREEZE_FAILED(15, "账户服务解冻失败"),
        ACCOUNT_UNFREEZE_DEDUCT_FAILED(16, "账户服务解冻扣款失败"),
        ACCOUNT_BANK_OUTFAILED(17, "账户服务出金失败"),
        ACCOUNT_REAUDIT_PASS(18, "复审通过"),
        ACCOUNT_REAUDIT_REJECT(19, "复审拒绝");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private ApplyStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getApplyStatus(Integer code) {
            String e = null;
            for (int i = 0; i < ApplyStatus.values().length; i++) {
                if (ApplyStatus.values()[i].getCode().equals(code)) {
                    e = ApplyStatus.values()[i].getName();
                    break;
                }
            }
            return e;
        }
    }

    //日志书写类型
    public static enum LogWriteType {
        AUTOMATIC_OPERATION(1, "自动"),
        MANUAL_OPERATION(2, "手动");
        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private LogWriteType(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getLogWriteType(Integer code) {
            String e = null;
            for (int i = 0; i < LogWriteType.values().length; i++) {
                if (LogWriteType.values()[i].getCode().equals(code)) {
                    e = LogWriteType.values()[i].getName();
                    break;
                }
            }
            return e;
        }
    }

    //日志写操作类型
    public static enum LogOperatorType {
        ADD(1, "新增"),
        MODIFY(2, "修改"),
        DELETE(3, "删除"),
        ACTION(4, "激活"),
        CANCEL(5, "注销"),
        AUTDIT(6, "审核");
        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private LogOperatorType(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getLogOperatorType(Integer code) {
            String e = null;
            for (int i = 0; i < LogOperatorType.values().length; i++) {
                if (LogOperatorType.values()[i].getCode().equals(code)) {
                    e = LogOperatorType.values()[i].getName();
                    break;
                }
            }
            return e;
        }
    }

    //栏目类型
    public static enum columntype {
        information(1, "行情资讯"),
        service(10, "会员服务"),
        about(30, "关于我们");
        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private columntype(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getColumntype(Integer code) {
            String e = null;
            for (int i = 0; i < columntype.values().length; i++) {
                if (columntype.values()[i].getCode().equals(code)) {
                    e = columntype.values()[i].getName();
                    break;
                }
            }
            return e;
        }

        public static Integer getColumntypeString(String str) {
            Integer e = null;
            for (int i = 0; i < columntype.values().length; i++) {
                if (columntype.values()[i].toString().equals(str)) {
                    e = columntype.values()[i].getCode();
                    break;
                }
            }
            return e;
        }

    }


    public static enum NotifyOperateType {
        ADD(1, "增"),
        DEL(2, "删"),
        MODIFY(3, "改");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private NotifyOperateType(Integer code, String name) {
            this.code = code;
            this.name = name;
        }
    }


    public static enum GoodsNtfChangeType {
        ADD(0, "增"),
        DEL(1, "删"),
        MODIFY(2, "改");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private GoodsNtfChangeType(Integer code, String name) {
            this.code = code;
            this.name = name;
        }
    }

    /**
     * 交易模式和履约模板类型对应
     * 17仓单贸易  34竞拍-荷兰式 23预售采集   20竞拍-竞价式  21竞拍-大宗式  67 挂牌交易
     * 1:交割 2:仓单贸易 3:预售集采 4:竞拍-降价式 (无仓单) 5:挂牌期权 6:竞拍-降价式 7:竞拍-竞价式 8:竞拍-大宗式 9:荷兰式
     */
    public static Map<String, Integer> TEMPLATETYPE = new HashMap<String, Integer>();

    static {
        TEMPLATETYPE.put("17", 2);
        TEMPLATETYPE.put("67", 2);
        TEMPLATETYPE.put("34", 9);
        TEMPLATETYPE.put("23", 3);
        TEMPLATETYPE.put("20", 7);
        TEMPLATETYPE.put("21", 8);
    }

    public static enum Couponcategroy {
        ONE(1, "现金券"),
        TWO(2, "折扣券"),
        THREE(3, "折扣券(单个商品)");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private Couponcategroy(Integer code, String name) {
            this.code = code;
            this.name = name;
        }
    }

    public static enum ShortMsgBusinessType {

        ONE(1, 60, "重置密码"),
        TWO(2, 63, "绑定"),
        THREE(3, 64, "解绑");

        private final Integer code;
        private final Integer templateId;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public Integer getTemplateId() {
            return templateId;
        }

        public String getName() {
            return name;
        }

        private ShortMsgBusinessType(Integer code, Integer templateId, String name) {
            this.code = code;
            this.templateId = templateId;
            this.name = name;
        }

        public static ShortMsgBusinessType getByCode(Integer code) {
            ShortMsgBusinessType shortMsgBusinessType = null;
            for (int i = 0; i < ShortMsgBusinessType.values().length; i++) {
                if (ShortMsgBusinessType.values()[i].getCode().equals(code)) {
                    shortMsgBusinessType = ShortMsgBusinessType.values()[i];
                    break;
                }
            }
            return shortMsgBusinessType;
        }
    }

    public static enum Nodetype {
        ONE(1, "注册"),
        TWO(2, "登录"),
        THREE(3, "购买"),
        FOUR(4, "融资购买"),
        FIVE(5, "定投"),
        SIX(6, "卖出"),
        OTHER(99, "首次交易");

        private final Integer code;
        private final String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        private Nodetype(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static Nodetype getByCode(Integer code) {
            Nodetype nodetype = null;
            for (int i = 0; i < Nodetype.values().length; i++) {
                if (Nodetype.values()[i].getCode().equals(code)) {
                    nodetype = Nodetype.values()[i];
                    break;
                }
            }
            return nodetype;
        }
    }
}
