From 43412c20ac444392471ea8ea8bc4a93af39efe87 Mon Sep 17 00:00:00 2001
From: vincentlu <t1341870251@gmail.com>
Date: 星期一, 19 一月 2026 13:17:27 +0800
Subject: [PATCH] #

---
 zy-acs-manager/src/main/java/com/zy/acs/manager/core/HandlerController.java |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/HandlerController.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/HandlerController.java
index 0814a51..4cedd28 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/HandlerController.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/HandlerController.java
@@ -75,6 +75,8 @@
     private PatrolService patrolService;
     @Autowired
     private StaReserveService staReserveService;
+    @Autowired
+    private AgvAreaDispatcher agvAreaDispatcher;
 
     @PreAuthorize("hasAuthority('manager:agv:update')")
     @OperationLog("Locate All Agv")
@@ -193,6 +195,9 @@
                 if (null == endCode) {
                     return R.error();
                 }
+                if (!agvAreaDispatcher.match(agv.getId(), endCode.getId())) {
+                    throw new BusinessException("AGV " + agv.getUuid() + " failed to reach target code " + endCode.getData());
+                }
                 if (!taskService.removeById(task.getId())) {
                     throw new BusinessException("failed to remove task");
                 }
@@ -222,6 +227,10 @@
                 if (null == oriLoc) {
                     return R.error();
                 }
+                if (!agvAreaDispatcher.match(agv.getId(), oriLoc.getCode())) {
+//                    throw new BusinessException("AGV " + agv.getUuid() + " failed to reach target code " + oriLoc.getCode$());
+                    throw new BusinessException("AGV銆�" + agv.getUuid() + "銆戞棤娉曞埌杈捐捣濮嬪簱浣嶃��" + oriLoc.getLocNo() + "銆�");
+                }
                 if (!oriLoc.getLocSts().equals(LocStsType.STOCK.val())) {
                     throw new BusinessException("oriLoc锛�" + oriLoc.getLocNo() + " 涓嶆槸鍦ㄥ簱鐘舵��");
                 }
@@ -240,6 +249,10 @@
                 }
                 if (null == destLoc) {
                     return R.error();
+                }
+                if (!agvAreaDispatcher.match(agv.getId(), destLoc.getCode())) {
+//                    throw new BusinessException("AGV " + agv.getUuid() + " failed to reach target code " + destLoc.getCode$());
+                    throw new BusinessException("AGV銆�" + agv.getUuid() + "銆戞棤娉曞埌杈剧洰鏍囧簱浣嶃��" + destLoc.getLocNo() + "銆�");
                 }
                 if (!destLoc.getLocSts().equals(LocStsType.IDLE.val())) {
                     throw new BusinessException("destLoc锛�" + destLoc.getLocNo() + " 涓嶆槸绌洪棽鐘舵��");
@@ -267,6 +280,10 @@
                 if (null == oriLoc) {
                     return R.error();
                 }
+                if (!agvAreaDispatcher.match(agv.getId(), oriLoc.getCode())) {
+//                    throw new BusinessException("AGV " + agv.getUuid() + " failed to reach target code " + oriLoc.getCode$());
+                    throw new BusinessException("AGV銆�" + agv.getUuid() + "銆戞棤娉曞埌杈捐捣濮嬪簱浣嶃��" + oriLoc.getLocNo() + "銆�");
+                }
                 if (!oriLoc.getLocSts().equals(LocStsType.STOCK.val())) {
                     throw new BusinessException("oriLoc锛�" + oriLoc.getLocNo() + " 涓嶆槸鍦ㄥ簱鐘舵��");
                 }
@@ -285,6 +302,10 @@
                 }
                 if (null == destSta) {
                     return R.error();
+                }
+                if (!agvAreaDispatcher.match(agv.getId(), destSta.getCode())) {
+//                    throw new BusinessException("AGV " + agv.getUuid() + " failed to reach target code " + destSta.getCode$());
+                    throw new BusinessException("AGV銆�" + agv.getUuid() + "銆戞棤娉曞埌杈剧洰鏍囩珯鐐广��" + destSta.getStaNo() + "銆�");
                 }
                 if (null == staReserveService.reserveStaIn(destSta, task, 1)) {
                     throw new BusinessException("destSta锛�" + destSta.getStaNo() + " 棰勭害澶辫触");
@@ -308,6 +329,10 @@
                 if (null == oriSta) {
                     return R.error();
                 }
+                if (!agvAreaDispatcher.match(agv.getId(), oriSta.getCode())) {
+//                    throw new BusinessException("AGV " + agv.getUuid() + " failed to reach target code " + oriSta.getCode$());
+                    throw new BusinessException("AGV銆�" + agv.getUuid() + "銆戞棤娉曞埌杈捐捣濮嬬珯鐐广��" + oriSta.getStaNo() + "銆�");
+                }
                 if (null == staReserveService.reserveStaOut(oriSta, task, 1)) {
                     throw new BusinessException("oriSta锛�" + oriSta.getStaNo() + " 棰勭害澶辫触");
                 }
@@ -321,6 +346,10 @@
                 }
                 if (null == destLoc) {
                     return R.error();
+                }
+                if (!agvAreaDispatcher.match(agv.getId(), destLoc.getCode())) {
+//                    throw new BusinessException("AGV " + agv.getUuid() + " failed to reach target code " + destLoc.getCode$());
+                    throw new BusinessException("AGV銆�" + agv.getUuid() + "銆戞棤娉曞埌杈剧洰鏍囧簱浣嶃��" + destLoc.getLocNo() + "銆�");
                 }
                 if (!destLoc.getLocSts().equals(LocStsType.IDLE.val())) {
                     throw new BusinessException("destLoc锛�" + destLoc.getLocNo() + " 涓嶆槸绌洪棽鐘舵��");
@@ -350,6 +379,10 @@
                 if (null == oriSta) {
                     return R.error();
                 }
+                if (!agvAreaDispatcher.match(agv.getId(), oriSta.getCode())) {
+//                    throw new BusinessException("AGV " + agv.getUuid() + " failed to reach target code " + oriSta.getCode$());
+                    throw new BusinessException("AGV銆�" + agv.getUuid() + "銆戞棤娉曞埌杈捐捣濮嬬珯鐐广��" + oriSta.getStaNo() + "銆�");
+                }
                 if (null == staReserveService.reserveStaOut(oriSta, task, 1)) {
                     throw new BusinessException("oriSta锛�" + oriSta.getStaNo() + " 棰勭害澶辫触");
                 }
@@ -365,6 +398,10 @@
                 if (null == destSta) {
                     return R.error();
                 }
+                if (!agvAreaDispatcher.match(agv.getId(), destSta.getCode())) {
+//                    throw new BusinessException("AGV " + agv.getUuid() + " failed to reach target code " + destSta.getCode$());
+                    throw new BusinessException("AGV銆�" + agv.getUuid() + "銆戞棤娉曞埌杈剧洰鏍囩珯鐐广��" + destSta.getStaNo() + "銆�");
+                }
                 if (null == staReserveService.reserveStaIn(destSta, task, 1)) {
                     throw new BusinessException("destSta锛�" + destSta.getStaNo() + " 棰勭害澶辫触");
                 }

--
Gitblit v1.9.1