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

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 InvoiceApplySupplierReceiveInvoiceStatusEnum {

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

	private Integer key;
	private String  desc;

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

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

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

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