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


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

/**
 * @Description: 是否已回款 0-未回款;1-已回款; 对映 InvoiceApplySupplierItemPayOffStatusEnum
 * @Author: linjinyu
 * @CreateDate: 7/31/20 4:13 PM
 * @UpdateUser: linjinyu
 * @UpdateDate: 7/31/20 4:13 PM
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum InvoiceApplyCustomerItemBackStatusEnum {

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

	private Integer key;
	private String  desc;

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

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

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

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