自动化立体仓库 - WCS系统
whycq
2023-09-06 b143fe586d7be6c12ec162bf5aebb3a99bff7e32
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
package com.zy.asrs.domain.enums;
 
 
/**
 * 库位状态枚举
 */
public enum PackStatusType {
 
    // 空库位
    LOC_EMPTY("空库位"),
    // 在库待测
    LOC_WAIT_TESTINT("在库待测"),
    // 在库测试中
    LOC_TESTING("在库测试中"),
    // 在库静置中
    LOC_STAY("在库静置中"),
    // 静置完成
    LOC_STAY_OVER("静置完成"),
    // 异常
    LOC_ERROR("异常报警"),
    ;
 
    private String desc;
    PackStatusType(String desc){
        this.desc = desc;
    }
 
    public String getDesc() { return desc; }
 
    public void setDesc(String desc) { this.desc = desc; }
 
    public static PackStatusType process(String locSts, Integer packStatus, Integer fireStatus){
        if(fireStatus == 1){
            return LOC_ERROR;
        } else if (locSts.equals("F") || locSts.equals("R") || locSts.equals("D")){
            if (packStatus == 1 && locSts.equals("F")){
                return LOC_WAIT_TESTINT;//待测
            } else if (packStatus == 2){
                return LOC_TESTING;     //测试中
            } else if (packStatus == 3){
                return LOC_STAY;        //OK
            } else if (packStatus == 4){
                return LOC_STAY_OVER;   //NG
            }else {
                return LOC_EMPTY;       //
            }
        } else if (locSts.equals("O") || locSts.equals("S")){
            return LOC_EMPTY;
        }
        return null;
    }
 
}