From ce2d24454495d6f145dc8af7936b31541b2fdfa3 Mon Sep 17 00:00:00 2001 From: zhang <zc857179121@qq.com> Date: 星期三, 06 八月 2025 13:29:47 +0800 Subject: [PATCH] 保存一个版本 --- zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/ReportThirdScheduler.java | 29 ++++++++++++++++++++++++++++- 1 files changed, 28 insertions(+), 1 deletions(-) diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/ReportThirdScheduler.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/ReportThirdScheduler.java index 1d8ada4..aa94167 100644 --- a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/ReportThirdScheduler.java +++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/ReportThirdScheduler.java @@ -1,10 +1,13 @@ package com.zy.acs.manager.core.scheduler; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.zy.acs.common.utils.RedisSupport; import com.zy.acs.framework.common.SnowflakeIdWorker; import com.zy.acs.manager.core.service.MainLockWrapService; import com.zy.acs.manager.core.service.MainService; import com.zy.acs.manager.core.service.TrafficService; +import com.zy.acs.manager.core.utils.HttpHandler; import com.zy.acs.manager.manager.entity.TaskReport; import com.zy.acs.manager.manager.service.*; import com.zy.acs.manager.system.service.ConfigService; @@ -14,6 +17,7 @@ import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; +import java.io.IOException; import java.util.List; @Slf4j @@ -24,6 +28,9 @@ @Autowired private TaskReportService taskReportService; + @Autowired + private ConfigService configService; + // @Scheduled(fixedDelay = 1000) public void execute() { @@ -31,11 +38,31 @@ // for (TaskReport taskReport : list) { // report(taskReport); // } + + String wmsUrl = configService.getVal("WMS_URL", String.class); + String wmsPath = configService.getVal("WMS_PATH", String.class); } @Transactional - public void report(TaskReport taskReport) { + public void report(TaskReport taskReport,String wmsUrl,String wmsPath) { //TODO 鍘熷厛搴旇璋冪敤鎺ュ彛锛岀幇鍦ㄧ洿鎺ヤ慨鏀规暟鎹� + String response = null; + try { + response = new HttpHandler.Builder() + .setUri(wmsUrl) + .setPath(wmsPath) + .setJson(JSON.toJSONString(taskReport)) + .build() + .doPost(); + JSONObject jsonObject = JSON.parseObject(response); + if (jsonObject.getInteger("code").equals(200)) { + } + } catch (IOException e) { + throw new RuntimeException(e); + } + JSONObject jsonObject = JSON.parseObject(response); } + + } -- Gitblit v1.9.1