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 |  571 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 288 insertions(+), 283 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 126fd3d..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
@@ -1,19 +1,14 @@
 package com.zy.asrs.wcs.core.kernel;
 
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.zy.asrs.framework.common.Cools;
-import com.zy.asrs.framework.common.R;
 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.NavigateNode;
+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.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;
@@ -26,6 +21,7 @@
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 
 /**
@@ -54,7 +50,20 @@
     @Autowired
     private BasConveyorPathService basConveyorPathService;
     @Autowired
+    private BasConveyorStaService basConveyorStaService;
+    @Autowired
+    private BasConveyorService basConveyorService;
+    @Autowired
     private TaskCtgService taskCtgService;
+
+    public Integer getStaByLev(Integer lev) {
+        HashMap<Integer, Integer> map = new HashMap<>();
+        map.put(1, 31006);
+        map.put(2, 31007);
+        map.put(3, 31008);
+
+        return map.get(lev);
+    }
 
     public List<Motion> generateMotion(Task task) {
         List<Motion> motionList = new ArrayList<>();
@@ -67,12 +76,6 @@
 
         /**
          * 鍏ュ簱
-         * 涓�銆佸叆搴撶洰鏍囧眰鏈夌┛姊溅
-         * 1.鎻愬崌鏈哄崌闄嶅埌婧愬眰
-         * 2.璐х墿浠庤緭閫佺嚎鍒版彁鍗囨満
-         * 3.鎻愬崌鏈鸿浇璐хЩ鍔紙闈炲繀闇�锛�
-         * 4.绌挎杞﹁蛋琛岃嚦鎻愬崌鏈�
-         * 5.绌挎杞﹀叆搴撹嚦鐩爣搴撲綅
          */
         if (task.getTaskSts() == TaskStsType.NEW_INBOUND.sts) {
             // locNo
@@ -110,6 +113,11 @@
                 return motionList;
             }
 
+            BasConveyorSta basConveyorStaDest = basConveyorStaService.selectBySiteNo(task.getDestSite());
+            if (basConveyorStaDest == null) {
+                return motionList;
+            }
+
             //妫�娴嬬┛姊溅鏄惁鏈変换鍔$粦瀹�
             boolean shuttleResult = Utils.checkShuttleHasBinding(shuttleDevice, task.getTaskNo());
             if (shuttleResult) {
@@ -144,6 +152,9 @@
             //绌挎杞﹀嚭鎻愬崌鏈哄緟鏈轰綅搴撲綅鍙�
             String standbyLocNoFrom = shuttleStandbyFrom.getDeviceStandbyLoc();
 
+            //鎹㈠眰闇�瑕侀攣瀹氱殑璺緞
+            List<String> lockPath = shuttleStandbyFrom.getLockPath$();
+
             // 鍏ュ簱鐩爣灞傛湁绌挎杞�
             if (Utils.getLev(shuttleLocNo) == Utils.getLev(task.getDestLoc())) {
 
@@ -151,14 +162,15 @@
                 motionList.addAll(kernelService.liftMoveGoods(
                         MotionDto.build((dto -> {
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
-                            dto.setLev(5);//绱㈢墝椤圭洰5灞傛槸杈撻�佺嚎灞�
-                            dto.setStaNo(1);//鎻愬崌鏈哄乏渚�
+                            dto.setLev(1);//鍏夋嘲1灞傛槸杈撻�佺嚎灞�
+                            dto.setStaNo(31004);//鍏ュ簱绔欑偣
                         }))
                         , MotionDto.build((dto -> {
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
                             dto.setLev(Utils.getLev(task.getDestLoc()));
-                            dto.setStaNo(0);//鎻愬崌鏈哄唴渚�
-                            dto.setSync(0);//寮傛鎵ц
+                            dto.setStaNo(getStaByLev(Utils.getLev(task.getDestLoc())));
+                            dto.setDevpNo(basConveyorStaDest.getConveyorDeviceId().intValue());
+                            dto.setReleaseLift(1);//鎵ц瀹屾垚鍚庨噴鏀炬彁鍗囨満
                         }))
                 ));
 
@@ -170,31 +182,10 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLocNo(standbyLocNoTo);
                         })),
                         MotionCtgType.SHUTTLE_MOVE
