From 3b8bd7dbba101f4207a08bf0254a9e58bc708348 Mon Sep 17 00:00:00 2001
From: vincentlu <t1341870251@gmail.com>
Date: 星期一, 19 一月 2026 13:34:12 +0800
Subject: [PATCH] #
---
zy-acs-manager/src/main/java/com/zy/acs/manager/core/HandlerController.java | 39 ++++++++++++++++++++++++++++++++++++++-
1 files changed, 38 insertions(+), 1 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 3e352d0..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")
@@ -171,7 +173,7 @@
task.setPriority(999);
task.setIoTime(now);
task.setStartTime(now);
- task.setMemo("HANDLE");
+ task.setMemo("AUTO");
if (!taskService.save(task)) {
throw new BusinessException(task.getSeqNum() + "浠诲姟淇濆瓨澶辫触");
}
@@ -192,6 +194,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