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


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

/**
 * @Description: 回款状态 是否回款 0-未回款;1-已回款;
 * 作为最小单位,只有 0-未回款;1-已回款; 不存在部分回款
 * @link InvoiceApplyCustomerBackAccountStatusEnum
 * @Author: linjinyu
 * @CreateDate: 7/30/20 8:52 PM
 * @UpdateUser: linjinyu
 * @UpdateDate: 7/30/20 8:52 PM
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Deprecated
public enum UnifiedOrderCreditBackAccountStatusEnum {

    未回款(0, "未回款"),
    已回款(1, "已回款"),
    ;

    private Integer key;
    private String  desc;

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

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

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

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