package com.zy.asrs.domain.enums;
|
|
|
import com.zy.core.enums.DevpType.DevpStateType;
|
import com.zy.core.enums.DevpType.DevpWorkType;
|
import com.zy.core.model.protocol.StaProtocol;
|
|
/**
|
* 站点状态枚举
|
*/
|
public enum SiteStatusType {
|
|
// 自动
|
SITE_AUTO,
|
// 非自动
|
SITE_UNAUTO,
|
// 自动+有物+ID
|
SITE_AUTO_RUN_ID,
|
// 自动+有物
|
SITE_AUTO_RUN,
|
// 自动+ID
|
SITE_AUTO_ID,
|
|
;
|
|
public static SiteStatusType process(StaProtocol staProtocol){
|
if (staProtocol == null) {
|
return null;
|
}
|
if (staProtocol.stateType == DevpStateType.AUTO && staProtocol.workType == DevpWorkType.BUSY && staProtocol.getWorkNo() > 0) {
|
return SITE_AUTO_RUN_ID;
|
}
|
if (staProtocol.stateType == DevpStateType.AUTO && staProtocol.workType == DevpWorkType.BUSY) {
|
return SITE_AUTO_RUN;
|
}
|
if (staProtocol.stateType == DevpStateType.AUTO && staProtocol.getWorkNo() > 0) {
|
return SITE_AUTO_ID;
|
}
|
if (staProtocol.stateType == DevpStateType.AUTO) {
|
return SITE_AUTO;
|
}
|
if (staProtocol.stateType != DevpStateType.AUTO) {
|
return SITE_UNAUTO;
|
}
|
return null;
|
}
|
|
}
|