From 0f69561e397093b5165c4aac58530721d5c62178 Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期一, 25 十一月 2024 11:03:16 +0800 Subject: [PATCH] #led --- zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/timer/MotionTimer.java | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/timer/MotionTimer.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/timer/MotionTimer.java index 52193e6..d81e150 100644 --- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/timer/MotionTimer.java +++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/timer/MotionTimer.java @@ -1,5 +1,6 @@ package com.zy.asrs.wcs.core.timer; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.zy.asrs.framework.exception.CoolException; import com.zy.asrs.wcs.core.entity.Task; import com.zy.asrs.wcs.core.kernel.command.*; @@ -40,6 +41,8 @@ private LiftCommandService liftCommandService; @Autowired private ShuttleCommandService shuttleCommandService; + @Autowired + private MapCommandService mapCommandService; @Scheduled(cron = "0/1 * * * * ? ") public synchronized void executeTask() { @@ -51,7 +54,17 @@ if (executingMotion.getSync() == 1) {//褰撳墠鎵ц涓殑鍔ㄤ綔鏄悓姝ュ姩浣滐紝绛夊緟鎵ц瀹屾垚鍚庡啀鎵ц涓嬩竴涓姩浣� continue; } + + //寮傛鍔ㄤ綔锛屽彧鍏佽涓嬩竴鏉″姩浣滆鎵ц + Motion nextMotion = motionService.getOne(new LambdaQueryWrapper<Motion>().eq(Motion::getUuid, executingMotion.getUuid()).eq(Motion::getPriority, executingMotion.getPriority() - 1)); + if (nextMotion != null) { + if (!(nextMotion.getMotionSts() == MotionStsType.INIT.val() || nextMotion.getMotionSts() == MotionStsType.WAITING.val())) { + continue;//涓嬩竴鏉″姩浣滃凡缁忚鎵ц锛屼笉鍏佽鍐嶆墽琛屽悗缁姩浣� + } + } } + + Motion motion = motionService.selectOfTop1(task.getUuid(), MotionStsType.INIT.val(), task.getHostId()); if (null != motion) { @@ -316,6 +329,9 @@ case AGV: executeRes = agvCommandService.accept(motion); break; + case MAP: + executeRes = mapCommandService.accept(motion); + break; default: break; } @@ -351,6 +367,9 @@ case CONVEYOR: executeRes = conveyorCommandService.finish(motion); break; + case MAP: + executeRes = mapCommandService.finish(motion); + break; default: break; } -- Gitblit v1.9.1