From 8a830f3e5f9ff3bca3161b5bf800abeb1a64e866 Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期六, 22 六月 2024 16:30:35 +0800 Subject: [PATCH] # --- zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/ShuttleDispatcher.java | 24 +++++++++++++++++++++--- 1 files changed, 21 insertions(+), 3 deletions(-) diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/ShuttleDispatcher.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/ShuttleDispatcher.java index 85004c5..1ac081c 100644 --- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/ShuttleDispatcher.java +++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/ShuttleDispatcher.java @@ -20,6 +20,7 @@ import com.zy.asrs.wcs.rcs.model.enums.SlaveType; import com.zy.asrs.wcs.rcs.model.protocol.ShuttleProtocol; import com.zy.asrs.wcs.rcs.service.DeviceService; +import com.zy.asrs.wcs.rcs.thread.LiftThread; import com.zy.asrs.wcs.rcs.thread.ShuttleThread; import com.zy.asrs.wcs.system.entity.Dict; import com.zy.asrs.wcs.system.service.DictService; @@ -86,6 +87,21 @@ continue; } + BasShuttle basShuttle = basShuttleService.getOne(new LambdaQueryWrapper<BasShuttle>() + .eq(BasShuttle::getShuttleNo, device.getDeviceNo()) + .eq(BasShuttle::getHostId, device.getHostId())); + if (basShuttle == null) { + continue;//灏忚溅鍩虹鏁版嵁涓嶅瓨鍦� + } + + if (!Cools.isEmpty(basShuttle.getDisableLev())) { + List<Integer> disableLev = JSON.parseArray(basShuttle.getDisableLev(), Integer.class); + //妫�鏌ュ皬杞︽槸鍚︾鐢ㄨ妤煎眰 + if (disableLev.contains(Utils.getLev(locNo))) { + continue;//灏忚溅绂佺敤璇ユゼ灞傝烦杩囪杞� + } + } + //妫�娴嬫槸鍚﹀瓨鍦ㄥ厖鐢典换鍔� Task taskCharge = taskService.selectChargeWorking(Integer.valueOf(device.getDeviceNo())); if (taskCharge != null) { @@ -111,10 +127,12 @@ continue; } - Device recentTransferLift = Utils.getRecentTransferLift(locNo, Integer.parseInt(device.getDeviceNo())); - if (recentTransferLift == null) { + //鑾峰彇璺濈鐩爣浣嶇疆鏈�杩戠殑绌洪棽鍙崲灞傛彁鍗囨満 + LiftThread liftThread = liftDispatcher.searchIdleLift(locNo, task.getHostId(), true); + if (liftThread == null) { continue; } + Device recentTransferLift = liftThread.getDevice(); //鑾峰彇灏忚溅妤煎眰鎻愬崌鏈哄緟鏈轰綅 ShuttleStandby shuttleStandby = shuttleStandbyService.getOne(new LambdaQueryWrapper<ShuttleStandby>() @@ -143,7 +161,7 @@ } // 鎸傝浇浠诲姟鏉冮噸 - List<Task> tasks = taskService.selectWorkingByShuttle(Integer.valueOf(device.getDeviceNo())); + List<Task> tasks = taskService.selectWorkingByShuttle(Integer.valueOf(device.getDeviceNo()), null); if (!Cools.isEmpty(tasks)) { currDistance += tasks.size() * WEIGHT; } -- Gitblit v1.9.1