package com.fjhx.purchase.entity.subscribe.enums;

import org.apache.commons.collections4.MapUtils;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * 申购状态枚举
 */
public enum SubscribeDetailStatusEnum {
    UNDER_REVIEW(10, "审批中"),
    PAID_AMOUNT(15,"待采购"),
    LITT_PAID_AMOUNT(30,"部分采购"),
    PURCHASED(20,"已采购"),
    CENCELLATION(99,"已作废")
    ;
    private int key;

    private String value;

    private static Map<Integer, String> map = new LinkedHashMap<>();

    SubscribeDetailStatusEnum(int key, String value) {
        this.key = key;
        this.value = value;
    }

    /**
     * 获取枚举map
     *
     * @return
     */
    public static Map<Integer, String> getMap() {
        if (MapUtils.isNotEmpty(map)) {
            return map;
        }
        for (SubscribeDetailStatusEnum ms : values()) {
            map.put(ms.key, ms.value);
        }
        return map;
    }

    public int getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

}
