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;
|
}
|
|
}
|