-                ));
-
-                // 閿佸畾鎻愬崌鏈�
-                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(standbyLocNoTo);
-                        })),
-                        MotionDto.build((dto -> {
-                            dto.setShuttleNo(shuttleDevice.getId().intValue());
-                            dto.setLiftNo(transferLiftDevice.getId().intValue());
-                            dto.setLocNo(liftLocNoTo);
-                        })),
-                        MotionCtgType.SHUTTLE_MOVE_TO_LIFT
                 ));
 
                 // 绌挎杞﹀叆搴撻《鍗�
@@ -206,30 +197,7 @@
                         MotionCtgType.SHUTTLE_PALLET_LIFT
                 ));
 
-                // 绌挎杞﹀叆搴撶Щ鍔ㄨ嚦鎻愬崌鏈哄緟鏈轰綅
-                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.setLocNo(standbyLocNoFrom);
-                        })),
-                        MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
-                ));
-
-                // 瑙i攣鎻愬崌鏈�
-                motionList.addAll(kernelService.liftUnlock(
-                        null
-                        , MotionDto.build((dto -> {
-                            dto.setLiftNo(transferLiftDevice.getId().intValue());
-                            dto.setReleaseLift(1);//鎵ц瀹屾垚鍚庨噴鏀炬彁鍗囨満
-                        }))
-                ));
-
-                // 绌挎杞﹁蛋琛岃嚦鐩爣搴撲綅
+                // 绌挎杞﹁浇璐ц蛋琛岃嚦鐩爣搴撲綅
                 motionList.addAll(kernelService.shuttleMove(
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
@@ -237,10 +205,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
                 ));
 
                 // 绌挎杞﹀叆搴撴墭鐩樹笅闄�
@@ -254,14 +224,24 @@
 
             /**
              * 浜屻�佸叆搴撶洰鏍囧眰娌℃湁绌挎杞�
-             * 1.鎻愬崌鏈哄崌闄嶅埌绌挎杞﹀眰
-             * 2.绌挎杞﹁蛋琛岃嚦鎻愬崌鏈哄緟鏈轰綅
-             * 3.鎻愬崌鏈烘惉杩愮┛姊溅鑷崇洰鏍囧眰
-             * 4.璐х墿浠庤緭閫佺嚎鍒版彁鍗囨満
-             * 5.鎻愬崌鏈鸿浇杞︿笌璐хЩ鍔紙闈炲繀闇�锛�
-             * 6.绌挎杞﹀叆搴撹嚦鐩爣搴撲綅
              */
             } 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());
+                            dto.setReleaseLift(1);//鎵ц瀹屾垚鍚庨噴鏀炬彁鍗囨満
+                        }))
+                ));
 
                 // 绌挎杞﹁蛋琛岃嚦鎻愬崌鏈哄簱浣嶅緟鏈轰綅
                 motionList.addAll(kernelService.shuttleMove(
@@ -271,10 +251,20 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
                             dto.setLocNo(standbyLocNoTo);
                         })),
                         MotionCtgType.SHUTTLE_MOVE
+                ));
+
+                // 閿佸畾鎹㈠眰璺緞
+                motionList.addAll(kernelService.mapLockPath(
+                        null,
+                        MotionDto.build((dto -> {
+                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setLocNo(JSON.toJSONString(lockPath));
+                        }))
                 ));
 
                 // 鎻愬崌鏈虹┖杞界Щ鍔ㄥ埌绌挎杞﹀眰
@@ -302,6 +292,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
                             dto.setLocNo(liftLocNoTo);
                         })),
@@ -316,17 +307,15 @@
                         }))
                 ));
 
