自动化立体仓库 - WCS系统
#
Junjie
2023-09-20 fb8419ef141e16b8ec8b1d9802fa0d5a46768794
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
package com.zy.core.enums;
 
/**
 * 提升机楼层与实际楼层数值转换
 */
public enum LiftLevType {
 
    ONE(1, (short) 1),
    TWO(2, (short) 2),
    THREE(3, (short) 4),
    FOUR(4, (short) 8),
    FIVE(5, (short) 16),
    ;
 
    public Integer lev;
    public Short realLev;
 
    LiftLevType(Integer lev, Short realLev) {
        this.lev = lev;
        this.realLev = realLev;
    }
 
    public static LiftLevType get(Integer lev) {
        if (null == lev) {
            return null;
        }
        for (LiftLevType type : LiftLevType.values()) {
            if (type.lev.equals(lev)) {
                return type;
            }
        }
        return null;
    }
 
    public static LiftLevType get(LiftLevType type) {
        if (null == type) {
            return null;
        }
        for (LiftLevType type2 : LiftLevType.values()) {
            if (type2 == type) {
                return type2;
            }
        }
        return null;
    }
 
    public static Short getRealLev(Integer lev) {
        if (null == lev) {
            return null;
        }
        for (LiftLevType type : LiftLevType.values()) {
            if (type.lev.equals(lev)) {
                return type.realLev;
            }
        }
        return null;
    }
 
    public static Integer getLev(Short realLev) {
        if (null == realLev) {
            return null;
        }
        for (LiftLevType type : LiftLevType.values()) {
            if (type.realLev.equals(realLev)) {
                return type.lev;
            }
        }
        return null;
    }
 
}