From 1c6befe06b8a19dd5da1e34fc667d45be1597bb7 Mon Sep 17 00:00:00 2001 From: Junjie <540245094@qq.com> Date: 星期六, 19 七月 2025 18:31:33 +0800 Subject: [PATCH] # --- src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java | 40 ++++++++++++++++++++++++++++++++++++---- 1 files changed, 36 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java b/src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java index 9062069..a62c8e2 100644 --- a/src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java +++ b/src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java @@ -129,7 +129,7 @@ //褰撳墠绌挎杞﹀簱浣嶅彿 String currentLocNo = shuttleProtocol.getCurrentLocNo(); //褰撳墠绌挎杞︾嚎绋嬪埌鐩爣鍦扮偣璺濈 - List<NavigateNode> currentShuttlePath = navigateUtils.calc(currentLocNo, locNo, NavigationMapType.NORMAL.id, Utils.getShuttlePoints(shuttleNo, Utils.getLev(currentLocNo)), null);//鎼滅储绌洪棽绌挎杞︼紝浣跨敤姝e父閫氶亾鍦板浘 + List<NavigateNode> currentShuttlePath = navigateUtils.calc(currentLocNo, locNo, NavigationMapType.getMapTypes(NavigationMapType.NORMAL), Utils.getShuttlePoints(shuttleNo, Utils.getLev(currentLocNo)), null);//鎼滅储绌洪棽绌挎杞︼紝浣跨敤姝e父閫氶亾鍦板浘 if (currentShuttlePath == null) { continue; } @@ -174,7 +174,7 @@ int currentLev = Utils.getLev(currentLocNo); //鍒ゆ柇褰撳墠妤煎眰鏄惁鏈変换鍔★紝濡傛灉鏈夊垯涓嶅垎閰嶈繖杈嗚溅 List<WrkMast> wrkMasts1 = wrkMastService.selectWrkByLev(currentLev); - int shuttleCount = this.getShuttleCountByLev(currentLev);//鑾峰彇绌挎杞︽ゼ灞傝溅杈嗘暟閲� + int shuttleCount = this.getShuttleEnableUseCountByLev(currentLev);//鑾峰彇绌挎杞︽ゼ灞傝溅杈嗘暟閲� if (!wrkMasts1.isEmpty() && shuttleCount <= 1) { //瀛樺湪鍏朵粬浠诲姟涓斿彲鐢ㄥ皬杞︽暟閲忓皬浜庣瓑浜�1锛岃烦杩囪繖杈嗚溅 continue; @@ -498,7 +498,7 @@ String locNo = forkLiftStaProtocol.getLocNo();//绔欑偣搴撲綅鍙� //褰撳墠绌挎杞︾嚎绋嬪埌鐩爣鍦扮偣璺濈 - List<NavigateNode> currentShuttlePath = navigateUtils.calc(currentLocNo, locNo, NavigationMapType.NORMAL.id, Utils.getShuttlePoints(shuttleNo, Utils.getLev(currentLocNo)), null);//浣跨敤姝e父閫氶亾鍦板浘 + List<NavigateNode> currentShuttlePath = navigateUtils.calc(currentLocNo, locNo, NavigationMapType.getMapTypes(NavigationMapType.NORMAL), Utils.getShuttlePoints(shuttleNo, Utils.getLev(currentLocNo)), null);//浣跨敤姝e父閫氶亾鍦板浘 if (currentShuttlePath == null) { continue; } @@ -528,7 +528,7 @@ /** * 鑾峰彇妤煎眰鍙敤灏忚溅鏁伴噺 */ - public int getShuttleCountByLev(int lev) { + public int getShuttleEnableUseCountByLev(int lev) { List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() .eq("device_type", String.valueOf(SlaveType.Shuttle))); int count = 0; @@ -561,4 +561,36 @@ return count; } + /** + * 鑾峰彇妤煎眰灏忚溅鏁伴噺 + */ + public int getShuttleCountByLev(int lev) { + List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.Shuttle))); + int count = 0; + for (DeviceConfig device : shuttleList) { + //鑾峰彇鍥涘悜绌挎杞︾嚎绋� + ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getDeviceNo()); + if (shuttleThread == null) { + continue; + } + + ShuttleProtocol shuttleProtocol = shuttleThread.getStatus(); + if (shuttleProtocol == null || shuttleProtocol.getShuttleNo() == null) { + continue; + } + + if (shuttleProtocol.getCurrentLocNo() == null) { + continue; + } + + if (Utils.getLev(shuttleProtocol.getCurrentLocNo()) == lev) { + //鍚屼竴妤煎眰鍙敤灏忚溅 + count++; + continue; + } + } + return count; + } + } -- Gitblit v1.9.1