From 89a94a91bd97e1e47fba93c762b4e53a5830b760 Mon Sep 17 00:00:00 2001
From: gtsxc <3272660260@qq.com>
Date: 星期一, 19 五月 2025 19:44:51 +0800
Subject: [PATCH] #

---
 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/AnalyzeService.java |  710 +++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 596 insertions(+), 114 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 d81b555..e263be0 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
@@ -3,15 +3,9 @@
 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.enums.DeviceCtgType;
-import com.zy.asrs.wcs.core.model.enums.MotionCtgType;
-import com.zy.asrs.wcs.core.model.enums.TaskCtgType;
-import com.zy.asrs.wcs.core.model.enums.TaskStsType;
+import com.zy.asrs.wcs.core.model.enums.*;
 import com.zy.asrs.wcs.core.service.*;
-import com.zy.asrs.wcs.core.utils.ConveyorDispatcher;
-import com.zy.asrs.wcs.core.utils.LiftDispatcher;
-import com.zy.asrs.wcs.core.utils.ShuttleDispatcher;
-import com.zy.asrs.wcs.core.utils.Utils;
+import com.zy.asrs.wcs.core.utils.*;
 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;
@@ -26,7 +20,6 @@
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 /**
  * 1.鍏呯數浠诲姟锛�2.搴撲綅绉昏浆锛�3.灏忚溅杩佺Щ锛�4.鎵嬪姩浠诲姟
@@ -105,8 +98,8 @@
 
             String shuttleLocNo = shuttleProtocol.getCurrentLocNo();
 
-            //鑾峰彇璺濈鐩爣浣嶇疆鏈�杩戠殑绌洪棽鍙崲灞傛彁鍗囨満
-            LiftThread liftThread = liftDispatcher.searchIdleLift(shuttleLocNo, task.getHostId(), true);
+            //鑾峰彇璺濈鐩爣浣嶇疆鏈�杩戠殑鍙崲灞傛彁鍗囨満(鍙兘涓嶇┖闂�)
+            LiftThread liftThread = liftDispatcher.searchLift(shuttleLocNo, task.getHostId(), true);
             if (liftThread == null) {
                 return motionList;
             }
@@ -150,30 +143,35 @@
             //绌挎杞﹀嚭鎻愬崌鏈哄簱浣嶅彿
             String liftLocNoFrom = shuttleStandbyFrom.getDeviceLoc();
 
-            //绌挎杞﹁繘鎻愬崌鏈哄緟鏈轰綅搴撲綅鍙�
+            //绌挎杞﹁繘鎻愬崌鏈哄緟鏈轰綅搴撲綅鍙�  杈撻�佺嚎浣嶇疆
             String standbyLocNoTo = shuttleStandbyTo.getDeviceStandbyLoc();
+            //绌挎杞︽崲灞傛椂寰呮満浣嶇疆 浣跨敤琛ㄥ垪 memo鏁版嵁
+            String standbyLocNoMemo = shuttleStandbyTo.getMemo();
 
             //绌挎杞﹀嚭鎻愬崌鏈哄緟鏈轰綅搴撲綅鍙�
             String standbyLocNoFrom = shuttleStandbyFrom.getDeviceStandbyLoc();
 
+            //鎹㈠眰闇�瑕侀攣瀹氱殑璺緞
+            List<String> lockPath = shuttleStandbyFrom.getLockPath$();
+
             // 鍏ュ簱鐩爣灞傛湁绌挎杞�
             if (Utils.getLev(shuttleLocNo) == Utils.getLev(task.getDestLoc())) {
 
-                // 鎻愬崌鏈鸿浇璐хЩ鍔�
-                motionList.addAll(kernelService.liftMoveGoods(
-                        MotionDto.build((dto -> {
-                            dto.setLiftNo(transferLiftDevice.getId().intValue());
-                            dto.setLev(1);//鍏夋嘲1灞傛槸杈撻�佺嚎灞�
-                            dto.setStaNo(31004);//鍏ュ簱绔欑偣
-                        }))
-                        , MotionDto.build((dto -> {
-                            dto.setLiftNo(transferLiftDevice.getId().intValue());
-                            dto.setLev(Utils.getLev(task.getDestLoc()));
-                            dto.setStaNo(getStaByLev(Utils.getLev(task.getDestLoc())));
-                            dto.setDevpNo(basConveyorStaDest.getConveyorDeviceId().intValue());
-//                            dto.setSync();//寮傛鎵ц
-                        }))
-                ));
+//                // 鎻愬崌鏈鸿浇璐хЩ鍔�
+//                motionList.addAll(kernelService.liftMoveGoods(
+//                        MotionDto.build((dto -> {
+//                            dto.setLiftNo(transferLiftDevice.getId().intValue());
+//                            dto.setLev(1);//鍏夋嘲1灞傛槸杈撻�佺嚎灞�
+//                            dto.setStaNo(31004);//鍏ュ簱绔欑偣
+//                        }))
+//                        , MotionDto.build((dto -> {
+//                            dto.setLiftNo(transferLiftDevice.getId().intValue());
+//                            dto.setLev(Utils.getLev(task.getDestLoc()));
+//                            dto.setStaNo(getStaByLev(Utils.getLev(task.getDestLoc())));
+//                            dto.setDevpNo(basConveyorStaDest.getConveyorDeviceId().intValue());
+//                            dto.setReleaseLift(1);//鎵ц瀹屾垚鍚庨噴鏀炬彁鍗囨満
+//                        }))
+//                ));
 
                 // 绌挎杞﹁蛋琛岃嚦鎻愬崌鏈哄簱浣嶅緟鏈轰綅
                 motionList.addAll(kernelService.shuttleMove(
@@ -183,6 +181,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLocNo(standbyLocNoTo);
                         })),
                         MotionCtgType.SHUTTLE_MOVE
@@ -197,7 +196,7 @@
                         MotionCtgType.SHUTTLE_PALLET_LIFT
                 ));
 
-                // 绌挎杞﹁蛋琛岃嚦鐩爣搴撲綅
+                // 绌挎杞﹁浇璐ц蛋琛岃嚦鐩爣搴撲綅
                 motionList.addAll(kernelService.shuttleMove(
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
@@ -205,10 +204,12 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
                             dto.setLocNo(destLoc);
+//                            dto.setReleaseLift(2);//鎵ц涓噴鏀炬彁鍗囨満
                         })),
-                        MotionCtgType.SHUTTLE_MOVE
+                        MotionCtgType.SHUTTLE_TRANSPORT
                 ));
 
                 // 绌挎杞﹀叆搴撴墭鐩樹笅闄�
@@ -225,20 +226,21 @@
              */
             } else {
 
-                // 鎻愬崌鏈鸿浇璐хЩ鍔�
-                motionList.addAll(kernelService.liftMoveGoods(
-                        MotionDto.build((dto -> {
-                            dto.setLiftNo(transferLiftDevice.getId().intValue());
-                            dto.setLev(1);//鍏夋嘲1灞傛槸杈撻�佺嚎灞�
-                            dto.setStaNo(31004);//鍏ュ簱绔欑偣
-                        }))
-                        , MotionDto.build((dto -> {
-                            dto.setLiftNo(transferLiftDevice.getId().intValue());
-                            dto.setLev(Utils.getLev(task.getDestLoc()));
-                            dto.setStaNo(getStaByLev(Utils.getLev(task.getDestLoc())));
-                            dto.setDevpNo(basConveyorStaDest.getConveyorDeviceId().intValue());
-                        }))
-                ));
+//                // 鎻愬崌鏈鸿浇璐хЩ鍔�
+//                motionList.addAll(kernelService.liftMoveGoods(
+//                        MotionDto.build((dto -> {
+//                            dto.setLiftNo(transferLiftDevice.getId().intValue());
+//                            dto.setLev(1);//鍏夋嘲1灞傛槸杈撻�佺嚎灞�
+//                            dto.setStaNo(31004);//鍏ュ簱绔欑偣
+//                        }))
+//                        , MotionDto.build((dto -> {
+//                            dto.setLiftNo(transferLiftDevice.getId().intValue());
+//                            dto.setLev(Utils.getLev(task.getDestLoc()));
+//                            dto.setStaNo(getStaByLev(Utils.getLev(task.getDestLoc())));
+//                            dto.setDevpNo(basConveyorStaDest.getConveyorDeviceId().intValue());
+//                            dto.setReleaseLift(1);//鎵ц瀹屾垚鍚庨噴鏀炬彁鍗囨満
+//                        }))
+//                ));
 
                 // 绌挎杞﹁蛋琛岃嚦鎻愬崌鏈哄簱浣嶅緟鏈轰綅
                 motionList.addAll(kernelService.shuttleMove(
@@ -248,20 +250,21 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLiftNo(transferLiftDevice.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(standbyLocNoFrom);
-                        }))
-                ));
+//                // 閿佸畾鎹㈠眰璺緞
+//                motionList.addAll(kernelService.mapLockPath(
+//                        null,
+//                        MotionDto.build((dto -> {
+//                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                            dto.setLocNo(JSON.toJSONString(lockPath));
+//                        }))
+//                ));
 
                 // 鎻愬崌鏈虹┖杞界Щ鍔ㄥ埌绌挎杞﹀眰
                 motionList.addAll(kernelService.liftMove(
@@ -284,10 +287,11 @@
                 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());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
                             dto.setLocNo(liftLocNoTo);
                         })),
