吉安感知网项目-后端
xiebin
2026-01-06 d207a86cdf1ab52ef8cb7cd83bad8fceab8038cf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package org.sxkj.common.enums;
 
import com.fasterxml.jackson.annotation.JsonValue;
 
import java.util.Arrays;
import java.util.List;
 
/**
 * 工单类型枚举
 */
 public enum WorkOrderTypeEnum {
 
    /**
     * 无人机工单
     */
    DRONE_ORDER("0", "无人机工单"),
 
    /**
     * 人工工单
     */
    MANUAL_ORDER("1", "人工工单"),
 
    /**
     * AI识别分析
     */
    AI_ANALYSIS("2", "AI识别分析"),
    /**
     * 变化检测工单
     */
    CHANGE_DETECTION_ORDER("3", "变化检测");
 
     private final String code;
 
     private final String description;
 
    WorkOrderTypeEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }
 
    @JsonValue
    public String getCode() {
        return code;
    }
 
    public String getDescription() {
        return description;
    }
 
    /**
     * 根据编码获取枚举值
     *
     * @param code 编码
     * @return 枚举值
     */
    public static WorkOrderTypeEnum getByCode(String code) {
        for (WorkOrderTypeEnum type : values()) {
            if (type.code.equals(code)) {
                return type;
            }
        }
        return null;
    }
 
    /**
     * 获取 0,2,3工单类型编码列表
     *
     * @return 工单类型编码列表
     */
    public static List<String> getOrderTypeList() {
        return Arrays.asList("0", "2", "3");
    }
 
 
    /**
     * 验证工单类型编码是否有效
     *
     * @param code 工单类型编码
     * @return 是否有效
     */
    public static boolean isValidCode(String code) {
        return getByCode(code) != null;
    }
}