From 3dcc70402e27760de274dbc7d50a5f0726ce58cb Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期五, 18 四月 2025 14:41:49 +0800
Subject: [PATCH] #小车换层优化

---
 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/AnalyzeService.java |  244 +++++++++++++++++++++++++++---------------------
 1 files changed, 138 insertions(+), 106 deletions(-)

diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/AnalyzeService.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/AnalyzeService.java
index cc2ba2e..a9c96b6 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/AnalyzeService.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/AnalyzeService.java
@@ -1,14 +1,11 @@
 package com.zy.asrs.wcs.core.kernel;
 
-import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.zy.asrs.wcs.core.domain.dto.MotionDto;
 import com.zy.asrs.wcs.core.entity.*;
-import com.zy.asrs.wcs.core.model.NavigateNode;
 import com.zy.asrs.wcs.core.model.enums.*;
 import com.zy.asrs.wcs.core.service.*;
 import com.zy.asrs.wcs.core.utils.*;
-import com.zy.asrs.wcs.rcs.News;
 import com.zy.asrs.wcs.rcs.cache.SlaveConnection;
 import com.zy.asrs.wcs.rcs.entity.Device;
 import com.zy.asrs.wcs.rcs.model.enums.SlaveType;
@@ -260,14 +257,14 @@
                         MotionCtgType.SHUTTLE_MOVE
                 ));
 
-                // 閿佸畾鎹㈠眰璺緞
-                motionList.addAll(kernelService.mapLockPath(
-                        null,
-                        MotionDto.build((dto -> {
-                            dto.setShuttleNo(shuttleDevice.getId().intValue());
-                            dto.setLocNo(JSON.toJSONString(lockPath));
-                        }))
-                ));
+//                // 閿佸畾鎹㈠眰璺緞
+//                motionList.addAll(kernelService.mapLockPath(
+//                        null,
+//                        MotionDto.build((dto -> {
+//                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                            dto.setLocNo(JSON.toJSONString(lockPath));
+//                        }))
+//                ));
 
                 // 鎻愬崌鏈虹┖杞界Щ鍔ㄥ埌绌挎杞﹀眰
                 motionList.addAll(kernelService.liftMove(
@@ -362,14 +359,14 @@
                         }))
                 ));
 
