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

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

/**
 * @Description: 审核状态 @link AccountingOrderAccountingStatusEnum
 * 产品(④支持账单状态下拉查询:账单状态:待确认、已确认、已取消) | 对账单(结算单)状态:-1-已取消;0-未确认(待确认);1-已确认;2-已拒绝;3-待提交;
 * @Author: linjinyu
 * @CreateDate: 2021/10/25 下午2:34
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021/10/25 下午2:34
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum CommonAuditStatusEnum {

	已取消(-1, "已取消"),
	待确认(0, "待确认"),
	已确认(1, "已确认"),
	;

	private Integer key;
	private String  desc;

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

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

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

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