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 GongDanPaiGongTypeEnum {
    ONE(0,"待接收"),
    TWO(1,"待签到"),
    A(2,"待采集"),
    B(3,"已采集"),
    C(4,"已完工"),
    D(5,"改约中"),
    E(6,"改派中"),
    ;
    @JsonValue
    @EnumValue
    private Integer key;
    private String value;

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