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

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

/**
 * @Description: 是否付款_付款状态:0-待付款;1-部分付款;2-已付款;69-红冲发票;
 * 付款登记部分-付款状态:0-待付款;1-部分付款;10-付款中;2-已付款;67-蓝冲发票;69-红冲发票;
 * @Author: linjinyu
 * @CreateDate: 7/30/20 4:52 PM
 * @UpdateUser: linjinyu
 * @UpdateDate: 7/30/20 4:52 PM
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum InvoiceApplySupplierPayOffAccountStatusEnum {


	待付款(0, "待付款"),// 呵呵!!，一时叫未付款，一时叫待付款，玩呀？[狗头]
	付款中(10, "付款中"),// 对映而已 如果过程能监控时用 例如对接OA
	部分付款(1, "部分付款"),
	已付款(2, "已付款"),

	/****************************************** 逻辑没想清 start ******************************************/

	蓝冲发票(67, "蓝冲发票"),
	红冲发票(69, "红冲发票"),

	/****************************************** 逻辑没想清   end ******************************************/
	;

	private Integer key;
	private String  desc;

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

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

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

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