package com.zfire.mall.manager.enums;

import cn.hutool.core.util.EnumUtil;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

import java.util.Map;

@Getter
public enum JiaXianCostOrderTypeEnum {
    ONE("TOB","商家机工程机类型"),
    TWO("ALL","所有类型"),
    THREE("TOC","销售订单类型"),
    ;
    @JsonValue
    @EnumValue
    private String key;
    private String value;

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

    public static String getMsg(String examineStatus) {
        if (StringUtils.isNotBlank(examineStatus)) {
            Map<String, Object> enumMap = EnumUtil.getNameFieldMap(JiaXianCostOrderTypeEnum.class, "value");
            return enumMap.get(examineStatus).toString();
        }
        return "";
    }
}
