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

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

/**
 * @Description: 对账单 回款状态
 * @Author: linjinyu
 * @CreateDate: 6/18/20 9:02 PM
 * @UpdateUser: linjinyu
 * @UpdateDate: 6/18/20 9:02 PM
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum AccountingOrderBackAccountStatusEnum {


	未回款(0, "未回款"),
	部分回款(1, "部分回款"),
	全部回款(2, "全部回款"),
	;

	private Integer key;
	private String  desc;

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

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

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

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