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

import org.apache.commons.collections4.MapUtils;

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

/**
 * 退款审批状态枚举
 */
public enum RefundStatusEnum {
    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<>();

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

    public int getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

}
