From d59d4495574968e23e520da71f89790f0ad09df0 Mon Sep 17 00:00:00 2001
From: vincentlu <t1341870251@gmail.com>
Date: 星期二, 01 四月 2025 11:06:09 +0800
Subject: [PATCH] #

---
 zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java |   41 ++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 40 insertions(+), 1 deletions(-)

diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java
index d75aff1..e49c524 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java
@@ -174,8 +174,28 @@
                     if (!locService.updateById(oriLoc)) {
                         throw new BusinessException("oriLoc锛�" + task.getOriLoc$() + " failed to update");
                     }
+
+                    destSta = staService.getById(task.getDestSta());
+                    if (!destSta.getStaSts().equals(StaStsType.IDLE.val())) {
+                        throw new BusinessException("destSta锛�" + task.getDestSta$() + " is not in IDLE status");
+                    }
+                    destSta.setStaSts(StaStsType.PAKIN.val());
+                    destSta.setUpdateTime(now);
+                    if (!staService.updateById(destSta)) {
+                        throw new BusinessException("destSta锛�" + task.getDestSta$() + " failed to update");
+                    }
                     break;
                 case STA_TO_LOC:
+                    oriSta = staService.getById(task.getOriSta());
+                    if (!oriSta.getStaSts().equals(StaStsType.STOCK.val())) {
+                        throw new BusinessException("oriSta锛�" + task.getOriSta$() + " is not in STOCK status");
+                    }
+                    oriSta.setStaSts(StaStsType.PAKOUT.val());
+                    oriSta.setUpdateTime(now);
+                    if (!staService.updateById(oriSta)) {
+                        throw new BusinessException("oriSta锛�" + task.getOriSta$() + " failed to update");
+                    }
+
                     destLoc = locService.getById(task.getDestLoc());
                     if (!destLoc.getLocSts().equals(LocStsType.IDLE.val())) {
                         throw new BusinessException("destLoc锛�" + task.getDestLoc$() + " is not in IDLE status");
@@ -187,6 +207,25 @@
                     }
                     break;
                 case STA_TO_STA:
+                    oriSta = staService.getById(task.getOriSta());
+                    if (!oriSta.getStaSts().equals(StaStsType.STOCK.val())) {
+                        throw new BusinessException("oriSta锛�" + task.getOriSta$() + " is not in STOCK status");
+                    }
+                    oriSta.setStaSts(StaStsType.PAKOUT.val());
+                    oriSta.setUpdateTime(now);
+                    if (!staService.updateById(oriSta)) {
+                        throw new BusinessException("oriSta锛�" + task.getOriSta$() + " failed to update");
+                    }
+
+                    destSta = staService.getById(task.getDestSta());
+                    if (!destSta.getStaSts().equals(StaStsType.IDLE.val())) {
+                        throw new BusinessException("destSta锛�" + task.getDestSta$() + " is not in IDLE status");
+                    }
+                    destSta.setStaSts(StaStsType.PAKIN.val());
+                    destSta.setUpdateTime(now);
+                    if (!staService.updateById(destSta)) {
+                        throw new BusinessException("destSta锛�" + task.getDestSta$() + " failed to update");
+                    }
                     break;
                 default:
                     break;
@@ -222,7 +261,7 @@
             for (Task task : taskList) {
                 Agv agv = allocateService.execute(task);
                 if (null == agv) {
-//                    log.warn("Task[{}] has an issue锛� because it failed to checkout agv which is idle...", task.getSeqNum());
+//                    log.warn("Task[{}] has an issue锛� because it failed to check out agv which is idle...", task.getSeqNum());
                     continue;
                 }
                 task.setAgvId(agv.getId());

--
Gitblit v1.9.1