package cn.superdesk.uniorder.common.enums.thirdpart.szhtxx.electronicInvoice;

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

/**
 * @Description: 开票类型^_^开票类型(1-蓝票;2-红票;10-特殊冲红)
 * <p>
 * 开票类型^_^开票类型(1-正常发票;2-红冲发票;10-特殊冲红)
 * @Author: linjinyu
 * @CreateDate: 2022/3/11 下午4:13
 * @UpdateUser: linjinyu
 * @UpdateDate: 2022/3/11 下午4:13
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum SzhtxxElectronicInvoiceFptxxKplxEnum {

	正常发票(1, "正常发票"),
	红冲发票(2, "红冲发票"),
	特殊冲红(10, "特殊冲红"),
	;

	private Integer key;
	private String  desc;

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

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

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

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

}
