wlzboy
2025-10-26 2c86a8bd60deed0dd0e044bad6fb83f75d19a332
ruoyi-system/src/main/java/com/ruoyi/system/domain/enums/TaskStatus.java
New file
@@ -0,0 +1,55 @@
package com.ruoyi.system.domain.enums;
/**
 * 任务状态枚举
 *
 * @author ruoyi
 */
public enum TaskStatus {
    /** 待处理 */
    PENDING("PENDING", "待处理"),
    /** 出发中 */
    DEPARTING("DEPARTING", "出发中"),
    /** 已到达 */
    ARRIVED("ARRIVED", "已到达"),
    /** 返程中 */
    RETURNING("RETURNING", "返程中"),
    /** 已完成 */
    COMPLETED("COMPLETED", "已完成"),
    /** 已取消 */
    CANCELLED("CANCELLED", "已取消"),
    /** 任务中 (兼容旧数据) */
    IN_PROGRESS("IN_PROGRESS", "任务中");
    private final String code;
    private final String info;
    TaskStatus(String code, String info) {
        this.code = code;
        this.info = info;
    }
    public String getCode() {
        return code;
    }
    public String getInfo() {
        return info;
    }
    public static TaskStatus getByCode(String code) {
        for (TaskStatus status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }
}