From dcfa44798f2c01efdda47f7cfa0a9b5290c7f18d Mon Sep 17 00:00:00 2001
From: 野心家 <1051256694@qq.com>
Date: 星期一, 25 十一月 2024 16:40:10 +0800
Subject: [PATCH] 新增历史档重新上报功能
---
src/main/java/com/zy/asrs/task/TaskLogScheduler.java | 31 ++++++++++++-------------------
1 files changed, 12 insertions(+), 19 deletions(-)
diff --git a/src/main/java/com/zy/asrs/task/TaskLogScheduler.java b/src/main/java/com/zy/asrs/task/TaskLogScheduler.java
index 3e48136..30ce97c 100644
--- a/src/main/java/com/zy/asrs/task/TaskLogScheduler.java
+++ b/src/main/java/com/zy/asrs/task/TaskLogScheduler.java
@@ -64,26 +64,12 @@
for (TaskWrk taskWrk : taskWrkService.selectToBeHistoryData()) {
HashMap<String, Object> headParam = new HashMap<>();
if (taskWrk.getStatus().equals(TaskStatusType.OVER.id)||taskWrk.getStatus()==7) {//瀹屾垚
- //鍖哄垎鍏ュ嚭搴�
- TaskWrkLog taskWrkLog = new TaskWrkLog(taskWrk);
- if (!wrkLogService.insert(taskWrkLog)) {
- throw new CoolException("杞巻鍙叉。澶辫触" + taskWrkLog);
- }
- if (!taskWrkService.deleteById(taskWrk)) {
- throw new CoolException("浠诲姟妗e垹闄ゅけ璐�" + taskWrkLog);
- }
headParam.put("Result", 1);
} else if (taskWrk.getStatus().equals(TaskStatusType.CANCEL.id)) {
- TaskWrkLog taskWrkLog=new TaskWrkLog(taskWrk);
- if(!wrkLogService.insert(taskWrkLog)){
- throw new CoolException("杞巻鍙叉。澶辫触"+taskWrkLog);
- }
- if(!taskWrkService.deleteById(taskWrk)){
- throw new CoolException("浠诲姟妗e垹闄ゅけ璐�"+taskWrkLog);
- }
headParam.put("Result", 2);
}
String response = "";
+ Boolean bool = false;
try {
headParam.put("TaskNo", taskWrk.getTaskNo());
log.info("wcs鎵嬪姩瀹屾垚浠诲姟涓婃姤wms={}", taskWrk);
@@ -95,10 +81,20 @@
.build()
.doPost();
JSONObject jsonObject = JSON.parseObject(response);
- Boolean bool = false;
+
if(jsonObject.get("ReturnStatus").equals(0)){
+ TaskWrkLog taskWrkLog=new TaskWrkLog(taskWrk);
+ if(!wrkLogService.insert(taskWrkLog)){
+ throw new CoolException("杞巻鍙叉。澶辫触"+taskWrkLog);
+ }
+ if(!taskWrkService.deleteById(taskWrk)){
+ throw new CoolException("浠诲姟妗e垹闄ゅけ璐�"+taskWrkLog);
+ }
bool = true;
}
+ } catch (Exception e) {
+ log.error("wcs鎵嬪姩瀹屾垚浠诲姟涓婃姤wms澶辫触{},杩斿洖鍊�={}", taskWrk, response);
+ }finally {
apiLogService.save("wcs瀹屾垚鎴栬�呭彇娑堜换鍔′笂鎶ms"
, wmsUrl + TaskExecCallback
, null
@@ -107,10 +103,7 @@
, response
, bool
);
- } catch (Exception e) {
- log.error("wcs鎵嬪姩瀹屾垚浠诲姟涓婃姤wms澶辫触{},杩斿洖鍊�={}", taskWrk, response);
}
-
}
}
--
Gitblit v1.9.1