@@ -340,6 +344,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLocNo(standbyLocNoFrom);
                         })),
                         MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
@@ -354,6 +359,15 @@
                         }))
                 ));
 
+//                // 瑙i攣鎹㈠眰璺緞
+//                motionList.addAll(kernelService.mapUnlockPath(
+//                        null,
+//                        MotionDto.build((dto -> {
+//                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                            dto.setLocNo(JSON.toJSONString(lockPath));
+//                        }))
+//                ));
+
                 // 绌挎杞﹀叆搴撻《鍗�
                 motionList.addAll(kernelService.shuttleAction(
                         null,
@@ -363,7 +377,7 @@
                         MotionCtgType.SHUTTLE_PALLET_LIFT
                 ));
 
-                // 绌挎杞﹁蛋琛岃嚦鐩爣搴撲綅
+                // 绌挎杞﹁浇璐ц蛋琛岃嚦鐩爣搴撲綅
                 motionList.addAll(kernelService.shuttleMove(
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
@@ -371,10 +385,11 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
                             dto.setLocNo(destLoc);
                         })),
-                        MotionCtgType.SHUTTLE_MOVE
+                        MotionCtgType.SHUTTLE_TRANSPORT
                 ));
 
                 // 绌挎杞﹀叆搴撴墭鐩樹笅闄�
