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

import org.apache.commons.collections4.MapUtils;

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

/**
 * 退货明细状态枚举
 */
public enum SalesReturnDetailStatusEnum {
    STATUS_10(10, "审批中"),
    STATUS_15(15, "驳回"),
    STATUS_20(20,"待退货"),
    STATUS_30(30,"部分退货"),
    STATUS_40(40,"已退货"),

    STATUS_50(50,"结束"),
    ;
    private int key;

    private String value;

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

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

    public int getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

}
