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

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

/**
 * @Description: 对账单 对账状态 审核向
 * 3-待提交;0-未确认;1-已确认;2-已拒绝;-1-已取消;
 * @Author: linjinyu
 * @CreateDate: 7/10/20 3:47 PM
 * @UpdateUser: linjinyu
 * @UpdateDate: 7/10/20 3:47 PM
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum AccountingOrderSupplierAccountingStatusEnum {

	待提交(3, "待提交"),
	未确认(0, "未确认"),
	已确认(1, "已确认"),
	已拒绝(2, "已拒绝"),
	已取消(-1, "已取消"),
	;

	private Integer key;
	private String  desc;

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

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

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

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

}
