package com.fjhx.sale.enums;

import org.apache.commons.collections4.MapUtils;

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

/**
 * 服务合同状态
 */
public enum ServiceContractEnum {
    UNDER_REVIEW("10", "审批中"),
    REJECT("20", "驳回"),
    PASS("30","通过"),
    CANCEL("999","作废"),
    ;
    private String key;

    private String value;

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

    ServiceContractEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    /**
     * 获取枚举map
     *
     * @return
     */
    public static Map<String, String> getMap() {
        if (MapUtils.isNotEmpty(map)) {
            return map;
        }
        for (ServiceContractEnum ms : values()) {
            map.put(ms.key, ms.value);
        }
        return map;
    }

    public String getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }
}
