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 GongDanOrderTypeEnum {
    ONE(1,"已保存工单"),
    TWO(2,"待分部派工"),
    A(3,"待分中心派工"),
    B(4,"待网点派工"),
    C(5,"待审批改派"),
    D(6,"待服务人员处理"),
    E(7,"服务人员报完工"),
    F(8,"申请售后处理"),
    G(9,"已作废工单"),
    H(10,"已关闭工单"),
    J(99,"非广佛作废"),
    ;
    @JsonValue
    @EnumValue
    private Integer key;
    private String value;

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