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

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

/**
 * @Description: 对账单 关联的
 * 订单 商品 流水 共用
 * 对账状态 是否对账的问题
 * @Author: linjinyu
 * @CreateDate: 6/18/20 8:59 PM
 * @UpdateUser: linjinyu
 * @UpdateDate: 6/18/20 8:59 PM
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum CommonAccountingLockingEnum {


	正常(0, "正常"),
	锁定(1, "锁定"),
	;

	private Integer key;
	private String  desc;

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

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

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

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

}