-                // 鎻愬崌鏈鸿浇璐хЩ鍔�
-                motionList.addAll(kernelService.liftMoveGoods(
+                // 鎻愬崌鏈烘惉杞� 鑷� 鐩爣浣嶇疆灞�
+                motionList.addAll(kernelService.liftMoveShuttle(
                         MotionDto.build((dto -> {
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
-                            dto.setLev(5);//绱㈢墝椤圭洰5灞傛槸杈撻�佺嚎灞�
-                            dto.setStaNo(1);//鎻愬崌鏈哄乏渚�
-                        }))
-                        , MotionDto.build((dto -> {
+                            dto.setLev(Utils.getLev(shuttleLocNo));
+                        })),
+                        MotionDto.build((dto -> {
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
-                            dto.setLev(Utils.getLev(task.getDestLoc()));
-                            dto.setStaNo(0);//鎻愬崌鏈哄唴渚�
+                            dto.setLev(Utils.getLev(destLoc));
                         }))
                 ));
 
@@ -338,15 +327,6 @@
                         }))
                 ));
 
-                // 绌挎杞﹀叆搴撻《鍗�
-                motionList.addAll(kernelService.shuttleAction(
-                        null,
-                        MotionDto.build((dto -> {
-                            dto.setShuttleNo(shuttleDevice.getId().intValue());
-                        })),
-                        MotionCtgType.SHUTTLE_PALLET_LIFT
-                ));
-
                 // 鏇存柊灏忚溅鍧愭爣
                 motionList.addAll(kernelService.shuttleUpdateLocation(
                         null
@@ -356,7 +336,7 @@
                         }))
                 ));
 
-                // 绌挎杞﹀叆搴撶Щ鍔ㄨ嚦鎻愬崌鏈哄緟鏈轰綅
+                // 绌挎杞︾Щ鍔ㄨ嚦鎻愬崌鏈哄緟鏈轰綅
                 motionList.addAll(kernelService.shuttleMove(
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
@@ -365,6 +345,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLocNo(standbyLocNoFrom);
                         })),
                         MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
@@ -379,7 +360,25 @@
                         }))
                 ));
 
-                // 绌挎杞﹁蛋琛岃嚦鐩爣搴撲綅
+                // 瑙i攣鎹㈠眰璺緞
+                motionList.addAll(kernelService.mapUnlockPath(
+                        null,
+                        MotionDto.build((dto -> {
+                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setLocNo(JSON.toJSONString(lockPath));
+                        }))
+                ));
+
+                // 绌挎杞﹀叆搴撻《鍗�
+                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());
@@ -387,10 +386,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
                 ));
 
                 // 绌挎杞﹀叆搴撴墭鐩樹笅闄�
@@ -445,6 +445,11 @@
                 return motionList;
             }
 
+            BasConveyorSta basConveyorStaOrigin = basConveyorStaService.selectBySiteNo(task.getOriginSite());
+            if (basConveyorStaOrigin == null) {
+                return motionList;
+            }
+
             //妫�娴嬬┛姊溅鏄惁鏈変换鍔$粦瀹�
             boolean shuttleResult = Utils.checkShuttleHasBinding(shuttleDevice, task.getTaskNo());
             if (shuttleResult) {
@@ -479,8 +484,11 @@
             //绌挎杞﹀嚭鎻愬崌鏈哄緟鏈轰綅搴撲綅鍙�
             String standbyLocNoFrom = shuttleStandbyFrom.getDeviceStandbyLoc();
 
-            //绌挎杞﹀嚭鎻愬崌鏈哄悗灏忚溅寰呮満浣�
-            String shuttleFromLiftStandbyLoc = shuttleStandbyFrom.getStandbyLoc();
+            //绌挎杞﹀嚭鎻愬崌鏈哄悗鍏ㄩ儴寰呮満浣�
+            String standbyLocs = shuttleStandbyFrom.getStandbyLoc();//鑾峰彇鍏ㄩ儴寰呮満浣�
+
+            //鎹㈠眰闇�瑕侀攣瀹氱殑璺緞
+            List<String> lockPath = shuttleStandbyFrom.getLockPath$();
 
             //鑾峰彇鍑哄簱浠诲姟绫诲瀷
             TaskCtg taskCtg = taskCtgService.getOne(new LambdaQueryWrapper<TaskCtg>()
@@ -498,15 +506,14 @@
                 return motionList;
             }
 
+            //鍒嗘瀽鍑哄簱璺緞寰呮満搴撲綅
+            String lastPathStartLoc = shuttleDispatcher.analyzeOutPathWaitLoc(originLoc, standbyLocNoTo, shuttleDevice);
+            if (lastPathStartLoc == null) {
+                return motionList;//鏈垎鏋愭垚鍔�
+            }
+
             /**
              * 鍑哄簱
-             * 涓�銆佸嚭搴撹捣濮嬪眰鏈夌┛姊溅
-             * 1.绌挎杞﹁蛋琛岃嚦鍑哄簱搴撲綅
-             * 2.鎻愬崌鏈哄埌鍑哄簱璧峰灞�
-             * 3.绌挎杞﹀嚭搴撹嚦鎻愬崌鏈�
-             * 4.绌挎杞︾寮�鎻愬崌鏈�
-             * 5.鎻愬崌鏈鸿浇璐хЩ鍔紙闈炲繀闇�锛�
-             * 6.杈撻�佺嚎杩愯緭鑷冲嚭搴撳彛
              */
             if (Utils.getLev(shuttleLocNo) == Utils.getLev(originLoc)) {
 
@@ -520,6 +527,7 @@
                             })),
                             MotionDto.build((dto -> {
                                 dto.setShuttleNo(shuttleDevice.getId().intValue());
+                                dto.setShuttleDevice(shuttleDevice);
                                 dto.setLocNo(originLoc);
                             })),
                             MotionCtgType.SHUTTLE_MOVE
