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 | 46 ++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 42 insertions(+), 4 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 e14d05b..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
@@ -35,7 +35,7 @@
import com.zy.acs.manager.system.service.ConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
@@ -47,7 +47,7 @@
* Created by vincent on 2023/6/14
*/
@Slf4j
-@Component("mainService")
+@Service("mainService")
public class MainService {
@Autowired
@@ -96,7 +96,6 @@
private LaneService laneService;
@Autowired
private ActionSorter actionSorter;
-
@SuppressWarnings("all")
@Transactional
@@ -175,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");
@@ -188,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;
@@ -223,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