@@ -462,14 +477,20 @@
             //绌挎杞﹀嚭鎻愬崌鏈哄簱浣嶅彿
             String liftLocNoFrom = shuttleStandbyFrom.getDeviceLoc();
 
-            //绌挎杞﹁繘鎻愬崌鏈哄緟鏈轰綅搴撲綅鍙�
+            //绌挎杞﹁繘鎻愬崌鏈哄緟鏈轰綅搴撲綅鍙� 杈撻�佺嚎浣嶇疆
             String standbyLocNoTo = shuttleStandbyTo.getDeviceStandbyLoc();
+
+            //绌挎杞︽崲灞傛椂寰呮満浣嶇疆 浣跨敤琛ㄥ垪 memo鏁版嵁
+            String standbyLocNoMemo = shuttleStandbyTo.getMemo();
 
             //绌挎杞﹀嚭鎻愬崌鏈哄緟鏈轰綅搴撲綅鍙�
             String standbyLocNoFrom = shuttleStandbyFrom.getDeviceStandbyLoc();
 
-            //绌挎杞﹀嚭鎻愬崌鏈哄悗灏忚溅寰呮満浣�
-            String shuttleFromLiftStandbyLoc = shuttleStandbyFrom.getStandbyLoc();
+            //绌挎杞﹀嚭鎻愬崌鏈哄悗鍏ㄩ儴寰呮満浣�
+            String standbyLocs = shuttleStandbyFrom.getStandbyLoc();//鑾峰彇鍏ㄩ儴寰呮満浣�
+
+            //鎹㈠眰闇�瑕侀攣瀹氱殑璺緞
+            List<String> lockPath = shuttleStandbyFrom.getLockPath$();
 
             //鑾峰彇鍑哄簱浠诲姟绫诲瀷
             TaskCtg taskCtg = taskCtgService.getOne(new LambdaQueryWrapper<TaskCtg>()
@@ -487,6 +508,12 @@
                 return motionList;
             }
 
+//            //鍒嗘瀽鍑哄簱璺緞寰呮満搴撲綅
+//            String lastPathStartLoc = shuttleDispatcher.analyzeOutPathWaitLoc(originLoc, standbyLocNoTo, shuttleDevice);
+//            if (lastPathStartLoc == null) {
+//                return motionList;//鏈垎鏋愭垚鍔�
+//            }
+
             /**
              * 鍑哄簱
              */
@@ -502,6 +529,7 @@
                             })),
                             MotionDto.build((dto -> {
                                 dto.setShuttleNo(shuttleDevice.getId().intValue());
+                                dto.setShuttleDevice(shuttleDevice);
                                 dto.setLocNo(originLoc);
                             })),
                             MotionCtgType.SHUTTLE_MOVE
@@ -517,7 +545,39 @@
                         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
+//                    ));
+//                }
+//
+//                // 绌挎杞﹁浇璐ц嚦鎻愬崌鏈哄緟鏈轰綅
+//                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());
@@ -525,10 +585,12 @@
                         })),
                         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_MOVE
+                        MotionCtgType.SHUTTLE_TRANSPORT_TO_CONVEYOR
                 ));
 
                 // 绌挎杞﹀嚭搴撴墭鐩樹笅闄�
@@ -538,6 +600,22 @@
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
                         })),
                         MotionCtgType.SHUTTLE_PALLET_DOWN
+                ));
+
+                // 绌挎杞︽彁鍗囨満寰呮満浣� - 鍒板緟鏈轰綅(鑷姩閫夋嫨鍚堥�傚緟鏈轰綅)
+                motionList.addAll(kernelService.shuttleMove(
+                        MotionDto.build((dto -> {
+                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setLocNo(standbyLocNoFrom);
+                        })),
+                        MotionDto.build((dto -> {
+                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
+                            dto.setLocNo(standbyLocs);
+                            dto.setSync(0);//寮傛鎵ц
+                            dto.setReleaseShuttle(1);//鎵ц瀹屾垚鍚庨噴鏀惧皬杞�
+                        })),
+                        MotionCtgType.SHUTTLE_MOVE_STANDBY
                 ));
 
                 // 鎻愬崌鏈鸿浇璐хЩ鍔�
@@ -552,22 +630,8 @@
                             dto.setLev(1);//鍏夋嘲1灞傛槸杈撻�佺嚎灞�
                             dto.setStaNo(31001);//鍑哄簱绔欑偣
                             dto.setDevpNo(basConveyorStaOrigin.getConveyorDeviceId().intValue());
-                            dto.setSync(0);//寮傛鎵ц
                             dto.setReleaseLift(1);//鎵ц瀹屾垚鍚庨噴鏀炬彁鍗囨満
                         }))
-                ));
-
-                // 绌挎杞︽彁鍗囨満寰呮満浣� - 鍒板緟鏈轰綅
-                motionList.addAll(kernelService.shuttleMove(
-                        MotionDto.build((dto -> {
-                            dto.setShuttleNo(shuttleDevice.getId().intValue());
-                            dto.setLocNo(standbyLocNoFrom);
-                        })),
-                        MotionDto.build((dto -> {
-                            dto.setShuttleNo(shuttleDevice.getId().intValue());
-                            dto.setLocNo(shuttleFromLiftStandbyLoc);
-                        })),
-                        MotionCtgType.SHUTTLE_MOVE
                 ));
 
                 // 杈撻�佺嚎杩愯緭鑷冲嚭搴撳彛
@@ -596,20 +660,21 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLiftNo(transferLiftDevice.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(standbyLocNoFrom);
-                        }))
-                ));
+//                // 閿佸畾鎹㈠眰璺緞
+//                motionList.addAll(kernelService.mapLockPath(
+//                        null,
+//                        MotionDto.build((dto -> {
+//                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                            dto.setLocNo(JSON.toJSONString(lockPath));
+//                        }))
+//                ));
 
                 // 鎻愬崌鏈虹┖杞界Щ鍔ㄥ埌绌挎杞﹀眰
                 motionList.addAll(kernelService.liftMove(
@@ -632,10 +697,11 @@
                 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());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
                             dto.setLocNo(liftLocNoTo);
                         })),
@@ -688,6 +754,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLocNo(standbyLocNoFrom);
                         })),
                         MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
@@ -702,6 +769,15 @@
                         }))
                 ));
 
+//                // 瑙i攣鎹㈠眰璺緞
+//                motionList.addAll(kernelService.mapUnlockPath(
+//                        null,
+//                        MotionDto.build((dto -> {
+//                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                            dto.setLocNo(JSON.toJSONString(lockPath));
+//                        }))
+//                ));
+
                 // 绌挎杞︽彁鍗囨満寰呮満浣嶈嚦鍑哄簱搴撲綅
                 motionList.addAll(kernelService.shuttleMove(
                         MotionDto.build((dto -> {
@@ -711,6 +787,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLocNo(originLoc);
                         })),
                         MotionCtgType.SHUTTLE_MOVE
@@ -725,7 +802,39 @@
                         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
+//                    ));
+//                }
+//
+//                // 绌挎杞﹁浇璐ц嚦鎻愬崌鏈哄緟鏈轰綅
+//                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());
@@ -733,10 +842,12 @@
                         })),
                         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_MOVE
+                        MotionCtgType.SHUTTLE_TRANSPORT_TO_CONVEYOR
                 ));
 
                 // 绌挎杞﹀嚭搴撴墭鐩樹笅闄�
@@ -746,6 +857,22 @@
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
                         })),
                         MotionCtgType.SHUTTLE_PALLET_DOWN
+                ));
+
+                // 绌挎杞︽彁鍗囨満寰呮満浣� - 鍒板緟鏈轰綅(鑷姩閫夋嫨鍚堥�傚緟鏈轰綅)
+                motionList.addAll(kernelService.shuttleMove(
+                        MotionDto.build((dto -> {
+                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setLocNo(standbyLocNoFrom);
+                        })),
+                        MotionDto.build((dto -> {
+                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
+                            dto.setLocNo(standbyLocs);
+                            dto.setSync(0);//寮傛鎵ц
+                            dto.setReleaseShuttle(1);//鎵ц瀹屾垚鍚庨噴鏀惧皬杞�
+                        })),
+                        MotionCtgType.SHUTTLE_MOVE_STANDBY
                 ));
 
                 // 鎻愬崌鏈鸿浇璐хЩ鍔�
@@ -759,23 +886,9 @@
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
                             dto.setLev(1);//鍏夋嘲1灞傛槸杈撻�佺嚎灞�
                             dto.setStaNo(31001);//鍑哄簱绔欑偣