-                // 瑙i攣鎹㈠眰璺緞
-                motionList.addAll(kernelService.mapUnlockPath(
-                        null,
-                        MotionDto.build((dto -> {
-                            dto.setShuttleNo(shuttleDevice.getId().intValue());
-                            dto.setLocNo(JSON.toJSONString(lockPath));
-                        }))
-                ));
+//                // 瑙i攣鎹㈠眰璺緞
+//                motionList.addAll(kernelService.mapUnlockPath(
+//                        null,
+//                        MotionDto.build((dto -> {
+//                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                            dto.setLocNo(JSON.toJSONString(lockPath));
+//                        }))
+//                ));
 
                 // 绌挎杞﹀叆搴撻《鍗�
                 motionList.addAll(kernelService.shuttleAction(
@@ -511,11 +508,11 @@
                 return motionList;
             }
 
-            //鍒嗘瀽鍑哄簱璺緞寰呮満搴撲綅
-            String lastPathStartLoc = shuttleDispatcher.analyzeOutPathWaitLoc(originLoc, standbyLocNoTo, shuttleDevice);
-            if (lastPathStartLoc == null) {
-                return motionList;//鏈垎鏋愭垚鍔�
-            }
+//            //鍒嗘瀽鍑哄簱璺緞寰呮満搴撲綅
+//            String lastPathStartLoc = shuttleDispatcher.analyzeOutPathWaitLoc(originLoc, standbyLocNoTo, shuttleDevice);
+//            if (lastPathStartLoc == null) {
+//                return motionList;//鏈垎鏋愭垚鍔�
+//            }
 
             /**
              * 鍑哄簱
@@ -548,27 +545,43 @@
                         MotionCtgType.SHUTTLE_PALLET_LIFT
                 ));
 
-                if (!originLoc.equals(lastPathStartLoc)) {
-                    // 绌挎杞﹁浇璐у嚭搴撹嚦鏈�鍚庝竴娈佃矾寰勭瓑寰�
-                    motionList.addAll(kernelService.shuttleMove(
-                            MotionDto.build((dto -> {
-                                dto.setShuttleNo(shuttleDevice.getId().intValue());
-                                dto.setLocNo(originLoc);
-                            })),
-                            MotionDto.build((dto -> {
-                                dto.setShuttleNo(shuttleDevice.getId().intValue());
-                                dto.setShuttleDevice(shuttleDevice);
-                                dto.setLocNo(lastPathStartLoc);
-                            })),
-                            MotionCtgType.SHUTTLE_TRANSPORT
-                    ));
-                }
+//                if (!originLoc.equals(lastPathStartLoc)) {
+//                    // 绌挎杞﹁浇璐у嚭搴撹嚦鏈�鍚庝竴娈佃矾寰勭瓑寰�
+//                    motionList.addAll(kernelService.shuttleMove(
+//                            MotionDto.build((dto -> {
+//                                dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                                dto.setLocNo(originLoc);
+//                            })),
+//                            MotionDto.build((dto -> {
+//                                dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                                dto.setShuttleDevice(shuttleDevice);
+//                                dto.setLocNo(lastPathStartLoc);
+//                            })),
+//                            MotionCtgType.SHUTTLE_TRANSPORT
+//                    ));
+//                }
+//
+//                // 绌挎杞﹁浇璐ц嚦鎻愬崌鏈哄緟鏈轰綅
+//                motionList.addAll(kernelService.shuttleMove(
+//                        MotionDto.build((dto -> {
+//                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                            dto.setLocNo(lastPathStartLoc);
+//                        })),
+//                        MotionDto.build((dto -> {
+//                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                            dto.setShuttleDevice(shuttleDevice);
+//                            dto.setLiftNo(transferLiftDevice.getId().intValue());
+//                            dto.setLocNo(standbyLocNoTo);
+//                            dto.setStaNo(getStaByLev(Utils.getLev(task.getOriginLoc())));//杈撻�佺珯
+//                        })),
+//                        MotionCtgType.SHUTTLE_TRANSPORT_TO_CONVEYOR
+//                ));
 
                 // 绌挎杞﹁浇璐ц嚦鎻愬崌鏈哄緟鏈轰綅
                 motionList.addAll(kernelService.shuttleMove(
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
-                            dto.setLocNo(lastPathStartLoc);
+                            dto.setLocNo(originLoc);
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
@@ -654,14 +667,14 @@
                         MotionCtgType.SHUTTLE_MOVE
                 ));
 
-                // 閿佸畾鎹㈠眰璺緞
-                motionList.addAll(kernelService.mapLockPath(
-                        null,
-                        MotionDto.build((dto -> {
-                            dto.setShuttleNo(shuttleDevice.getId().intValue());
-                            dto.setLocNo(JSON.toJSONString(lockPath));
-                        }))
-                ));
+//                // 閿佸畾鎹㈠眰璺緞
+//                motionList.addAll(kernelService.mapLockPath(
+//                        null,
+//                        MotionDto.build((dto -> {
+//                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                            dto.setLocNo(JSON.toJSONString(lockPath));
+//                        }))
+//                ));
 
                 // 鎻愬崌鏈虹┖杞界Щ鍔ㄥ埌绌挎杞﹀眰
                 motionList.addAll(kernelService.liftMove(
@@ -756,14 +769,14 @@
                         }))
                 ));
 
-                // 瑙i攣鎹㈠眰璺緞
-                motionList.addAll(kernelService.mapUnlockPath(
-                        null,
-                        MotionDto.build((dto -> {
-                            dto.setShuttleNo(shuttleDevice.getId().intValue());
-                            dto.setLocNo(JSON.toJSONString(lockPath));
-                        }))
-                ));
+//                // 瑙i攣鎹㈠眰璺緞
+//                motionList.addAll(kernelService.mapUnlockPath(
+//                        null,
+//                        MotionDto.build((dto -> {
+//                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                            dto.setLocNo(JSON.toJSONString(lockPath));
+//                        }))
+//                ));
 
                 // 绌挎杞︽彁鍗囨満寰呮満浣嶈嚦鍑哄簱搴撲綅
                 motionList.addAll(kernelService.shuttleMove(
@@ -789,27 +802,43 @@
                         MotionCtgType.SHUTTLE_PALLET_LIFT
                 ));
 
-                if (!originLoc.equals(lastPathStartLoc)) {
-                    // 绌挎杞﹁浇璐у嚭搴撹嚦鏈�鍚庝竴娈佃矾寰勭瓑寰�
-                    motionList.addAll(kernelService.shuttleMove(
-                            MotionDto.build((dto -> {
-                                dto.setShuttleNo(shuttleDevice.getId().intValue());
-                                dto.setLocNo(originLoc);
-                            })),
-                            MotionDto.build((dto -> {
-                                dto.setShuttleNo(shuttleDevice.getId().intValue());
-                                dto.setShuttleDevice(shuttleDevice);
-                                dto.setLocNo(lastPathStartLoc);
-                            })),
-                            MotionCtgType.SHUTTLE_TRANSPORT
-                    ));
-                }
+//                if (!originLoc.equals(lastPathStartLoc)) {
+//                    // 绌挎杞﹁浇璐у嚭搴撹嚦鏈�鍚庝竴娈佃矾寰勭瓑寰�
+//                    motionList.addAll(kernelService.shuttleMove(
+//                            MotionDto.build((dto -> {
+//                                dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                                dto.setLocNo(originLoc);
+//                            })),
+//                            MotionDto.build((dto -> {
+//                                dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                                dto.setShuttleDevice(shuttleDevice);
+//                                dto.setLocNo(lastPathStartLoc);
+//                            })),
+//                            MotionCtgType.SHUTTLE_TRANSPORT
+//                    ));
+//                }
+//
+//                // 绌挎杞﹁浇璐ц嚦鎻愬崌鏈哄緟鏈轰綅
+//                motionList.addAll(kernelService.shuttleMove(
+//                        MotionDto.build((dto -> {
+//                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                            dto.setLocNo(lastPathStartLoc);
+//                        })),
+//                        MotionDto.build((dto -> {
+//                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                            dto.setShuttleDevice(shuttleDevice);
+//                            dto.setLiftNo(transferLiftDevice.getId().intValue());
+//                            dto.setLocNo(standbyLocNoFrom);
+//                            dto.setStaNo(getStaByLev(Utils.getLev(task.getOriginLoc())));//杈撻�佺珯
+//                        })),
+//                        MotionCtgType.SHUTTLE_TRANSPORT_TO_CONVEYOR
+//                ));
 
                 // 绌挎杞﹁浇璐ц嚦鎻愬崌鏈哄緟鏈轰綅
                 motionList.addAll(kernelService.shuttleMove(
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
-                            dto.setLocNo(lastPathStartLoc);
+                            dto.setLocNo(originLoc);
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
@@ -1244,6 +1273,9 @@
             //绌挎杞﹀埌鎻愬崌鏈哄緟鏈轰綅搴撲綅鍙�
             String standbyLocNoTo = liftDispatcher.getLiftStandByLocNo(liftThread, Utils.getLev(shuttleLocNo));
 
+            //绌挎杞︽崲灞傛椂寰呮満浣嶇疆 浣跨敤琛ㄥ垪 memo鏁版嵁
+            String standbyLocNoMemo = liftDispatcher.getInLiftStandByLocNo(liftThread, Utils.getLev(shuttleLocNo));
+
             //绌挎杞﹀嚭鎻愬崌鏈哄緟鏈轰綅搴撲綅鍙�
             String standbyLocNoFrom = liftDispatcher.getLiftStandByLocNo(liftThread, Utils.getLev(task.getDestLoc()));
 
@@ -1261,19 +1293,19 @@
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
                         dto.setShuttleDevice(shuttleDevice);
                         dto.setLiftNo(liftDevice.getId().intValue());
-                        dto.setLocNo(standbyLocNoTo);
+                        dto.setLocNo(standbyLocNoMemo);
                     })),
                     MotionCtgType.SHUTTLE_MOVE
             ));
 
-            // 閿佸畾鎹㈠眰璺緞
-            motionList.addAll(kernelService.mapLockPath(
-                    null,
-                    MotionDto.build((dto -> {
-                        dto.setShuttleNo(shuttleDevice.getId().intValue());
-                        dto.setLocNo(JSON.toJSONString(lockPath));
-                    }))
-            ));
+//            // 閿佸畾鎹㈠眰璺緞
+//            motionList.addAll(kernelService.mapLockPath(
+//                    null,
+//                    MotionDto.build((dto -> {
+//                        dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                        dto.setLocNo(JSON.toJSONString(lockPath));
+//                    }))
+//            ));
 
             // 鎻愬崌鏈虹┖杞界Щ鍔ㄥ埌绌挎杞﹀眰
             motionList.addAll(kernelService.liftMove(
@@ -1296,7 +1328,7 @@
             motionList.addAll(kernelService.shuttleMove(
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
-                        dto.setLocNo(standbyLocNoTo);
+                        dto.setLocNo(standbyLocNoMemo);
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
@@ -1367,14 +1399,14 @@
                     }))
             ));
 
-            // 瑙i攣鎹㈠眰璺緞
-            motionList.addAll(kernelService.mapUnlockPath(
-                    null,
-                    MotionDto.build((dto -> {
-                        dto.setShuttleNo(shuttleDevice.getId().intValue());
-                        dto.setLocNo(JSON.toJSONString(lockPath));
-                    }))
-            ));
+//            // 瑙i攣鎹㈠眰璺緞
+//            motionList.addAll(kernelService.mapUnlockPath(
+//                    null,
+//                    MotionDto.build((dto -> {
+//                        dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                        dto.setLocNo(JSON.toJSONString(lockPath));
+//                    }))
+//            ));
 
             // 绌挎杞︽彁鍗囨満寰呮満浣嶈嚦鐩爣浣嶇疆
             motionList.addAll(kernelService.shuttleMove(
@@ -1785,14 +1817,14 @@
                     MotionCtgType.SHUTTLE_MOVE
             ));
 
-            // 閿佸畾鎹㈠眰璺緞
-            motionList.addAll(kernelService.mapLockPath(
-                    null,
-                    MotionDto.build((dto -> {
-                        dto.setShuttleNo(shuttleDevice.getId().intValue());
-                        dto.setLocNo(JSON.toJSONString(lockPath));
-                    }))
-            ));
+//            // 閿佸畾鎹㈠眰璺緞
+//            motionList.addAll(kernelService.mapLockPath(
+//                    null,
+//                    MotionDto.build((dto -> {
+//                        dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                        dto.setLocNo(JSON.toJSONString(lockPath));
+//                    }))
+//            ));
 
             // 鎻愬崌鏈虹┖杞界Щ鍔ㄥ埌绌挎杞﹀眰
             motionList.addAll(kernelService.liftMove(
@@ -1887,14 +1919,14 @@
                     }))
             ));
 
-            // 瑙i攣鎹㈠眰璺緞
-            motionList.addAll(kernelService.mapUnlockPath(
-                    null,
-                    MotionDto.build((dto -> {
-                        dto.setShuttleNo(shuttleDevice.getId().intValue());
-                        dto.setLocNo(JSON.toJSONString(lockPath));
-                    }))
-            ));
+//            // 瑙i攣鎹㈠眰璺緞
+//            motionList.addAll(kernelService.mapUnlockPath(
+//                    null,
+//                    MotionDto.build((dto -> {
+//                        dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                        dto.setLocNo(JSON.toJSONString(lockPath));
+//                    }))
+//            ));
 
             // 绌挎杞︽彁鍗囨満寰呮満浣嶈嚦鍑哄簱搴撲綅
             motionList.addAll(kernelService.shuttleMove(

--
Gitblit v1.9.1