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

import org.apache.commons.collections4.MapUtils;

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

/**
 * 采购付款状态枚举
 */
public enum PayStatusEnum1 {
    DRAFT(0, "草稿"),
    UNDER_REVIEW(10, "审批中"),
    REJECT(20, "驳回"),
    PASS(30,"已采购"),
    TERMINATION(99,"终止"),
    ;
    private int key;

    private String value;

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

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

    public int getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

}
