package cn.superdesk.uniorder.common.enums.accounting;

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

/**
 * @Description: 对账单 开票申请状态 0-未申请;1-全部申请;2-部分申请;
 * 同质?不是
 * UnifiedOrderInvoiceState 是订单
 * AccountingOrderInvoiceStatus 是 发票申请 对账单
 * @Author: linjinyu
 * @CreateDate: 6/23/20 5:38 PM
 * @UpdateUser: linjinyu
 * @UpdateDate: 6/23/20 5:38 PM
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum AccountingOrderInvoiceApplyStatusEnum {


	未申请(0, "未申请"),
	全部申请(1, "全部申请"),
	部分申请(2, "部分申请"),
	异(3, "异"),
	寡(99, "寡"),
	;

	private Integer key;
	private String  desc;

	AccountingOrderInvoiceApplyStatusEnum(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 (AccountingOrderInvoiceApplyStatusEnum c : AccountingOrderInvoiceApplyStatusEnum.values()) {
			if (c.key.equals(key)) {
				return c.getDesc();
			}
		}
		return null;
	}

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

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

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