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

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

/**
 * @Description: 发票登记部分-开票状态 0-未开票;1-已开票;2-重新开票;
 * @Author: linjinyu
 * @CreateDate: 7/29/20 7:19 PM
 * @UpdateUser: linjinyu
 * @UpdateDate: 7/29/20 7:19 PM
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum InvoiceApplyCustomerMakeInvoiceStatusEnum {

	待开票(0, "待开票"),
	已开票(1, "已开票"),

	重新开票(2, "重新开票"),

	// 积分结算2.1 add 20220302


	开票中(10, "开票中"),


	;

	private Integer key;
	private String  desc;

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

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

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

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