@@ -535,49 +543,36 @@
                         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(originLoc);
+                            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_MOVE
-                ));
-
-                // 鎻愬崌鏈虹┖杞界Щ鍔ㄥ埌绌挎杞﹀眰
-                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(standbyLocNoTo);
-                        })),
-                        MotionDto.build((dto -> {
-                            dto.setShuttleNo(shuttleDevice.getId().intValue());
-                            dto.setLiftNo(transferLiftDevice.getId().intValue());
-                            dto.setLocNo(liftLocNoTo);
-                        })),
-                        MotionCtgType.SHUTTLE_MOVE_TO_LIFT
+                        MotionCtgType.SHUTTLE_TRANSPORT_TO_CONVEYOR
                 ));
 
                 // 绌挎杞﹀嚭搴撴墭鐩樹笅闄�
@@ -589,26 +584,20 @@
                         MotionCtgType.SHUTTLE_PALLET_DOWN
                 ));
 
-                // 绌挎杞︾寮�鎻愬崌鏈� - 鍒版彁鍗囨満寰呮満浣�
+                // 绌挎杞︽彁鍗囨満寰呮満浣� - 鍒板緟鏈轰綅(鑷姩閫夋嫨鍚堥�傚緟鏈轰綅)
                 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.setLocNo(standbyLocNoFrom);
                         })),
-                        MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
-                ));
-
-                // 瑙i攣鎻愬崌鏈�
-                motionList.addAll(kernelService.liftUnlock(
-                        null
-                        , MotionDto.build((dto -> {
-                            dto.setLiftNo(transferLiftDevice.getId().intValue());
-                        }))
+                        MotionDto.build((dto -> {
+                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
+                            dto.setLocNo(standbyLocs);
+                            dto.setSync(0);//寮傛鎵ц
+                            dto.setReleaseShuttle(1);//鎵ц瀹屾垚鍚庨噴鏀惧皬杞�
+                        })),
+                        MotionCtgType.SHUTTLE_MOVE_STANDBY
                 ));
 
                 // 鎻愬崌鏈鸿浇璐хЩ鍔�
