package com.fjhx.account.entity.account.enums;

import org.apache.commons.collections4.MapUtils;

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

//打款类型
public enum PaymentTypeEnum {
    UNDER_REVIEW("10", "请款"),
    REJECT("20", "采购付款"),
    RECEIVE("30", "退货到款登记"),
    ;
    private String key;

    private String value;

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

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

    public String getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }
}
