自动化立体仓库 - WCS系统
#
luxiaotao1123
2020-08-14 84cffa40e13a64d8b91e393fd44e09c973d7ee99
src/main/java/com/zy/asrs/domain/enums/SiteStatusType.java
@@ -1,6 +1,8 @@
package com.zy.asrs.domain.enums;
import com.zy.core.model.protocol.StaProtocol;
/**
 * 站点状态枚举
 */
@@ -8,15 +10,37 @@
    // 自动
    SITE_AUTO,
    // 非自动/收到
    // 非自动
    SITE_UNAUTO,
    // 自动+有物+ID
    SITE_AUTO_RUN_ID,
    // 自动+有物
    SITE_AUTO_RUN,
    // 自动+有物+ID
    // 自动+ID
    SITE_AUTO_ID,
    ;
    public static SiteStatusType process(StaProtocol staProtocol){
        if (staProtocol == null) {
            return null;
        }
        if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.getWorkNo() > 0) {
            return SITE_AUTO_RUN_ID;
        }
        if (staProtocol.isAutoing() && staProtocol.isLoading()) {
            return SITE_AUTO_RUN;
        }
        if (staProtocol.isAutoing() && staProtocol.getWorkNo() > 0) {
            return SITE_AUTO_ID;
        }
        if (staProtocol.isAutoing()) {
            return SITE_AUTO;
        }
        if (!staProtocol.isAutoing()) {
            return SITE_UNAUTO;
        }
        return null;
    }
}