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

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

/**
 * @Description: // 寄票状态:0-未寄票;1-已寄票
 * @Author: linjinyu
 * @CreateDate: 2021/5/26 下午7:08
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021/5/26 下午7:08
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum InvoiceApplySupplierMailTickStatusEnum {



	// 未寄票(0, "未寄票"),
	// 已寄票(1, "已寄票"),
	未邮寄(0, "未邮寄"),
	已邮寄(1, "已邮寄"),
	;

	private Integer key;
	private String  desc;

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

		return "未知状态";
	}

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

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

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