package com.prolog.rdc.tms.constant.enums.intelligent;

import com.google.common.collect.Maps;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;

/**
 * 智能调度阶段枚举
 * @author hongbo.pan
 * @date 2023/8/23
 */
@AllArgsConstructor
@Getter
public enum IntelligentDispatchStageEnum {

    NOT_START(0, "未开始"),
    PRETREATMENT(1, "订单车辆数据预处理"),
    INIT(2, "运单车辆匹配初始化阶段"),
    PLAN(3, "车辆路线规划阶段"),
    FINISH(4, "车辆/运单排线已完成"),
    ;

    private static Map<Integer, IntelligentDispatchStageEnum> enumMap = Maps.newHashMap();
    private Integer code;
    private String desc;

    static {
        for(IntelligentDispatchStageEnum as : IntelligentDispatchStageEnum.values()) {
            enumMap.put(as.code, as);
        }
    }

    public static IntelligentDispatchStageEnum getByCode(Integer code) {
        return  enumMap.get(code);
    }

}
