package cn.superdesk.uniorder.common.enums.order;


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

/**
 * @Description: 开票状态 是否已登记开票 0-未登记;1-已登记;
 * @link InvoiceApplyCustomerMakeInvoiceStatusEnum
 * @Author: linjinyu
 * @CreateDate: 8/5/20 5:50 PM
 * @UpdateUser: linjinyu
 * @UpdateDate: 8/5/20 5:50 PM
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Deprecated
public enum UnifiedOrderCreditInvoiceMakeStatusEnum {

    待开票(0, "待开票"),
    已开票(1, "已开票"),
    ;

    private Integer key;
    private String  desc;

    UnifiedOrderCreditInvoiceMakeStatusEnum(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 (UnifiedOrderCreditInvoiceMakeStatusEnum c : UnifiedOrderCreditInvoiceMakeStatusEnum.values()) {
            if (c.key.equals(key)) {
                return c.getDesc();
            }
        }
//		return null;
        return "未开票";
    }

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

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

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