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


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

/**
 * @Description: 发票申请审核部分-审核状态 1-未审核;2-已同意;3-已拒绝;
 * @Author: linjinyu
 * @CreateDate: 7/30/20 4:30 PM
 * @UpdateUser: linjinyu
 * @UpdateDate: 7/30/20 4:30 PM
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum InvoiceApplyAuditStatusEnum {

	未审核(1, "未审核"),
	同意(2, "同意"),
	拒绝(3, "拒绝");

	private Integer key;
	private String  desc;

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

		return "未知状态";
	}

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

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

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