自动化立体仓库 - WCS系统
#
luxiaotao1123
2022-09-20 0f78d17f6bc34d2864b2822b455a275f3b5fa81d
src/main/java/com/zy/core/model/protocol/SteProtocol.java
@@ -1,5 +1,6 @@
package com.zy.core.model.protocol;
import com.core.common.Cools;
import com.zy.asrs.entity.BasSte;
import com.zy.core.enums.SteHisTaskStatusType;
import com.zy.core.enums.SteLocaType;
@@ -36,7 +37,7 @@
    /**
     * 任务号
     */
    public Integer taskNo = 0;
    public Short taskNo = 0;
    /**
     * 正在执行任务
@@ -217,12 +218,35 @@
     */
    private String lastIo = "I";
    private String pakMk = "-";
    public BasSte toSqlModel(BasSte basSte){
        if (alarm!=null) {
            basSte.setSteErr(alarm.longValue());
        }
        basSte.setWrkNo(taskNo);
        basSte.setWrkNo(taskNo.intValue());
        if (!Cools.isEmpty(row)) {
            basSte.setRow(row.intValue());
        }
        if (!Cools.isEmpty(bay)) {
            basSte.setBay(bay.intValue());
        }
        if (!Cools.isEmpty(lev)) {
            basSte.setLev(lev.intValue());
        }
        return basSte;
    }
    // 是否处于空闲待命状态
    public Boolean isIdle() {
        return this.statusType.equals(SteStatusType.IDLE)
                && this.pakMk.equals("N")
                && !isAlarm();
    }
    // 是否处于报警状态
    public Boolean isAlarm() {
        return this.alarm > 1;
    }
}