@@ -616,55 +605,32 @@
                         MotionDto.build((dto -> {
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
                             dto.setLev(Utils.getLev(task.getOriginLoc()));
-                            dto.setStaNo(0);//鎻愬崌鏈哄唴渚�
+                            dto.setStaNo(getStaByLev(Utils.getLev(task.getOriginLoc())));//璧峰绔欑偣
                         }))
                         , MotionDto.build((dto -> {
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
-                            dto.setLev(5);//绱㈢墝椤圭洰5灞傛槸杈撻�佺嚎灞�
-                            dto.setStaNo(1);//鎻愬崌鏈哄乏渚�
-                            dto.setSync(0);//寮傛鎵ц
+                            dto.setLev(1);//鍏夋嘲1灞傛槸杈撻�佺嚎灞�
+                            dto.setStaNo(31001);//鍑哄簱绔欑偣
+                            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
-                ));
-
                 // 杈撻�佺嚎杩愯緭鑷冲嚭搴撳彛
-                motionList.addAll(kernelService.conveyorOutbound(
-                        MotionDto.build((dto -> {
-                            dto.setDevpNo(basConveyorPath.getDeviceId().intValue());
-                            dto.setStaNo(basConveyorPath.getDeviceStn());
-                        })),
-                        MotionDto.build((dto -> {
-                            dto.setDevpNo(basConveyorPath.getDeviceId().intValue());
-                            dto.setStaNo(basConveyorPath.getStnNo());
-                        })),
-                        MotionCtgType.CONVEYOR_OUTBOUND
-                ));
+//                motionList.addAll(kernelService.conveyorOutbound(
+//                        MotionDto.build((dto -> {
+//                            dto.setDevpNo(basConveyorPath.getDeviceId().intValue());
+//                            dto.setStaNo(basConveyorPath.getDeviceStn());
+//                        })),
+//                        MotionDto.build((dto -> {
+//                            dto.setDevpNo(basConveyorPath.getDeviceId().intValue());
+//                            dto.setStaNo(basConveyorPath.getStnNo());
+//                        })),
+//                        MotionCtgType.CONVEYOR_OUTBOUND
+//                ));
 
             /**
              * 浜屻�佸嚭搴撹捣濮嬪眰娌℃湁绌挎杞�
-             *
-             * 1.鎻愬崌鏈哄埌绌挎杞﹀眰
-             * 2.绌挎杞﹁蛋琛岃嚦鎻愬崌鏈�
-             * 3.鎻愬崌鏈鸿浇杞﹁嚦鍑哄簱璧峰灞�
-             * 4.绌挎杞﹁蛋琛岃嚦鍑哄簱搴撲綅
-             * 5.绌挎杞﹀嚭搴撹嚦鎻愬崌鏈�
-             * 6.绌挎杞︾寮�鎻愬崌鏈�
-             * 7.鎻愬崌鏈鸿浇璐хЩ鍔紙闈炲繀闇�锛�
-             * 8.杈撻�佺嚎杩愯緭鑷冲嚭搴撳彛
-             *
              */
             } else {
 
@@ -676,10 +642,20 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
                             dto.setLocNo(standbyLocNoTo);
                         })),
                         MotionCtgType.SHUTTLE_MOVE
+                ));
+
+                // 閿佸畾鎹㈠眰璺緞
+                motionList.addAll(kernelService.mapLockPath(
+                        null,
+                        MotionDto.build((dto -> {
+                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setLocNo(JSON.toJSONString(lockPath));
+                        }))
                 ));
 
                 // 鎻愬崌鏈虹┖杞界Щ鍔ㄥ埌绌挎杞﹀眰
@@ -707,6 +683,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
                             dto.setLocNo(liftLocNoTo);
                         })),
@@ -759,6 +736,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLocNo(standbyLocNoFrom);
                         })),
                         MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
@@ -773,6 +751,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 -> {
@@ -782,6 +769,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLocNo(originLoc);
                         })),
                         MotionCtgType.SHUTTLE_MOVE
@@ -796,49 +784,36 @@
                         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(originLoc);
+                            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_MOVE
-                ));
-
-                // 鎻愬崌鏈虹┖杞界Щ鍔ㄥ埌鐩爣灞�
-                motionList.addAll(kernelService.liftMove(
-                        null
-                        , MotionDto.build((dto -> {
-                            dto.setLiftNo(transferLiftDevice.getId().intValue());
-                            dto.setLev(Utils.getLev(originLoc));
-                        }))
-                ));
-
-                // 閿佸畾鎻愬崌鏈�
-                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(standbyLocNoFrom);
-                        })),
-                        MotionDto.build((dto -> {
-                            dto.setShuttleNo(shuttleDevice.getId().intValue());
-                            dto.setLiftNo(transferLiftDevice.getId().intValue());
-                            dto.setLocNo(liftLocNoFrom);
-                        })),
-                        MotionCtgType.SHUTTLE_MOVE_TO_LIFT
+                        MotionCtgType.SHUTTLE_TRANSPORT_TO_CONVEYOR
                 ));
 
                 // 绌挎杞﹀嚭搴撴墭鐩樹笅闄�
