#
Junjie
2024-04-13 a1d108d95ac087c16557a11c58098cf76d967cb2
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/protocol/ShuttleProtocol.java
@@ -168,6 +168,11 @@
    private Device device;
    /**
     * 扩展字段
     */
    private Object extend;
    /**
     * 设置小车状态
     */
    public void setProtocolStatus(Integer status) {
@@ -200,28 +205,6 @@
            return status.getName();
        }
        return "";
    }
    /**
     * 获取小车空闲状态
     */
    public Boolean getIdle() {
        if (this.deviceStatus == null) {
            return false;
        }
        ShuttleDeviceStatusService shuttleDeviceStatusService = SpringUtils.getBean(ShuttleDeviceStatusService.class);
        ShuttleDeviceStatus status = shuttleDeviceStatusService.getOne(new LambdaQueryWrapper<ShuttleDeviceStatus>()
                .eq(ShuttleDeviceStatus::getHostId, this.device.getHostId())
                .eq(ShuttleDeviceStatus::getDevicePlc, this.device.getDevicePlc())
                .eq(ShuttleDeviceStatus::getStatus, 1)
                .eq(ShuttleDeviceStatus::getDeviceStatus, this.deviceStatus));
        if (status != null) {
            if (status.getFlag() != null && status.getFlag().equals(String.valueOf(ShuttleDeviceStatusType.IDLE))) {
                return true;//空闲中
            }
        }
        return false;//默认不空闲
    }
    public Integer getTaskNo() {
@@ -263,25 +246,6 @@
        }
        return currentLoc.getLocNo();
    }
    // 是否处于空闲待命状态
    public Boolean isIdle() {
        if (this.deviceStatus == null
                || this.pakMk == null
                || this.errorCode == null
                || this.protocolStatus == null
        ) {
            return false;
        }
        boolean res = this.deviceStatus.equals(ShuttleDeviceStatusType.IDLE)
                && this.pakMk
                && !this.errorCode.equals("0")
                && this.getTaskNo() == 0
                && this.protocolStatus.intValue() == ShuttleProtocolStatusType.IDLE.id
                ;
        return res;
    }
}