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

import org.apache.commons.collections4.MapUtils;

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

/**
 * 到货质检状态枚举
 * 质检状态 0未质检 10部分质检 20全部质检
 */
public enum ArrivalDetailStatusEnum {
    STATUS_0(0, "未质检"),
    STATUS_10(10, "部分质检"),
    STATUS_20(20, "全部质检"),
    ;
    private int key;

    private String value;

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

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

    public int getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

}