@@ -850,26 +825,20 @@
                         MotionCtgType.SHUTTLE_PALLET_DOWN
                 ));
 
-                // 绌挎杞︾寮�鎻愬崌鏈� - 鍒版彁鍗囨満寰呮満浣�
+                // 绌挎杞︽彁鍗囨満寰呮満浣� - 鍒板緟鏈轰綅(鑷姩閫夋嫨鍚堥�傚緟鏈轰綅)
                 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.setLocNo(standbyLocNoFrom);
                         })),
-                        MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
-                ));
-
-                // 瑙i攣鎻愬崌鏈�
-                motionList.addAll(kernelService.liftUnlock(
-                        null
-                        , MotionDto.build((dto -> {
-                            dto.setLiftNo(transferLiftDevice.getId().intValue());
-                        }))
+                        MotionDto.build((dto -> {
+                            dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
+                            dto.setLocNo(standbyLocs);
+                            dto.setSync(0);//寮傛鎵ц
+                            dto.setReleaseShuttle(1);//鎵ц瀹屾垚鍚庨噴鏀惧皬杞�
+                        })),
+                        MotionCtgType.SHUTTLE_MOVE_STANDBY
                 ));
 
                 // 鎻愬崌鏈鸿浇璐хЩ鍔�
@@ -877,41 +846,29 @@
                         MotionDto.build((dto -> {
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
                             dto.setLev(Utils.getLev(task.getOriginLoc()));
-                            dto.setStaNo(0);//鎻愬崌鏈哄唴渚�
+                            dto.setStaNo(getStaByLev(Utils.getLev(task.getOriginLoc())));//璧峰绔欑偣
                         }))
                         , MotionDto.build((dto -> {
                             dto.setLiftNo(transferLiftDevice.getId().intValue());
-                            dto.setLev(5);//绱㈢墝椤圭洰5灞傛槸杈撻�佺嚎灞�
-                            dto.setStaNo(1);//鎻愬崌鏈哄乏渚�
-                            dto.setSync(0);//寮傛鎵ц
+                            dto.setLev(1);//鍏夋嘲1灞傛槸杈撻�佺嚎灞�
+                            dto.setStaNo(31001);//鍑哄簱绔欑偣
+                            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
-                ));
-
                 // 杈撻�佺嚎杩愯緭鑷冲嚭搴撳彛
-                motionList.addAll(kernelService.conveyorOutbound(
-                        MotionDto.build((dto -> {
-                            dto.setDevpNo(basConveyorPath.getDeviceId().intValue());
-                            dto.setStaNo(basConveyorPath.getDeviceStn());
-                        })),
-                        MotionDto.build((dto -> {
-                            dto.setDevpNo(basConveyorPath.getDeviceId().intValue());
-                            dto.setStaNo(basConveyorPath.getStnNo());
-                        })),
-                        MotionCtgType.CONVEYOR_OUTBOUND
-                ));
+//                motionList.addAll(kernelService.conveyorOutbound(
+//                        MotionDto.build((dto -> {
+//                            dto.setDevpNo(basConveyorPath.getDeviceId().intValue());
+//                            dto.setStaNo(basConveyorPath.getDeviceStn());
+//                        })),
+//                        MotionDto.build((dto -> {
+//                            dto.setDevpNo(basConveyorPath.getDeviceId().intValue());
+//                            dto.setStaNo(basConveyorPath.getStnNo());
+//                        })),
+//                        MotionCtgType.CONVEYOR_OUTBOUND
+//                ));
 
             }
 
@@ -1010,6 +967,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLocNo(chargeLocNo);
                     })),
                     MotionCtgType.SHUTTLE_MOVE
@@ -1025,6 +983,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLocNo(standbyLocNoTo);
                     })),
                     MotionCtgType.SHUTTLE_MOVE
