From 8ef2bb5e46d84594e6ed632c07ea0b47a1bf6c4d Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期三, 11 十二月 2024 16:15:17 +0800
Subject: [PATCH] #path similarity

---
 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/AnalyzeService.java |   87 +++++++++++++++++++++++++++++++------------
 1 files changed, 62 insertions(+), 25 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 fbad661..22a654f 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
@@ -170,7 +170,7 @@
                             dto.setLev(Utils.getLev(task.getDestLoc()));
                             dto.setStaNo(getStaByLev(Utils.getLev(task.getDestLoc())));
                             dto.setDevpNo(basConveyorStaDest.getConveyorDeviceId().intValue());
-//                            dto.setSync();//寮傛鎵ц
+                            dto.setReleaseLift(1);//鎵ц瀹屾垚鍚庨噴鏀炬彁鍗囨満
                         }))
                 ));
 
@@ -182,6 +182,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLocNo(standbyLocNoTo);
                         })),
                         MotionCtgType.SHUTTLE_MOVE
@@ -204,8 +205,10 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
                             dto.setLocNo(destLoc);
+//                            dto.setReleaseLift(2);//鎵ц涓噴鏀炬彁鍗囨満
                         })),
                         MotionCtgType.SHUTTLE_TRANSPORT
                 ));
@@ -236,6 +239,7 @@
                             dto.setLev(Utils.getLev(task.getDestLoc()));
                             dto.setStaNo(getStaByLev(Utils.getLev(task.getDestLoc())));
                             dto.setDevpNo(basConveyorStaDest.getConveyorDeviceId().intValue());
+                            dto.setReleaseLift(1);//鎵ц瀹屾垚鍚庨噴鏀炬彁鍗囨満
                         }))
                 ));
 
@@ -247,6 +251,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
                             dto.setLocNo(standbyLocNoTo);
                         })),
@@ -287,6 +292,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
                             dto.setLocNo(liftLocNoTo);
                         })),
@@ -339,6 +345,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLocNo(standbyLocNoFrom);
                         })),
                         MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
@@ -379,6 +386,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
                             dto.setLocNo(destLoc);
                         })),
@@ -519,6 +527,7 @@
                             })),
                             MotionDto.build((dto -> {
                                 dto.setShuttleNo(shuttleDevice.getId().intValue());
+                                dto.setShuttleDevice(shuttleDevice);
                                 dto.setLocNo(originLoc);
                             })),
                             MotionCtgType.SHUTTLE_MOVE
@@ -534,18 +543,21 @@
                         MotionCtgType.SHUTTLE_PALLET_LIFT
                 ));
 
-                // 绌挎杞﹁浇璐у嚭搴撹嚦鏈�鍚庝竴娈佃矾寰勭瓑寰�
-                motionList.addAll(kernelService.shuttleMove(
-                        MotionDto.build((dto -> {
-                            dto.setShuttleNo(shuttleDevice.getId().intValue());
-                            dto.setLocNo(originLoc);
-                        })),
-                        MotionDto.build((dto -> {
-                            dto.setShuttleNo(shuttleDevice.getId().intValue());
-                            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(
@@ -555,6 +567,7 @@
                         })),
                         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())));//杈撻�佺珯
@@ -579,6 +592,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLocNo(standbyLocs);
                             dto.setSync(0);//寮傛鎵ц
                             dto.setReleaseShuttle(1);//鎵ц瀹屾垚鍚庨噴鏀惧皬杞�
@@ -628,6 +642,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
                             dto.setLocNo(standbyLocNoTo);
                         })),
@@ -668,6 +683,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
                             dto.setLocNo(liftLocNoTo);
                         })),
@@ -720,6 +736,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLocNo(standbyLocNoFrom);
                         })),
                         MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
@@ -752,6 +769,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLocNo(originLoc);
                         })),
                         MotionCtgType.SHUTTLE_MOVE
@@ -766,18 +784,21 @@
                         MotionCtgType.SHUTTLE_PALLET_LIFT
                 ));
 
-                // 绌挎杞﹁浇璐у嚭搴撹嚦鏈�鍚庝竴娈佃矾寰勭瓑寰�
-                motionList.addAll(kernelService.shuttleMove(
-                        MotionDto.build((dto -> {
-                            dto.setShuttleNo(shuttleDevice.getId().intValue());
-                            dto.setLocNo(originLoc);
-                        })),
-                        MotionDto.build((dto -> {
-                            dto.setShuttleNo(shuttleDevice.getId().intValue());
-                            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(
@@ -787,6 +808,7 @@
                         })),
                         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())));//杈撻�佺珯
@@ -811,6 +833,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLocNo(standbyLocs);
                             dto.setSync(0);//寮傛鎵ц
                             dto.setReleaseShuttle(1);//鎵ц瀹屾垚鍚庨噴鏀惧皬杞�
@@ -944,6 +967,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLocNo(chargeLocNo);
                     })),
                     MotionCtgType.SHUTTLE_MOVE
@@ -959,6 +983,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLocNo(standbyLocNoTo);
                     })),
                     MotionCtgType.SHUTTLE_MOVE
@@ -989,6 +1014,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLiftNo(transferLiftDevice.getId().intValue());
                         dto.setLocNo(liftLocNoTo);
                     })),
@@ -1041,6 +1067,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLocNo(standbyLocNoFrom);
                     })),
                     MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
@@ -1062,6 +1089,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLocNo(chargeLocNo);
                     })),
                     MotionCtgType.SHUTTLE_MOVE
@@ -1130,6 +1158,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLocNo(locNo);
                     })),
                     MotionCtgType.SHUTTLE_MOVE
@@ -1184,6 +1213,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLocNo(locNo);
                         })),
                         MotionCtgType.SHUTTLE_MOVE
@@ -1224,6 +1254,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLiftNo(liftDevice.getId().intValue());
                         dto.setLocNo(standbyLocNoTo);
                     })),
@@ -1264,6 +1295,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLiftNo(liftDevice.getId().intValue());
                         dto.setLocNo(liftLocNoTo);
                     })),
@@ -1316,6 +1348,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLocNo(standbyLocNoFrom);
                     })),
                     MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
@@ -1347,6 +1380,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLocNo(locNo);
                     })),
                     MotionCtgType.SHUTTLE_MOVE
@@ -1402,6 +1436,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(device.getId().intValue());
+                            dto.setShuttleDevice(device);
                             dto.setLocNo(targetLoc);
                         })),
                         MotionCtgType.SHUTTLE_MOVE
@@ -1454,6 +1489,7 @@
                             })),
                             MotionDto.build((dto -> {
                                 dto.setShuttleNo(device.getId().intValue());
+                                dto.setShuttleDevice(device);
                                 dto.setLocNo(sourceLoc);
                             })),
                             MotionCtgType.SHUTTLE_MOVE
@@ -1475,6 +1511,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(device.getId().intValue());
+                            dto.setShuttleDevice(device);
                             dto.setLocNo(targetLoc);
                         })),
                         MotionCtgType.SHUTTLE_TRANSPORT

--
Gitblit v1.9.1