package org.wcs.constant.enums.database;

import lombok.Getter;

@Getter
public enum ConveyTaskStatusEnum {
    CREATED(0, "创建"),
    PRINTED(1, "已打印"),
    RUNNING(2, "运行中"),
    ARRIVE(3, "已到达"),
    ERROR(4, "错误"),
    TIME_OUT(5, "超时"),
    CANCEL(6, "取消");

    private final Integer code;
    private final String msg;

    ConveyTaskStatusEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public static String getMsgByCode(Integer code) {
        for (ConveyTaskStatusEnum value : ConveyTaskStatusEnum.values()) {
            if (value.getCode().equals(code)) {
                return value.getMsg();
            }
        }
        return null;
    }
}
