From 787e2917c8113a56ee58fc3a6ae11b0cd5f8e133 Mon Sep 17 00:00:00 2001
From: vincentlu <t1341870251@gmail.com>
Date: 星期五, 26 十二月 2025 14:11:49 +0800
Subject: [PATCH] #
---
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java | 38 ++++++++++----------------------------
1 files changed, 10 insertions(+), 28 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 b6d1b34..2c2fa0e 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
@@ -96,6 +96,8 @@
private LaneService laneService;
@Autowired
private ActionSorter actionSorter;
+ @Autowired
+ private StaReserveService staReserveService;
@SuppressWarnings("all")
@Transactional
@@ -176,24 +178,14 @@
}
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.READY_RELEASE.val());
- destSta.setUpdateTime(now);
- if (!staService.updateById(destSta)) {
- throw new BusinessException("destSta锛�" + task.getDestSta$() + " failed to update");
+ if (null == staReserveService.reserveStaIn(destSta, task, 1)) {
+ throw new BusinessException("destSta锛�" + task.getDestSta$() + " failed to reserve");
}
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.READY_TAKE.val());
- oriSta.setUpdateTime(now);
- if (!staService.updateById(oriSta)) {
- throw new BusinessException("oriSta锛�" + task.getOriSta$() + " failed to update");
+ if (null == staReserveService.reserveStaOut(oriSta, task, 1)) {
+ throw new BusinessException("oriSta锛�" + task.getOriSta$() + " failed to reserve");
}
destLoc = locService.getById(task.getDestLoc());
@@ -208,23 +200,13 @@
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.READY_TAKE.val());
- oriSta.setUpdateTime(now);
- if (!staService.updateById(oriSta)) {
- throw new BusinessException("oriSta锛�" + task.getOriSta$() + " failed to update");
+ if (null == staReserveService.reserveStaOut(oriSta, task, 1)) {
+ throw new BusinessException("oriSta锛�" + task.getOriSta$() + " failed to reserve");
}
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.READY_RELEASE.val());
- destSta.setUpdateTime(now);
- if (!staService.updateById(destSta)) {
- throw new BusinessException("destSta锛�" + task.getDestSta$() + " failed to update");
+ if (null == staReserveService.reserveStaIn(destSta, task, 1)) {
+ throw new BusinessException("destSta锛�" + task.getDestSta$() + " failed to reserve");
}
break;
default:
--
Gitblit v1.9.1