-                            dto.setSync(0);//寮傛鎵ц
                             dto.setDevpNo(basConveyorStaOrigin.getConveyorDeviceId().intValue());
                             dto.setReleaseLift(1);//鎵ц瀹屾垚鍚庨噴鏀炬彁鍗囨満
                         }))
-                ));
-
-                // 绌挎杞︽彁鍗囨満寰呮満浣� - 鍒板緟鏈轰綅
-                motionList.addAll(kernelService.shuttleMove(
-                        MotionDto.build((dto -> {
-                            dto.setShuttleNo(shuttleDevice.getId().intValue());
-                            dto.setLocNo(standbyLocNoFrom);
-                        })),
-                        MotionDto.build((dto -> {
-                            dto.setShuttleNo(shuttleDevice.getId().intValue());
-                            dto.setLocNo(shuttleFromLiftStandbyLoc);
-                        })),
-                        MotionCtgType.SHUTTLE_MOVE
                 ));
 
                 // 杈撻�佺嚎杩愯緭鑷冲嚭搴撳彛
@@ -871,6 +984,9 @@
         //绌挎杞﹀嚭鎻愬崌鏈哄簱浣嶅彿
         String liftLocNoFrom = shuttleStandbyFrom.getDeviceLoc();
 
+        //绌挎杞︽崲灞傛椂寰呮満浣嶇疆 浣跨敤琛ㄥ垪 memo鏁版嵁
+        String standbyLocNoMemo = shuttleStandbyTo.getMemo();
+
         //绌挎杞﹁繘鎻愬崌鏈哄緟鏈轰綅搴撲綅鍙�
         String standbyLocNoTo = shuttleStandbyTo.getDeviceStandbyLoc();
 
@@ -888,6 +1004,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLocNo(chargeLocNo);
                     })),
                     MotionCtgType.SHUTTLE_MOVE
@@ -903,7 +1020,8 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
-                        dto.setLocNo(standbyLocNoTo);
+                        dto.setShuttleDevice(shuttleDevice);
+                        dto.setLocNo(standbyLocNoMemo);
                     })),
                     MotionCtgType.SHUTTLE_MOVE
             ));
@@ -929,10 +1047,11 @@
             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());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLiftNo(transferLiftDevice.getId().intValue());
                         dto.setLocNo(liftLocNoTo);
                     })),
@@ -985,6 +1104,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLocNo(standbyLocNoFrom);
                     })),
                     MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
@@ -1006,6 +1126,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLocNo(chargeLocNo);
                     })),
                     MotionCtgType.SHUTTLE_MOVE
@@ -1074,6 +1195,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLocNo(locNo);
                     })),
                     MotionCtgType.SHUTTLE_MOVE
@@ -1128,6 +1250,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLocNo(locNo);
                         })),
                         MotionCtgType.SHUTTLE_MOVE
@@ -1153,8 +1276,14 @@
             //绌挎杞﹀埌鎻愬崌鏈哄緟鏈轰綅搴撲綅鍙�
             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()));
+
+            //鎹㈠眰闇�瑕侀攣瀹氱殑璺緞
+            List<String> lockPath = liftDispatcher.getLockPathByLocNo(liftThread, Utils.getLev(task.getDestLoc()));
 
 
             // 绌挎杞﹁蛋琛岃嚦鎻愬崌鏈哄簱浣嶅緟鏈轰綅
@@ -1165,20 +1294,21 @@
                     })),
                     MotionDto.build((dto -> {
                         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(standbyLocNoFrom);
-                    }))
-            ));
+//            // 閿佸畾鎹㈠眰璺緞
+//            motionList.addAll(kernelService.mapLockPath(
+//                    null,
+//                    MotionDto.build((dto -> {
+//                        dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                        dto.setLocNo(JSON.toJSONString(lockPath));
+//                    }))
+//            ));
 
             // 鎻愬崌鏈虹┖杞界Щ鍔ㄥ埌绌挎杞﹀眰
             motionList.addAll(kernelService.liftMove(
@@ -1201,10 +1331,11 @@
             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());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLiftNo(liftDevice.getId().intValue());
                         dto.setLocNo(liftLocNoTo);
                     })),
@@ -1257,6 +1388,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLocNo(standbyLocNoFrom);
                     })),
                     MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
@@ -1267,8 +1399,18 @@
                     null
                     , MotionDto.build((dto -> {
                         dto.setLiftNo(liftDevice.getId().intValue());
+                        dto.setReleaseLift(1);//鎵ц瀹屾垚鍚庨噴鏀炬彁鍗囨満
                     }))
             ));
+
+//            // 瑙i攣鎹㈠眰璺緞
+//            motionList.addAll(kernelService.mapUnlockPath(
+//                    null,
+//                    MotionDto.build((dto -> {
+//                        dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                        dto.setLocNo(JSON.toJSONString(lockPath));
+//                    }))
+//            ));
 
             // 绌挎杞︽彁鍗囨満寰呮満浣嶈嚦鐩爣浣嶇疆
             motionList.addAll(kernelService.shuttleMove(
@@ -1279,6 +1421,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLocNo(locNo);
                     })),
                     MotionCtgType.SHUTTLE_MOVE
