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


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

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

	待付款(0, "待付款"),
	已付款(1, "已付款"),
	;

	private Integer key;
	private String  desc;

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

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

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

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