@@ -1055,6 +1014,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLiftNo(transferLiftDevice.getId().intValue());
                         dto.setLocNo(liftLocNoTo);
                     })),
@@ -1107,6 +1067,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLocNo(standbyLocNoFrom);
                     })),
                     MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
@@ -1128,13 +1089,12 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLocNo(chargeLocNo);
                     })),
                     MotionCtgType.SHUTTLE_MOVE
             ));
 
-            task.setLiftNo(Integer.parseInt(transferLiftDevice.getDeviceNo()));
-            taskService.updateById(task);
         }
 
         // 绌挎杞﹀紑濮嬪厖鐢�
@@ -1198,6 +1158,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLocNo(locNo);
                     })),
                     MotionCtgType.SHUTTLE_MOVE
@@ -1252,6 +1213,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(shuttleDevice.getId().intValue());
+                            dto.setShuttleDevice(shuttleDevice);
                             dto.setLocNo(locNo);
                         })),
                         MotionCtgType.SHUTTLE_MOVE
@@ -1280,6 +1242,9 @@
             //绌挎杞﹀嚭鎻愬崌鏈哄緟鏈轰綅搴撲綅鍙�
             String standbyLocNoFrom = liftDispatcher.getLiftStandByLocNo(liftThread, Utils.getLev(task.getDestLoc()));
 
+            //鎹㈠眰闇�瑕侀攣瀹氱殑璺緞
+            List<String> lockPath = liftDispatcher.getLockPathByLocNo(liftThread, Utils.getLev(task.getDestLoc()));
+
 
             // 绌挎杞﹁蛋琛岃嚦鎻愬崌鏈哄簱浣嶅緟鏈轰綅
             motionList.addAll(kernelService.shuttleMove(
@@ -1289,10 +1254,20 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLiftNo(liftDevice.getId().intValue());
                         dto.setLocNo(standbyLocNoTo);
                     })),
                     MotionCtgType.SHUTTLE_MOVE
+            ));
+
+            // 閿佸畾鎹㈠眰璺緞
+            motionList.addAll(kernelService.mapLockPath(
+                    null,
+                    MotionDto.build((dto -> {
+                        dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setLocNo(JSON.toJSONString(lockPath));
+                    }))
             ));
 
             // 鎻愬崌鏈虹┖杞界Щ鍔ㄥ埌绌挎杞﹀眰
@@ -1320,18 +1295,11 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLiftNo(liftDevice.getId().intValue());
                         dto.setLocNo(liftLocNoTo);
                     })),
                     MotionCtgType.SHUTTLE_MOVE_TO_LIFT
-            ));
-
-            // 鍚戞彁鍗囨満鍙戦�佸皬杞﹀凡鍒颁綅淇″彿
-            motionList.addAll(kernelService.liftShuttleArrival(
-                    null
-                    , MotionDto.build((dto -> {
-                        dto.setLiftNo(liftDevice.getId().intValue());
-                    }))
             ));
 
             // 瑙i攣鎻愬崌鏈�
@@ -1380,6 +1348,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLocNo(standbyLocNoFrom);
                     })),
                     MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
@@ -1393,6 +1362,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 -> {
@@ -1402,6 +1380,7 @@
                     })),
                     MotionDto.build((dto -> {
                         dto.setShuttleNo(shuttleDevice.getId().intValue());
+                        dto.setShuttleDevice(shuttleDevice);
                         dto.setLocNo(locNo);
                     })),
                     MotionCtgType.SHUTTLE_MOVE
@@ -1422,7 +1401,7 @@
 
         String sourceLoc = task.getOriginLoc();//婧愬簱浣�
         String targetLoc = task.getDestLoc();//浠诲姟鐩爣(鍊熺敤瀛楁)
-        String targetSite = task.getDestSite();//浠诲姟绫诲瀷(鍊熺敤瀛楁)
+        String targetSite = task.getMemo();//浠诲姟绫诲瀷(鍊熺敤瀛楁)
 
         Device device = deviceService.getOne(new LambdaQueryWrapper<Device>()
                 .eq(Device::getDeviceNo, task.getShuttleNo())
@@ -1457,6 +1436,7 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(device.getId().intValue());
+                            dto.setShuttleDevice(device);
                             dto.setLocNo(targetLoc);
                         })),
                         MotionCtgType.SHUTTLE_MOVE
