package cn.superdesk.uniorder.common.enums.invoice.customer;

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

/**
 * @Description: 是否回款_回款状态:0-未回款;1-部分回款;2-全部回款;69-红冲发票;
 * 回款登记部分-回款状态:0-未回款;1-部分回款;2全部回款;
 * @Author: linjinyu
 * @CreateDate: 7/30/20 4:52 PM
 * @UpdateUser: linjinyu
 * @UpdateDate: 7/30/20 4:52 PM
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum InvoiceApplyCustomerBackAccountStatusEnum {


    未回款(0, "未回款"),
    回款中(10, "回款中"), // 对映而已 如果过程能监控时用
    部分回款(1, "部分回款"),
    已回款(2, "已回款"),

    发票蓝冲(67, "发票蓝冲"), // ---- 没有
    发票红冲(69, "发票红冲"), // ---- 积分结算v2.1
    发票作废(70, "发票作废"), // ---- 积分结算v2.2 mark by linjinyu at 20220427

    ;

    private Integer key;
    private String  desc;

    InvoiceApplyCustomerBackAccountStatusEnum(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 (InvoiceApplyCustomerBackAccountStatusEnum c : InvoiceApplyCustomerBackAccountStatusEnum.values()) {
            if (c.key.equals(key)) {
                return c.getDesc();
            }
        }
        return "未知状态";
    }

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

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

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