package cn.superdesk.uniorder.common.enums.thirdpart.jd;

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

/**
 * @Description: 对账单类型 1-客户结算;2-供应商结算;
 * @Author: linjinyu
 * @CreateDate: 2020/12/21 下午7:18
 * @UpdateUser: linjinyu
 * @UpdateDate: 2020/12/21 下午7:18
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum SysQuartzScheduleTaskStatementOfAccountStatementOfAccountTypeEnum {


    客户结算(1, "客户结算"),
    供应商结算(2, "供应商结算"),
    京东账单(21, "京东账单"),
    ;

    private Integer key;
    private String  desc;

    SysQuartzScheduleTaskStatementOfAccountStatementOfAccountTypeEnum(Integer key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public Integer getKey() {
        return key;
    }

    public String getDesc() {
        return desc;
    }

    public static String getDesc(Integer key) {
        for (SysQuartzScheduleTaskStatementOfAccountStatementOfAccountTypeEnum c : SysQuartzScheduleTaskStatementOfAccountStatementOfAccountTypeEnum.values()) {
            if (c.key.equals(key)) {
                return c.getDesc();
            }
        }
        return null;
    }

    private static final Map<Integer, SysQuartzScheduleTaskStatementOfAccountStatementOfAccountTypeEnum> LOOKUP = new HashMap<>();

    static {
        for (SysQuartzScheduleTaskStatementOfAccountStatementOfAccountTypeEnum s : EnumSet.allOf(SysQuartzScheduleTaskStatementOfAccountStatementOfAccountTypeEnum.class)) {
            LOOKUP.put(s.getKey(), s);
        }
    }

    public static SysQuartzScheduleTaskStatementOfAccountStatementOfAccountTypeEnum get(Integer key) {
        return LOOKUP.get(key);
    }
}
