#
Junjie
2025-08-02 48e796711a5cfbf6190f1e6d921848437acf0858
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -386,6 +386,13 @@
                return false;
            }
            //检测是否存在移动任务
            WrkMast moveWorking = wrkMastService.selectShuttleHasMoveWorking(wrkMast.getShuttleNo());
            if (moveWorking != null) {
                News.taskInfo(wrkMast.getWrkNo(), "{}任务,小车存在移动任务", wrkMast.getWrkNo());
                return false;
            }
            ShuttleAssignCommand assignCommand = new ShuttleAssignCommand();
            assignCommand.setShuttleNo(shuttleProtocol.getShuttleNo()); // 四向穿梭车编号
            assignCommand.setTaskMode(ShuttleTaskModeType.TRANSPORT.id);//小车移库任务
@@ -487,8 +494,22 @@
                return false;
            }
            if (shuttleProtocol.getCurrentLocNo() == null) {
                return false;
            }
            //判断小车是否到达货物库位
            if (!shuttleProtocol.getCurrentLocNo().equals(wrkMast.getSourceLocNo())) {
                //小车未到达取货位置
                shuttleDispatchUtils.dispatchShuttle(wrkMast.getWrkNo(), wrkMast.getSourceLocNo(), wrkMast.getShuttleNo());//调度小车到货物所在库位进行取货
                News.taskInfo(wrkMast.getWrkNo(), "{}任务,小车未到达取货位置", wrkMast.getWrkNo(), wrkMast.getSourceLocNo());
                return false;
            }
            //检测是否存在移动任务
            WrkMast moveWorking = wrkMastService.selectShuttleHasMoveWorking(wrkMast.getShuttleNo());
            if (moveWorking != null) {
                News.taskInfo(wrkMast.getWrkNo(), "{}任务,小车存在移动任务", wrkMast.getWrkNo());
                return false;
            }
@@ -506,9 +527,10 @@
            assignCommand.setTaskMode(ShuttleTaskModeType.TRANSPORT.id);//小车移库任务
            assignCommand.setTaskNo(wrkMast.getWrkNo());//任务号
            assignCommand.setAuto(true);//自动模式
            assignCommand.setLocNo(wrkMast.getLocNo());
            //获取小车到输送站点行走命令
            List<ShuttleCommand> commands = shuttleOperaUtils.getStartToTargetCommands(wrkMast.getSourceLocNo(), wrkMast.getLocNo(), NavigationMapType.getDfxWithDevice(), assignCommand, shuttleThread);
            List<ShuttleCommand> commands = shuttleOperaUtils.getStartToTargetCommands(wrkMast.getSourceLocNo(), wrkMast.getLocNo(), NavigationMapType.getMapTypes(NavigationMapType.DFX), assignCommand, shuttleThread);
            if (commands == null) {
                News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}小车,路径计算失败", wrkMast.getWrkNo(), shuttleProtocol.getShuttleNo());
                return false;
@@ -1070,6 +1092,16 @@
                //判断当前小车是否满足需要充电要求
                if (!shuttleThread.isRequireCharge()) {
                    continue;
                }
                WrkMast wrkMast1 = wrkMastService.selectShuttleWorking(shuttleProtocol.getShuttleNo());
                if (wrkMast1 != null) {
                    continue;
                }
                WrkMast wrkMast2 = wrkMastService.selectShuttleHasMoveWorking(shuttleProtocol.getShuttleNo());
                if (wrkMast2 != null) {
                    continue;
                }
@@ -1807,7 +1839,7 @@
            assignCommand.setLocNo(wrkMast.getLocNo());//目标库位
            //获取小车到目标库位命令
            List<ShuttleCommand> commands = shuttleOperaUtils.getStartToTargetCommands(shuttleProtocol.getCurrentLocNo(), wrkMast.getLocNo(), NavigationMapType.getNormalWithDevice(), assignCommand, shuttleThread);
            List<ShuttleCommand> commands = shuttleOperaUtils.getStartToTargetCommands(shuttleProtocol.getCurrentLocNo(), wrkMast.getLocNo(), NavigationMapType.getMapTypes(NavigationMapType.NORMAL), assignCommand, shuttleThread);
            if (commands == null) {
                News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}小车,路径计算失败", wrkMast.getWrkNo(), shuttleProtocol.getShuttleNo());
                return false;//路径计算失败