From 165bc19e548f7d05c6f0332587a5f8e0496b9b55 Mon Sep 17 00:00:00 2001
From: pang.jiabao <pang_jiabao@163.com>
Date: 星期二, 21 十月 2025 20:21:38 +0800
Subject: [PATCH] 侧面输送线出库条码对接
---
src/main/java/com/zy/asrs/task/TaskReportScheduler.java | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 53 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/zy/asrs/task/TaskReportScheduler.java b/src/main/java/com/zy/asrs/task/TaskReportScheduler.java
index e6f44f2..f574cce 100644
--- a/src/main/java/com/zy/asrs/task/TaskReportScheduler.java
+++ b/src/main/java/com/zy/asrs/task/TaskReportScheduler.java
@@ -31,11 +31,13 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
+import java.util.List;
/**
* 瀹氭椂灏嗕换鍔�(瀹屾垚銆佸彇娑�)杞垚鏃ュ織
@@ -80,6 +82,57 @@
add(301);add(302);add(303);add(304);add(305);add(306);add(307);add(308);
}};
+ // WMS鍒嗛厤鍏ュ簱搴撲綅寮傚父涓婃姤
+ @Scheduled(cron = "0/5 * * * * ? ")
+ @Transactional
+ public synchronized void locationAssignmentExceptionEscalation() {
+ List<TaskWrk> taskWrkList = taskWrkMapper.selectList(new EntityWrapper<TaskWrk>().eq("wrk_sts", 5));
+
+ for(TaskWrk taskWrk : taskWrkList) {
+ Date now = new Date();
+ WmsFeedback wmsFeedback = new WmsFeedback();
+ wmsFeedback.setTaskNo(taskWrk.getTaskNo());
+ wmsFeedback.setIoType(taskWrk.getIoType());
+ wmsFeedback.setBarcode(taskWrk.getBarcode());
+ wmsFeedback.setStatus(-1); // 鍏ュ簱搴撲綅鍒嗛厤寮傚父
+ wmsFeedback.setReportTime(DateUtils.convert(now));
+
+ String response = "";
+ boolean bool = false;
+ try {
+ log.info("鍏ュ簱wms鍒嗛厤搴撲綅鏈夎涓婃姤wms={}", taskWrk);
+ response = new HttpHandler.Builder()
+ // .setHeaders(headParam)
+ .setUri(wmsUrl)
+ .setPath(TaskExecCallback)
+ .setJson(JSON.toJSONString(wmsFeedback))
+ .build()
+ .doPost();
+ if (!Cools.isEmpty(response)) {
+ JSONObject jsonObject = JSON.parseObject(response);
+ if (Integer.parseInt(String.valueOf(jsonObject.get("code"))) == 200) {
+ bool = true;
+ taskWrk.setWrkSts(6);
+ taskWrk.setModiTime(now);
+ taskWrkMapper.updateById(taskWrk);
+ }
+ }
+
+ } catch (Exception e) {
+ log.error("鍏ュ簱wms鍒嗛厤搴撲綅鏈夎涓婃姤wms澶辫触{},杩斿洖鍊�={}", taskWrk, response);
+ } finally {
+ apiLogService.save("wms鍒嗛厤搴撲綅鏈夎涓婃姤"
+ , wmsUrl + TaskExecCallback
+ , null
+ , "127.0.0.1"
+ , JSON.toJSONString(wmsFeedback)
+ , response
+ , bool
+ );
+ }
+ }
+ }
+
@Scheduled(cron = "0/5 * * * * ? ")
public synchronized void execute() throws IOException {
Page<TaskWrkReport> taskWrkReportPage = taskWrkReportService.selectPage(new Page<>(0, 100), new EntityWrapper<TaskWrkReport>().orderBy("create_time", true));
--
Gitblit v1.9.1