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

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


/**
 * @Description: 开票进程(进度 | 流程节点)状态
 * 0-未申请;1-待开票;2-已作废;20-待寄票;30-待收票;40-待付款;99-已完成;
 * @Author: linjinyu
 * @CreateDate: 2021/12/9 上午11:32
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021/12/9 上午11:32
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum InvoiceApplySupplierInvoiceProgressingStatusEnum {

	未申请(0, "未申请"),// 还没有申请时 还是对账单时
	待开票(1, "待开票"),

	已作废(2, "已作废"),

	待寄票(20, "待寄票"),
	待收票(30, "待收票"),
	待付款(40, "待付款"),
	已完成(99, "已完成"),
	;

	private Integer key;
	private String  desc;

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

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

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

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