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 JiaXianOrderTypeEnum {
    ONE(1,"已提交"),
    TWO(2,"待发货"),
    THREE(3,"已发货"),
    FOR(4,"已签收"),
    FIVE(5,"已退货"),


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

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