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 IntelligentDispatchStatusEnum {

    NEW(1, "新建"),
    PENDING(2, "待调度"),
    DISPATCH(3, "调度中"),
    FINISH(4, "调度完成"),
    ;

    public static final String NAME = "INTELLIGENT_DISPATCH_STATUS";
    private static Map<Integer, IntelligentDispatchStatusEnum> enumMap = Maps.newHashMap();
    private Integer code;
    private String desc;

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

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

}