@@ -1334,6 +1477,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(device.getId().intValue());
+                            dto.setShuttleDevice(device);
                             dto.setLocNo(targetLoc);
                         })),
                         MotionCtgType.SHUTTLE_MOVE
@@ -1386,6 +1530,7 @@
                             })),
                             MotionDto.build((dto -> {
                                 dto.setShuttleNo(device.getId().intValue());
+                                dto.setShuttleDevice(device);
                                 dto.setLocNo(sourceLoc);
                             })),
                             MotionCtgType.SHUTTLE_MOVE
@@ -1399,7 +1544,7 @@
                     motion.setMotionCtg(MotionCtgType.SHUTTLE_PALLET_LIFT.val());
                 }));
 
-                // 绌挎杞﹁蛋琛岃嚦鐩爣搴撲綅
+                // 绌挎杞﹁浇璐ц蛋琛岃嚦鐩爣搴撲綅
                 motionList.addAll(kernelService.shuttleMove(
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(device.getId().intValue());
@@ -1407,9 +1552,10 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(device.getId().intValue());
+                            dto.setShuttleDevice(device);
                             dto.setLocNo(targetLoc);
                         })),
-                        MotionCtgType.SHUTTLE_MOVE
+                        MotionCtgType.SHUTTLE_TRANSPORT
                 ));
 
                 //鎵樼洏涓嬮檷
@@ -1500,4 +1646,340 @@
         return motionList;
     }
 
