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 JiaXianOrderDetailTypeEnum {
    ONE("PICKING_UP_ORDER","前置仓提货订单"),
    TWO("SALE_ORDER","销售订单"),
    THREE("MERCHANT_WAREHOUSE_ORDER","商家仓订单"),
    FOR("PROJECT_ORDER","工程机订单"),
    FIVE("SALE_RETURN_ORDER","销售退货单"),


    ;
    @JsonValue
    @EnumValue
    private String key;
    private String value;

    JiaXianOrderDetailTypeEnum(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(JiaXianOrderDetailTypeEnum.class, "value");
            return enumMap.get(examineStatus).toString();
        }
        return "";
    }
}
