From 7a68bbe9a032df8c54b2263be097002e01383bce Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 23 十月 2024 13:58:26 +0800
Subject: [PATCH] #

---
 zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java |   32 ++++++++++++++++++--------------
 1 files changed, 18 insertions(+), 14 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 434718d..21feeaa 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
@@ -101,7 +101,7 @@
         String batch = busSubmitParam.getBatch();
         List<TaskDto> taskDtoList = busSubmitParam.getTaskList();
         if (Cools.isEmpty(taskDtoList)) {
-            throw new BusinessException("taskDtoList 涓嶈兘涓虹┖");
+            throw new BusinessException("taskList can't be empty!");
         }
 
         // 浼樺厛绾ф帓搴�
@@ -120,7 +120,7 @@
         bus.setMemo(memo);
 
         if (!busService.save(bus)) {
-            throw new BusinessException("浠诲姟淇濆瓨澶辫触");
+            throw new BusinessException("Internal Server Error!");
         }
 
         // 淇濆瓨浠诲姟
@@ -128,7 +128,7 @@
             task.setBusId(bus.getId());
             task.setTaskSts(TaskStsType.INIT.val());
             if (!taskService.save(task)) {
-                throw new BusinessException(task.getSeqNum() + "浠诲姟淇濆瓨澶辫触");
+                throw new BusinessException("seqNum:" + task.getSeqNum() + " failed to save!");
             }
 
             // 淇敼搴撲綅鐘舵��
@@ -140,44 +140,44 @@
                 case LOC_TO_LOC:
                     oriLoc = locService.getById(task.getOriLoc());
                     if (!oriLoc.getLocSts().equals(LocStsType.STOCK.val())) {
-                        throw new BusinessException("oriLoc锛�" + task.getOriLoc$() + " 涓嶆槸鍦ㄥ簱鐘舵��");
+                        throw new BusinessException("oriLoc锛�" + task.getOriLoc$() + " is not in STOCK status");
                     }
                     oriLoc.setLocSts(LocStsType.PAKOUT.val());
                     oriLoc.setUpdateTime(now);
                     if (!locService.updateById(oriLoc)) {
-                        throw new BusinessException("oriLoc锛�" + task.getOriLoc$() + " 淇敼搴撲綅鐘舵�佸け璐�");
+                        throw new BusinessException("oriLoc锛�" + task.getOriLoc$() + " failed to update");
                     }
 
                     destLoc = locService.getById(task.getDestLoc());
                     if (!destLoc.getLocSts().equals(LocStsType.IDLE.val())) {
-                        throw new BusinessException("destLoc锛�" + task.getDestLoc$() + " 涓嶆槸绌洪棽鐘舵��");
+                        throw new BusinessException("destLoc锛�" + task.getDestLoc$() + " is not in IDLE status");
                     }
                     destLoc.setLocSts(LocStsType.PAKIN.val());
                     destLoc.setUpdateTime(now);
                     if (!locService.updateById(destLoc)) {
-                        throw new BusinessException("destLoc锛�" + task.getDestLoc$() + " 淇敼搴撲綅鐘舵�佸け璐�");
+                        throw new BusinessException("destLoc锛�" + task.getDestLoc$() + " failed to update");
                     }
                     break;
                 case LOC_TO_STA:
                     oriLoc = locService.getById(task.getOriLoc());
                     if (!oriLoc.getLocSts().equals(LocStsType.STOCK.val())) {
-                        throw new BusinessException("oriLoc锛�" + task.getOriLoc$() + " 涓嶆槸鍦ㄥ簱鐘舵��");
+                        throw new BusinessException("oriLoc锛�" + task.getOriLoc$() + " is not in STOCK status");
                     }
                     oriLoc.setLocSts(LocStsType.PAKOUT.val());
                     oriLoc.setUpdateTime(now);
                     if (!locService.updateById(oriLoc)) {
-                        throw new BusinessException("oriLoc锛�" + task.getOriLoc$() + " 淇敼搴撲綅鐘舵�佸け璐�");
+                        throw new BusinessException("oriLoc锛�" + task.getOriLoc$() + " failed to update");
                     }
                     break;
                 case STA_TO_LOC:
                     destLoc = locService.getById(task.getDestLoc());
                     if (!destLoc.getLocSts().equals(LocStsType.IDLE.val())) {
-                        throw new BusinessException("destLoc锛�" + task.getDestLoc$() + " 涓嶆槸绌洪棽鐘舵��");
+                        throw new BusinessException("destLoc锛�" + task.getDestLoc$() + " is not in IDLE status");
                     }
                     destLoc.setLocSts(LocStsType.PAKIN.val());
                     destLoc.setUpdateTime(now);
                     if (!locService.updateById(destLoc)) {
-                        throw new BusinessException("destLoc锛�" + task.getDestLoc$() + " 淇敼搴撲綅鐘舵�佸け璐�");
+                        throw new BusinessException("destLoc锛�" + task.getDestLoc$() + " failed to update");
                     }
                     break;
                 case STA_TO_STA:
@@ -207,7 +207,7 @@
                 bus.setBusSts(BusStsType.PROGRESS.val());
                 bus.setUpdateTime(now);
                 if (!busService.updateById(bus)) {
-                    log.error("Bus [{}] 鏇存柊澶辫触 锛侊紒锛�", bus.getUuid());
+                    log.error("Bus [{}] failed to Update 锛侊紒锛�", bus.getUuid());
                 }
                 return;
             }
@@ -217,7 +217,7 @@
             for (Task task : taskList) {
                 Agv agv = missionAssignService.execute(task, taskAllot, taskIds);
                 if (null == agv) {
-                    log.warn("{}浠诲姟寮傚父锛屾棤娉曟绱㈢┖闂睞gv...", task.getSeqNum());
+                    log.warn("Task[{}] has an issue锛� because it failed to checkout agv which is idle...", task.getSeqNum());
                     continue;
                 }
 
@@ -227,7 +227,7 @@
                 task.setIoTime(now);
                 task.setUpdateTime(now);
                 if (!taskService.updateById(task)) {
-                    throw new BusinessException(task.getSeqNum() + "浠诲姟鏇存柊澶辫触");
+                    throw new BusinessException("seqNum: " + task.getSeqNum() + " failed to update");
                 }
 
                 if (taskAllot.containsKey(agv.getUuid())) {
@@ -999,6 +999,7 @@
             }
             for (Action action : actionList) {
                 action.setActionSts(ActionStsType.ISSUED.val());
+                action.setStartTime(now);
                 action.setUpdateTime(now);
                 if (!actionService.updateById(action)) {
                     throw new BusinessException(action.getPriority() + " - " + action.getName() + "鍔ㄤ綔鏇存柊澶辫触");
@@ -1148,6 +1149,7 @@
 
                             if (null != action) {
                                 action.setActionSts(ActionStsType.FINISH.val());
+                                action.setEndTime(now);
                                 action.setUpdateTime(now);
                                 if (!actionService.updateById(action)) {
                                     log.error("Action [{}] 鏇存柊澶辫触 锛侊紒锛�", action.getPriority() + " - " + action.getName());
@@ -1180,6 +1182,7 @@
                             );
                             if (null != action) {
                                 action.setActionSts(ActionStsType.FINISH.val());
+                                action.setEndTime(now);
                                 action.setUpdateTime(now);
                                 if (!actionService.updateById(action)) {
                                     log.error("Action [{}] 鏇存柊澶辫触 锛侊紒锛�", action.getPriority() + " - " + action.getName());
@@ -1254,6 +1257,7 @@
                 );
                 for (Action action : actionList) {
                     action.setActionSts(ActionStsType.FINISH.val());
+                    action.setEndTime(now);
                     action.setUpdateTime(now);
                     if (!actionService.updateById(action)) {
                         log.error("Action [{}] 鏇存柊澶辫触 锛侊紒锛�", action.getPriority() + " - " + action.getName());

--
Gitblit v1.9.1