+    /**
+     * 鐢熸垚灏忚溅杞借揣杩佺Щ鍔ㄤ綔
+     */
+    public List<Motion> generateShuttleLadenMoveMotion(Task task) {
+        List<Motion> motionList = new ArrayList<>();
+        if (task.getTaskSts() != TaskStsType.NEW_LADEN_MOVE.sts) {
+            return motionList;
+        }
+        //originLoc 婧愬簱浣�
+        String originLoc =  task.getOriginLoc();
+        // locNo 鐩爣搴撲綅
+        String locNo = task.getDestLoc();
+
+        // shuttle
+        Device shuttleDevice = deviceService.getOne(new LambdaQueryWrapper<Device>()
+                .eq(Device::getDeviceNo, task.getShuttleNo())
+                .eq(Device::getDeviceType, DeviceCtgType.SHUTTLE.val())
+                .eq(Device::getHostId, task.getHostId())
+                .eq(Device::getStatus, 1));
+        if (shuttleDevice == null) {
+            return motionList;
+        }
+        ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttleDevice.getId().intValue());
+        ShuttleProtocol shuttleProtocol = shuttleThread.getStatus();
+        if (shuttleProtocol == null || shuttleProtocol.getShuttleNo() == null) {
+            return motionList;
+        }
+        if (!shuttleThread.isIdle()) {
+            return motionList;
+        }
+
+        String shuttleLocNo = shuttleProtocol.getCurrentLocNo();
+
+        //鑾峰彇璺濈鐩爣浣嶇疆鏈�杩戠殑绌洪棽鍙崲灞傛彁鍗囨満
+        LiftThread liftThread = liftDispatcher.searchIdleLift(shuttleLocNo, task.getHostId(), true);
+        if (liftThread == null) {
+            return motionList;
+        }
+        Device transferLiftDevice = liftThread.getDevice();
+
+        LiftProtocol liftProtocol = liftThread.getStatus();
+        if (liftProtocol == null || liftProtocol.getLiftNo() == null) {
+            return motionList;
+        }
+
+        //妫�娴嬬┛姊溅鏄惁鏈変换鍔$粦瀹�
+        boolean shuttleResult = Utils.checkShuttleHasBinding(shuttleDevice, task.getTaskNo());
+        if (shuttleResult) {
+            //瀛樺湪浠诲姟锛岀姝㈣В鏋�
+            return motionList;
+        }
+
+        //鑾峰彇灏忚溅寰呮満搴撲綅 ==> 杩涙彁鍗囨満
+        ShuttleStandby shuttleStandbyTo = shuttleStandbyService.getOne(new LambdaQueryWrapper<ShuttleStandby>()
+                .eq(ShuttleStandby::getDeviceId, transferLiftDevice.getId())
+                .eq(ShuttleStandby::getDeviceLev, Utils.getLev(shuttleLocNo))
+                .eq(ShuttleStandby::getStatus, 1));
+
+        //鑾峰彇灏忚溅寰呮満搴撲綅 ==> 鍑烘彁鍗囨満
+        ShuttleStandby shuttleStandbyFrom = shuttleStandbyService.getOne(new LambdaQueryWrapper<ShuttleStandby>()
+                .eq(ShuttleStandby::getDeviceId, transferLiftDevice.getId())
+                .eq(ShuttleStandby::getDeviceLev, Utils.getLev(originLoc))
+                .eq(ShuttleStandby::getStatus, 1));
+        if (shuttleStandbyTo == null || shuttleStandbyFrom == null) {
+            return motionList;
+        }
+
+        //绌挎杞﹁繘鎻愬崌鏈哄簱浣嶅彿
+        String liftLocNoTo = shuttleStandbyTo.getDeviceLoc();
+
+        //绌挎杞﹀嚭鎻愬崌鏈哄簱浣嶅彿
+        String liftLocNoFrom = shuttleStandbyFrom.getDeviceLoc();
+
+        //绌挎杞﹁繘鎻愬崌鏈哄緟鏈轰綅搴撲綅鍙� 杈撻�佺嚎浣嶇疆
+        String standbyLocNoTo = shuttleStandbyTo.getDeviceStandbyLoc();
+
+        //绌挎杞︽崲灞傛椂寰呮満浣嶇疆 浣跨敤琛ㄥ垪 memo鏁版嵁
+        String standbyLocNoMemo = shuttleStandbyTo.getMemo();
+
+        //绌挎杞﹀嚭鎻愬崌鏈哄緟鏈轰綅搴撲綅鍙�
+        String standbyLocNoFrom = shuttleStandbyFrom.getDeviceStandbyLoc();
+
+        //绌挎杞﹀嚭鎻愬崌鏈哄悗鍏ㄩ儴寰呮満浣�
+        String standbyLocs = shuttleStandbyFrom.getStandbyLoc();//鑾峰彇鍏ㄩ儴寰呮満浣�
+
+        //鎹㈠眰闇�瑕侀攣瀹氱殑璺緞
+        List<String> lockPath = shuttleStandbyFrom.getLockPath$();
+
+        //鑾峰彇鍑哄簱浠诲姟绫诲瀷
+        TaskCtg taskCtg = taskCtgService.getOne(new LambdaQueryWrapper<TaskCtg>()
+                .eq(TaskCtg::getFlag, String.valueOf(TaskCtgType.MOVE))
+                .eq(TaskCtg::getStatus, 1));
+        if (taskCtg == null) {
+            return motionList;
+        }
+
+
+
+
+        /**
+         * 鍑哄簱
+         */
+        if (Utils.getLev(shuttleLocNo) == Utils.getLev(originLoc)) {
+
+            //绌挎杞︿笉鍦ㄥ嚭搴撳簱浣�
+            if (!shuttleLocNo.equals(task.getOriginLoc())) {
+                // 绌挎杞﹁蛋琛岃嚦鍑哄簱搴撲綅
+                motionList.addAll(kernelService.shuttleMove(
+                        MotionDto.build((dto -> {
+                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setLocNo(shuttleLocNo);
+                        })),
+                        MotionDto.build((dto -> {
+                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
+                            dto.setLocNo(originLoc);
+                        })),
+                        MotionCtgType.SHUTTLE_MOVE
+                ));
+            }
+
+            // 绌挎杞﹀嚭搴撻《鍗�
+            motionList.addAll(kernelService.shuttleAction(
+                    null,
+                    MotionDto.build((dto -> {
+                        dto.setShuttleNo(shuttleDevice.getId().intValue());
+                    })),
+                    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.setShuttleDevice(shuttleDevice);
+                        dto.setLocNo(locNo);
+                    })),
+                    MotionCtgType.SHUTTLE_TRANSPORT
+            ));
+
+            // 绌挎杞﹀嚭搴撴墭鐩樹笅闄�
+            motionList.addAll(kernelService.shuttleAction(
+                    null,
+                    MotionDto.build((dto -> {
+                        dto.setShuttleNo(shuttleDevice.getId().intValue());
+                    })),
+                    MotionCtgType.SHUTTLE_PALLET_DOWN
+            ));
+
+
+
+            /**
+             * 浜屻�佸嚭搴撹捣濮嬪眰娌℃湁绌挎杞�
+             */
+        } else {
+
+            // 绌挎杞﹁蛋琛岃嚦鎻愬崌鏈哄簱浣嶅緟鏈轰綅
+            motionList.addAll(kernelService.shuttleMove(
+                    MotionDto.build((dto -> {
+                        dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setLocNo(shuttleLocNo);
+                    })),
+                    MotionDto.build((dto -> {
+                        dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
+                        dto.setLiftNo(transferLiftDevice.getId().intValue());
+                        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.liftMove(
+                    null
+                    , MotionDto.build((dto -> {
+                        dto.setLiftNo(transferLiftDevice.getId().intValue());
+                        dto.setLev(Utils.getLev(shuttleLocNo));
+                    }))
+            ));
+
+            // 閿佸畾鎻愬崌鏈�
+            motionList.addAll(kernelService.liftLock(
+                    null
+                    , MotionDto.build((dto -> {
+                        dto.setLiftNo(transferLiftDevice.getId().intValue());
+                    }))
+            ));
+
+            // 绌挎杞﹀緟鏈轰綅鑷虫彁鍗囨満
+            motionList.addAll(kernelService.shuttleMove(
+                    MotionDto.build((dto -> {
+                        dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setLocNo(standbyLocNoMemo);
+                    })),
+                    MotionDto.build((dto -> {
+                        dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
+                        dto.setLiftNo(transferLiftDevice.getId().intValue());
+                        dto.setLocNo(liftLocNoTo);
+                    })),
+                    MotionCtgType.SHUTTLE_MOVE_TO_LIFT
+            ));
+
+            // 瑙i攣鎻愬崌鏈�
+            motionList.addAll(kernelService.liftUnlock(
+                    null
+                    , MotionDto.build((dto -> {
+                        dto.setLiftNo(transferLiftDevice.getId().intValue());
+                    }))
+            ));
+
+            // 鎻愬崌鏈烘惉杞� 鑷� 鐩爣浣嶇疆灞�
+            motionList.addAll(kernelService.liftMoveShuttle(
+                    MotionDto.build((dto -> {
+                        dto.setLiftNo(transferLiftDevice.getId().intValue());
+                        dto.setLev(Utils.getLev(shuttleLocNo));
+                    })),
+                    MotionDto.build((dto -> {
+                        dto.setLiftNo(transferLiftDevice.getId().intValue());
+                        dto.setLev(Utils.getLev(liftLocNoFrom));
+                    }))
+            ));
+
+            // 閿佸畾鎻愬崌鏈�
+            motionList.addAll(kernelService.liftLock(
+                    null
+                    , MotionDto.build((dto -> {
+                        dto.setLiftNo(transferLiftDevice.getId().intValue());
+                    }))
+            ));
+
+            // 鏇存柊灏忚溅鍧愭爣
+            motionList.addAll(kernelService.shuttleUpdateLocation(
+                    null
+                    , MotionDto.build((dto -> {
+                        dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setLocNo(liftLocNoFrom);
+                    }))
+            ));
+
+            // 绌挎杞﹁蛋琛岃嚦鎻愬崌鏈哄緟鏈轰綅
+            motionList.addAll(kernelService.shuttleMove(
+                    MotionDto.build((dto -> {
+                        dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setLiftNo(transferLiftDevice.getId().intValue());
+                        dto.setLocNo(liftLocNoFrom);
+                    })),
+                    MotionDto.build((dto -> {
+                        dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
+                        dto.setLocNo(standbyLocNoFrom);
+                    })),
+                    MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
+            ));
+
+            // 瑙i攣鎻愬崌鏈�
+            motionList.addAll(kernelService.liftUnlock(
+                    null
+                    , MotionDto.build((dto -> {
+                        dto.setLiftNo(transferLiftDevice.getId().intValue());
+                        dto.setReleaseLift(1);//鎵ц瀹屾垚鍚庨噴鏀炬彁鍗囨満
+                    }))
+            ));
+
+//            // 瑙i攣鎹㈠眰璺緞
+//            motionList.addAll(kernelService.mapUnlockPath(
+//                    null,
+//                    MotionDto.build((dto -> {
+//                        dto.setShuttleNo(shuttleDevice.getId().intValue());
+//                        dto.setLocNo(JSON.toJSONString(lockPath));
+//                    }))
+//            ));
+
+            // 绌挎杞︽彁鍗囨満寰呮満浣嶈嚦鍑哄簱搴撲綅
+            motionList.addAll(kernelService.shuttleMove(
+                    MotionDto.build((dto -> {
+                        dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setLiftNo(transferLiftDevice.getId().intValue());
+                        dto.setLocNo(standbyLocNoFrom);
+                    })),
+                    MotionDto.build((dto -> {
+                        dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
+                        dto.setLocNo(originLoc);
+                    })),
+                    MotionCtgType.SHUTTLE_MOVE
+            ));
+
+            // 绌挎杞﹀嚭搴撻《鍗�
+            motionList.addAll(kernelService.shuttleAction(
+                    null,
+                    MotionDto.build((dto -> {
+                        dto.setShuttleNo(shuttleDevice.getId().intValue());
+                    })),
+                    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.setShuttleDevice(shuttleDevice);
+                        dto.setLocNo(locNo);
+                    })),
+                    MotionCtgType.SHUTTLE_TRANSPORT
+            ));
+
+            // 绌挎杞﹀嚭搴撴墭鐩樹笅闄�
+            motionList.addAll(kernelService.shuttleAction(
+                    null,
+                    MotionDto.build((dto -> {
+                        dto.setShuttleNo(shuttleDevice.getId().intValue());
+                    })),
+                    MotionCtgType.SHUTTLE_PALLET_DOWN
+            ));
+
+        }
+        return motionList;
+    }
 }

--
Gitblit v1.9.1