#
Junjie
2024-04-30 f09b972bb7adf8d4fd75fcb87c85973e493432a8
#
6个文件已修改
102 ■■■■ 已修改文件
zy-asrs-flow/src/pages/device/shuttle/index.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/action/ShuttleAction.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/ShuttleCommandService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/ShuttleThread.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyShuttleThread.java 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/device/shuttle/index.jsx
@@ -239,6 +239,11 @@
                        label: '是否有托盘',
                        children: item.hasPallet ? 'Y' : 'N',
                    },
                    {
                        key: '13',
                        label: '自动',
                        children: item.mode ? 'Y' : 'N',
                    }
                ];
                return <div key={item.id} style={{ width: '45%' }}>
                    <div style={{ marginBottom: '10px' }}>
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/action/ShuttleAction.java
@@ -4,12 +4,14 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.zy.asrs.wcs.common.ExecuteSupport;
import com.zy.asrs.wcs.core.entity.Loc;
import com.zy.asrs.wcs.core.entity.Task;
import com.zy.asrs.wcs.core.model.NavigateNode;
import com.zy.asrs.wcs.core.model.command.ShuttleAssignCommand;
import com.zy.asrs.wcs.core.model.command.ShuttleCommand;
import com.zy.asrs.wcs.core.model.command.ShuttleRedisCommand;
import com.zy.asrs.wcs.core.model.enums.MotionCtgType;
import com.zy.asrs.wcs.core.model.enums.ShuttleCommandModeType;
import com.zy.asrs.wcs.core.model.enums.ShuttleTaskModeType;
import com.zy.asrs.wcs.core.service.BasShuttleService;
@@ -31,6 +33,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@Component
public class ShuttleAction {
@@ -109,16 +112,6 @@
        if (shuttleProtocol == null) {
            return false;
        }
        //判断设备是否空闲
        if (!shuttleThread.isDeviceIdle()) {
            return false;
        }
//        if (!shuttleThread.isIdle(() -> {
//            return shuttleProtocol.getTaskNo().equals(taskNo);
//        })) {
//            return false;
//        }
        //判断工作号是否相同
        if (!shuttleProtocol.getTaskNo().equals(taskNo)) {
@@ -222,6 +215,20 @@
        //取出命令
        ShuttleCommand command = commands.get(commandStep);
        Integer mode = command.getMode();
        //判断设备是否空闲
        if (!shuttleThread.isDeviceIdle(new ExecuteSupport() {
            @Override
            public Boolean judgement() {
                if (ShuttleCommandModeType.CHARGE_CLOSE.id.equals(mode)) {//关闭充电motion
                    return false;//不需要判断状态
                }
                return true;//需要判断状态
            }
        })) {
            return false;
        }
        // 下发命令
        if (!write(command, device)) {
            News.error("四向穿梭车命令下发失败,穿梭车号={},任务数据={}", shuttleProtocol.getShuttleNo(), JSON.toJSON(command));
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/ShuttleCommandService.java
@@ -73,9 +73,19 @@
        if (null == shuttleProtocol) {
            return false;
        }
        if (!shuttleThread.isIdle()) {//设备不空闲
        if (!shuttleThread.isIdle(new ExecuteSupport() {
            @Override
            public Boolean judgement() {
                if (Objects.equals(MotionCtgType.get(motion.getMotionCtgEl()), MotionCtgType.SHUTTLE_CHARGE_OFF)) {//非关闭充电motion,需要判断设备状态
                    return false;//不需要判断状态
                }
                return true;//需要判断状态
            }
        })) {//设备不空闲
            return false;
        }
        if (motionService.count(new LambdaQueryWrapper<Motion>()
                .eq(Motion::getDeviceCtg, DeviceCtgType.SHUTTLE.val())
                .eq(Motion::getDevice, motion.getDevice())
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/ShuttleThread.java
@@ -32,6 +32,8 @@
    boolean isDeviceIdle();//设备是否空闲
    boolean isDeviceIdle(ExecuteSupport support);//设备是否空闲
    boolean isRequireCharge();//是否满足充电状态
    boolean isCharging();//是否充电中
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyShuttleThread.java
@@ -406,8 +406,8 @@
    @Override
    public boolean reset(ShuttleCommand command) {
        this.shuttleProtocol.setTaskNo(0);
        this.shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.IDLE);
        setSyncTaskNo(0);
        setProtocolStatus(ShuttleProtocolStatusType.IDLE);
        return true;
    }
@@ -419,10 +419,12 @@
    @Override
    public boolean isIdle(ExecuteSupport support) {
        if (null != support) {
            if (!support.judgement()) {
                return false;
            Boolean judgement = support.judgement();
            if (judgement != null && !judgement) {
                return true;
            }
        }
        if (this.shuttleProtocol.getDeviceStatus() == null
                || this.shuttleProtocol.getPakMk() == null
                || this.shuttleProtocol.getErrorCode() == null
@@ -439,14 +441,27 @@
                && this.shuttleProtocol.getMode() == 1
                && this.shuttleProtocol.getPakMk()
                && this.shuttleProtocol.getErrorCode().equals("0")
                && (this.shuttleProtocol.getProtocolStatus() == ShuttleProtocolStatusType.IDLE.id || this.shuttleProtocol.getProtocolStatus() == ShuttleProtocolStatusType.WAITING.id)
                && extend.getSuspendState() == 0
                ;
                && (this.shuttleProtocol.getProtocolStatus() == ShuttleProtocolStatusType.IDLE.id
                || this.shuttleProtocol.getProtocolStatus() == ShuttleProtocolStatusType.WAITING.id
                || this.shuttleProtocol.getProtocolStatus() == ShuttleProtocolStatusType.CHARGING_WAITING.id)
                && extend.getSuspendState() == 0;
        return res;
    }
    @Override
    public boolean isDeviceIdle() {
        return isDeviceIdle(null);
    }
    @Override
    public boolean isDeviceIdle(ExecuteSupport support) {
        if (null != support) {
            Boolean judgement = support.judgement();
            if (judgement != null && !judgement) {
                return true;
            }
        }
        if (this.shuttleProtocol.getDeviceStatus() == null
                || this.shuttleProtocol.getPakMk() == null
                || this.shuttleProtocol.getErrorCode() == null
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java
@@ -403,8 +403,8 @@
    @Override
    public synchronized boolean reset(ShuttleCommand command) {
        this.shuttleProtocol.setTaskNo(0);
        this.shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.IDLE);
        setSyncTaskNo(0);
        setProtocolStatus(ShuttleProtocolStatusType.IDLE);
        return true;
    }
@@ -416,10 +416,12 @@
    @Override
    public boolean isIdle(ExecuteSupport support) {
        if (null != support) {
            if (!support.judgement()) {
                return false;
            Boolean judgement = support.judgement();
            if (judgement != null && !judgement) {
                return true;
            }
        }
        if (this.shuttleProtocol.getDeviceStatus() == null
                || this.shuttleProtocol.getPakMk() == null
                || this.shuttleProtocol.getErrorCode() == null
@@ -431,13 +433,26 @@
        boolean res = (this.shuttleProtocol.getDeviceStatus() == 3 || this.shuttleProtocol.getDeviceStatus() == 11)
                && this.shuttleProtocol.getPakMk()
                && this.shuttleProtocol.getErrorCode().equals("0")
                && (this.shuttleProtocol.getProtocolStatus() == ShuttleProtocolStatusType.IDLE.id || this.shuttleProtocol.getProtocolStatus() == ShuttleProtocolStatusType.WAITING.id)
                ;
                && (this.shuttleProtocol.getProtocolStatus() == ShuttleProtocolStatusType.IDLE.id
                || this.shuttleProtocol.getProtocolStatus() == ShuttleProtocolStatusType.WAITING.id
                || this.shuttleProtocol.getProtocolStatus() == ShuttleProtocolStatusType.CHARGING_WAITING.id);
        return res;
    }
    @Override
    public boolean isDeviceIdle() {
        return isDeviceIdle(null);
    }
    @Override
    public boolean isDeviceIdle(ExecuteSupport support) {
        if (null != support) {
            Boolean judgement = support.judgement();
            if (judgement != null && !judgement) {
                return true;
            }
        }
        if (this.shuttleProtocol.getDeviceStatus() == null
                || this.shuttleProtocol.getPakMk() == null
                || this.shuttleProtocol.getErrorCode() == null