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


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

/**
 * @Description: 核销状态1-完成;4-取消;
 * @Author: linjinyu
 * @CreateDate: 7/31/20 11:45 AM
 * @UpdateUser: linjinyu
 * @UpdateDate: 7/31/20 11:45 AM
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum InvoiceBankOffHxStatusEnum {


	完成(1, "完成"),
	取消(4, "取消");

	private Integer key;
	private String  desc;

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

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

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

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