@@ -1509,6 +1489,7 @@
                             })),
                             MotionDto.build((dto -> {
                                 dto.setShuttleNo(device.getId().intValue());
+                                dto.setShuttleDevice(device);
                                 dto.setLocNo(sourceLoc);
                             })),
                             MotionCtgType.SHUTTLE_MOVE
@@ -1522,7 +1503,7 @@
                     motion.setMotionCtg(MotionCtgType.SHUTTLE_PALLET_LIFT.val());
                 }));
 
-                // 绌挎杞﹁蛋琛岃嚦鐩爣搴撲綅
+                // 绌挎杞﹁浇璐ц蛋琛岃嚦鐩爣搴撲綅
                 motionList.addAll(kernelService.shuttleMove(
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(device.getId().intValue());
@@ -1530,9 +1511,10 @@
                         })),
                         MotionDto.build((dto -> {
                             dto.setShuttleNo(device.getId().intValue());
+                            dto.setShuttleDevice(device);
                             dto.setLocNo(targetLoc);
                         })),
-                        MotionCtgType.SHUTTLE_MOVE
+                        MotionCtgType.SHUTTLE_TRANSPORT
                 ));
 
                 //鎵樼洏涓嬮檷
@@ -1566,7 +1548,8 @@
             return motionList;
         }
 
-        if (task.getDestSite().equals("move")) {
+        String destSite = task.getMemo();//浠诲姟鐩爣(鍊熺敤瀛楁)
+        if (destSite.equals("move")) {
             //鎻愬崌鏈哄崌闄嶆ゼ灞�
 
             // 鎻愬崌鏈虹┖杞界Щ鍔ㄥ埌绌挎杞﹀眰
@@ -1578,23 +1561,45 @@
                     }))
             ));
 
-        } else if (task.getDestSite().equals("movePallet")) {
+        } else if (destSite.equals("movePallet")) {
             //绉诲姩鎵樼洏
+            BasConveyorSta basConveyorStaOrigin = basConveyorStaService.selectBySiteNo(task.getOriginSite());
+            BasConveyorSta basConveyorStaDest = basConveyorStaService.selectBySiteNo(task.getDestSite());
+            if(basConveyorStaOrigin == null || basConveyorStaDest == null) {
+                return motionList;
+            }
 
             // 鎻愬崌鏈虹Щ鍔ㄦ墭鐩�
             motionList.addAll(kernelService.liftMoveGoods(
                     MotionDto.build((dto -> {
                         dto.setLiftNo(device.getId().intValue());
-                        dto.setLev(Integer.parseInt(task.getOriginLoc()));
+                        dto.setLev(Utils.getLev(basConveyorStaOrigin.getLocNo()));
                         dto.setStaNo(Integer.parseInt(task.getOriginSite()));
                     }))
                     , MotionDto.build((dto -> {
                         dto.setLiftNo(device.getId().intValue());
-                        dto.setLev(Integer.parseInt(task.getDestLoc()));
+                        dto.setLev(Utils.getLev(basConveyorStaDest.getLocNo()));
+                        dto.setDevpNo(basConveyorStaDest.getConveyorDeviceId().intValue());
                         dto.setStaNo(Integer.parseInt(task.getDestSite()));
                     }))
             ));
 
+        } else if (destSite.equals("lock")) {
+            // 閿佸畾鎻愬崌鏈�
+            motionList.addAll(kernelService.liftLock(
+                    null
+                    , MotionDto.build((dto -> {
+                        dto.setLiftNo(device.getId().intValue());
+                    }))
+            ));
+        } else if (destSite.equals("unlock")) {
+            // 瑙i攣鎻愬崌鏈�
+            motionList.addAll(kernelService.liftUnlock(
+                    null
+                    , MotionDto.build((dto -> {
+                        dto.setLiftNo(device.getId().intValue());
+                    }))
+            ));
         }
 
         return motionList;

--
Gitblit v1.9.1