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

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

/**
 * @Description: 定义: 特指发票接收问题
 * 领票状态:0-未领票;1-已领票
 * @Author: linjinyu
 * @CreateDate: 2021/5/26 下午7:08
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021/5/26 下午7:08
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum InvoiceApplyCustomerReceiveInvoiceStatusEnum {

	未领票(0, "未领票"),
	已领票(1, "已领票"),
	;

	private Integer key;
	private String  desc;

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

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

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

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