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

import org.apache.commons.collections4.MapUtils;

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

/**
 * 采购状态枚举
 */
public enum PurchaseDetailStatusEnum {
    UNDER_REVIEW(10, "审批中"),
    REJECT(20, "驳回"),
    PASS(30,"通过"),
    ;
    private int key;

    private String value;

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

    PurchaseDetailStatusEnum(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 (PurchaseDetailStatusEnum ms : values()) {
            map.put(ms.key, ms.value);
        }
        return map;
    }

    public int getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

}
