#
zjj
2025-04-08 3df03c486fde77ab36b9298a94bdbb0aa065a7e2
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
package com.zy.asrs.wcs.core.model.enums;
 
/**
 * 四向穿梭车运行方向
 */
public enum ShuttleRunDirection {
 
    TOP((short)2, "货物方向-"),
    BOTTOM((short)1, "货物方向+"),
    LEFT((short)3, "过道方向-"),
    RIGHT((short)4, "过道方向+"),
    ;
 
    public Short id;
    public String desc;
 
    ShuttleRunDirection(Short id, String desc) {
        this.id = id;
        this.desc = desc;
    }
 
    public static ShuttleRunDirection get(String direction) {
        if (null == direction) {
            return null;
        }
        if (direction.equals("top")) {
            return TOP;
        } else if (direction.equals("bottom")) {
            return BOTTOM;
        } else if (direction.equals("left")) {
            return LEFT;
        } else if (direction.equals("right")) {
            return RIGHT;
        }else {
            return null;
        }
    }
 
    public static ShuttleRunDirection get(Short id) {
        if (null == id) {
            return null;
        }
        for (ShuttleRunDirection type : ShuttleRunDirection.values()) {
            if (type.id.equals(id.shortValue())) {
                return type;
            }
        }
        return null;
    }
 
    public static ShuttleRunDirection get(ShuttleRunDirection type) {
        if (null == type) {
            return null;
        }
        for (ShuttleRunDirection shuttleRunDirection : ShuttleRunDirection.values()) {
            if (shuttleRunDirection == type) {
                return shuttleRunDirection;
            }
        }
        return null;
    }
 
}