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

---
 zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java          |   22 +++++-----
 zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/ValidService.java         |   40 ++++++++++----------
 zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/OpenController.java |    6 +-
 3 files changed, 34 insertions(+), 34 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 9337548..381ac11 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:
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/ValidService.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/ValidService.java
index aff806f..31435f3 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/ValidService.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/ValidService.java
@@ -41,7 +41,7 @@
         List<Task> taskList = new ArrayList<>();
         for (TaskDto taskDto : taskDtoList) {
             if (Cools.isEmpty(taskDto.getSeqNum())) {
-                throw new BusinessException("seqNum涓嶈兘涓虹┖");
+                throw new BusinessException("Task seqNum can't be empty!");
             }
             Task task = new Task();
             taskList.add(task);
@@ -53,14 +53,14 @@
             if (!Cools.isEmpty(taskDto.getOriLoc())) {
                 Loc oriLoc = locService.selecatByLocNo(taskDto.getOriLoc());
                 if (null == oriLoc) {
-                    throw new BusinessException("oriLoc: " + taskDto.getOriLoc() + "涓嶅瓨鍦�");
+                    throw new BusinessException("oriLoc: " + taskDto.getOriLoc() + " doesn't exist!");
                 }
                 task.setOriLoc(oriLoc.getId());
             }
             if (!Cools.isEmpty(taskDto.getOriSta())) {
                 Sta oriSta = staService.selectByStaNo(taskDto.getOriSta());
                 if (null == oriSta) {
-                    throw new BusinessException("oriSta: " + taskDto.getOriSta() + "涓嶅瓨鍦�");
+                    throw new BusinessException("oriSta: " + taskDto.getOriSta() + " doesn't exist!");
                 }
                 task.setOriSta(oriSta.getId());
             }
@@ -68,7 +68,7 @@
             if (!Cools.isEmpty(taskDto.getDestLoc())) {
                 Loc destLoc = locService.selecatByLocNo(taskDto.getDestLoc());
                 if (null == destLoc) {
-                    throw new BusinessException("destLoc: " + taskDto.getDestLoc() + "涓嶅瓨鍦�");
+                    throw new BusinessException("destLoc: " + taskDto.getDestLoc() + " doesn't exist!");
                 }
                 task.setDestLoc(destLoc.getId());
                 task.setDestCode(destLoc.getCode());
@@ -76,7 +76,7 @@
             if (!Cools.isEmpty(taskDto.getDestSta())) {
                 Sta destSta = staService.selectByStaNo(taskDto.getDestSta());
                 if (null == destSta) {
-                    throw new BusinessException("destSta: " + taskDto.getDestSta() + "涓嶅瓨鍦�");
+                    throw new BusinessException("destSta: " + taskDto.getDestSta() + " doesn't exist!");
                 }
                 task.setDestSta(destSta.getId());
                 task.setDestCode(destSta.getCode());
@@ -84,16 +84,16 @@
 
             // task-type ----------------------------------
             if (null == task.getOriLoc() && null == task.getOriSta()) {
-                throw new BusinessException(task.getSeqNum() + " 閿欒锛宱riLoc鍜宱riSta蹇呴』瀛樺湪涓�椤�");
+                throw new BusinessException("seNum:" + task.getSeqNum() + " is wrong锛宼here must be at least one of oriLoc and oriSta");
             }
             if (null != task.getOriLoc() && null != task.getOriSta()) {
-                throw new BusinessException(task.getSeqNum() + " 閿欒锛宱riLoc鍜宱riSta鍙兘瀛樺湪涓�椤�");
+                throw new BusinessException("seNum:" + task.getSeqNum() + " is wrong锛宼here must be at least one of oriLoc and oriSta");
             }
             if (null == task.getDestLoc() && null == task.getDestSta()) {
-                throw new BusinessException(task.getSeqNum() + " 閿欒锛宒estLoc鍜宒estSta蹇呴』瀛樺湪涓�椤�");
+                throw new BusinessException("seNum:" + task.getSeqNum() + " is wrong锛宔ither destLoc and destSta must be present");
             }
             if (null != task.getDestLoc() && null != task.getDestSta()) {
-                throw new BusinessException(task.getSeqNum() + " 閿欒锛宒estLoc鍜宒estSta鍙兘瀛樺湪涓�椤�");
+                throw new BusinessException("seNum:" + task.getSeqNum() + " is wrong锛宔ither destLoc and destSta must be present");
             }
             if (null != task.getOriSta()) {
                 if (null != task.getDestLoc()) {
@@ -128,14 +128,14 @@
                     startCode = codeService.getById(oriLoc.getCode());
                     endCode = codeService.getById(destLoc.getCode());
                     if (null == startCode) {
-                        throw new BusinessException("oriLoc锛�" + oriLoc.getLocNo() + " 鏈粦瀹氬湴闈㈢爜");
+                        throw new BusinessException("oriLoc锛�" + oriLoc.getLocNo() + " hasn't been bound to a QrCode yet");
                     }
                     if (null == endCode) {
-                        throw new BusinessException("destLoc锛�" + destLoc.getLocNo() + " 鏈粦瀹氬湴闈㈢爜");
+                        throw new BusinessException("destLoc锛�" + destLoc.getLocNo() + " is not bound to a QrCode yet");
                     }
                     pathList = mapService.validFeasibility(startCode, endCode);
                     if (Cools.isEmpty(pathList)) {
-                        throw new BusinessException(task.getSeqNum() + "浠诲姟閿欒锛宱riLoc锛�" + task.getOriLoc() + "鏃犳硶琛岃蛋鑷� destLoc" + task.getDestLoc());
+                        throw new BusinessException("seqNum:" + task.getSeqNum() + " is wrong锛宱riLoc锛�" + task.getOriLoc() + " is unable to reach destLoc" + task.getDestLoc());
                     }
                     task.setPhase(JSON.toJSONString(pathList));
                     break;
@@ -146,14 +146,14 @@
                     startCode = codeService.getById(oriLoc.getCode());
                     endCode = codeService.getById(destSta.getCode());
                     if (null == startCode) {
-                        throw new BusinessException("oriLoc锛�" + oriLoc.getLocNo() + " 鏈粦瀹氬湴闈㈢爜");
+                        throw new BusinessException("oriLoc锛�" + oriLoc.getLocNo() + " hasn't been bound to QrCode yet");
                     }
                     if (null == endCode) {
-                        throw new BusinessException("destSta锛�" + destSta.getStaNo() + " 鏈粦瀹氬湴闈㈢爜");
+                        throw new BusinessException("destSta锛�" + destSta.getStaNo() + " is not bound to QrCode yet");
                     }
                     pathList = mapService.validFeasibility(startCode, endCode);
                     if (Cools.isEmpty(pathList)) {
-                        throw new BusinessException(task.getSeqNum() + "浠诲姟閿欒锛宱riLoc锛�" + task.getOriLoc() + "鏃犳硶琛岃蛋鑷� destSta" + task.getDestSta());
+                        throw new BusinessException("seqNum:" + task.getSeqNum() + " is wrong锛宱riLoc锛�" + task.getOriLoc() + " can't move to destSta" + task.getDestSta());
                     }
                     task.setPhase(JSON.toJSONString(pathList));
                     break;
@@ -164,14 +164,14 @@
                     startCode = codeService.getById(oriSta.getCode());
                     endCode = codeService.getById(destLoc.getCode());
                     if (null == startCode) {
-                        throw new BusinessException("oriSta锛�" + oriSta.getStaNo() + " 鏈粦瀹氬湴闈㈢爜");
+                        throw new BusinessException("oriSta锛�" + oriSta.getStaNo() + " hasn't bound to QrCode yet");
                     }
                     if (null == endCode) {
-                        throw new BusinessException("destLoc锛�" + destLoc.getLocNo() + " 鏈粦瀹氬湴闈㈢爜");
+                        throw new BusinessException("destLoc锛�" + destLoc.getLocNo() + " is not bound to QrCode yet");
                     }
                     pathList = mapService.validFeasibility(startCode, endCode);
                     if (Cools.isEmpty(pathList)) {
-                        throw new BusinessException(task.getSeqNum() + "浠诲姟閿欒锛宱riSta锛�" + task.getOriSta() + "鏃犳硶琛岃蛋鑷� destLoc" + task.getDestLoc());
+                        throw new BusinessException("seqNum:" + task.getSeqNum() + " is wrong锛宱riSta锛�" + task.getOriSta() + " is unable to react destLoc" + task.getDestLoc());
                     }
                     task.setPhase(JSON.toJSONString(pathList));
                     break;
@@ -189,12 +189,12 @@
                     }
                     pathList = mapService.validFeasibility(startCode, endCode);
                     if (Cools.isEmpty(pathList)) {
-                        throw new BusinessException(task.getSeqNum() + "浠诲姟閿欒锛宱riSta锛�" + task.getOriSta() + "鏃犳硶琛岃蛋鑷� destSta" + task.getDestSta());
+                        throw new BusinessException("seqNum:" + task.getSeqNum() + " is wrong锛宱riSta锛�" + task.getOriSta() + " can't move to destSta" + task.getDestSta());
                     }
                     task.setPhase(JSON.toJSONString(pathList));
                     break;
                 default:
-                    throw new BusinessException(task.getSeqNum() + "浠诲姟绫诲瀷閿欒");
+                    throw new BusinessException("seqNum:" + task.getSeqNum() + " is wrong锛� cause this type not exist");
             }
 
         }
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/OpenController.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/OpenController.java
index fba286a..1711b4d 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/OpenController.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/OpenController.java
@@ -16,7 +16,7 @@
 /**
  * Created by vincent on 2023/6/12
  */
-@Api(tags = "寮�鏀惧钩鍙�")
+@Api(tags = "Open Api")
 @RestController
 @RequestMapping("/api/open")
 public class OpenController extends BaseController {
@@ -26,10 +26,10 @@
 
     @PreAuthorize("hasAuthority('open:bus:submit')")
     @PostMapping("/bus/submit")
-    @OperationLog("浠诲姟涓嬪彂")
+    @OperationLog("generate task from open api")
     public R save(@RequestBody OpenBusSubmitParam param) {
         mainService.generateBusAndTask(param, null);
-        return R.ok("淇濆瓨鎴愬姛");
+        return R.ok("generate tasks success");
     }
 
 }

--
Gitblit v1.9.1