package com.zfire.mall.manager.enums;

import cn.hutool.core.util.EnumUtil;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

import java.util.Map;

@Getter
public enum OrderTypeStatusEnum {
    TRADE("商用"),
    HOME("家用"),
    RETAIL("零售"),
    RETAIL_POLICY("政策"),
    PERMU_HOME("置换家用"),
    PERMU_TRADE("置换商用"),
    PERMU_RETAIL("置换零售"),
    PERMU_RETAIL_POLICY("置换政策"),
    REQUISITION_RETAIL ("调拨零售"),
    REQUISITION_RETAIL_POLICY ("调拨政策"),
    REQUISITION_TRADE ("调拨商用"),
    REQUISITION_HOME  ("调拨家用");

    private String msg;

    OrderTypeStatusEnum(String msg){
        this.msg=msg;
    }

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