自动化立体仓库 - WCS系统
#
luxiaotao1123
2022-08-25 9ee93c74e0de265b8a55454c621147b036fb0930
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
package com.zy.core.enums;
 
public enum SteStatusType {
 
    IDLE(0, "空闲"),
    MOVING(1, "作业中"),
    SOS(2, "报警"),
    OFF_LINE(-1, "未知"),
    ;
 
    public Integer id;
    public String desc;
    SteStatusType(Integer id, String desc) {
        this.id = id;
        this.desc = desc;
    }
 
    public static SteStatusType get(Short id) {
        if (null == id) {
            return null;
        }
        for (SteStatusType type : SteStatusType.values()) {
            if (type.id.equals(id.intValue())) {
                return type;
            }
        }
        return null;
    }
 
    public static SteStatusType get(SteStatusType type) {
        if (null == type) {
            return null;
        }
        for (SteStatusType crnStatusType : SteStatusType.values()) {
            if (crnStatusType == type) {
                return crnStatusType;
            }
        }
        return null;
    }
}