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

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

/**
 * @Description: 积分结算2.1 整改 TODO 兼容 客户结算
 * 原则 原先的key不变
 * @Author: linjinyu
 * @CreateDate: 2022/3/2 上午11:25
 * @UpdateUser: linjinyu
 * @UpdateDate: 2022/3/2 上午11:25
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum InvoiceApplyCustomerInvoiceProgressingStatusEnum {

	待开票(0, "待开票"),

//	已开票(1, "已开票"),
	/****************************************** 积分结算2.2 20220424 start ******************************************/

	已作废(2, "已作废"), // ---- 终点

	/****************************************** 积分结算2.2 20220424 start ******************************************/

//	已开票(11, "已开票"),
//	已收票(12, "已收票"),

	/****************************************** 积分结算2.1 20220302 start ******************************************/

//	开票中(10, "开票中"),
	待寄票(20, "待寄票"),
	待领票(30, "待领票"),
	待回款(40, "待回款"),
	已完成(99, "已完成"), // ---- 终点
	已红冲(98, "已红冲"), // ---- 终点

	/****************************************** 积分结算2.1 20220302   end ******************************************/
	;

	// 发票开票进度状态:0-待开票(原:未邮寄);1-已邮寄(弃用);2-已作废;10-开票中;11-已开票;

	private Integer key;
	private String  desc;

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

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

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

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