From e5d4f7368a9a184fd54e802faffa082344db5e80 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo <583671871@qq.com> Date: Tue, 19 Nov 2024 15:37:56 +0800 Subject: [PATCH] =?UTF-8?q?feat(all):=20=E6=88=91=E4=B9=90=E5=B7=A5?= =?UTF-8?q?=E5=8E=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1 增加我乐工厂自动拉取订单数据 --- .../logpm/factorydata/olo/job/PullOrderDataJob.java | 12 ++++++------ .../logpm/factorydata/olo/pros/OldProperties.java | 4 ++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/job/PullOrderDataJob.java b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/job/PullOrderDataJob.java index f4e66b273..4890a7d29 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/job/PullOrderDataJob.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/job/PullOrderDataJob.java @@ -7,6 +7,7 @@ import cn.hutool.http.HttpUtil; import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; +import com.logpm.factorydata.olo.pros.OldProperties; import com.logpm.factorydata.olo.service.DeliveryNoteService; import com.logpm.factorydata.olo.vo.DeliveryNoteVO; import com.xxl.job.core.biz.model.ReturnT; @@ -30,6 +31,7 @@ import java.util.stream.Collectors; public class PullOrderDataJob { private final DeliveryNoteService deliveryNoteService; + private final OldProperties oldProperties; /** * 定时获取老系统数据 @@ -46,16 +48,14 @@ public class PullOrderDataJob { } else { oldParam.put("date", DateUtil.today()); } - String s = HttpUtil.get("http://twms.huitongys.com/openApi/new-system/wole-data", oldParam); - log.info("请求返回==》 {}", s); - if(StrUtil.isNotEmpty(s)){ + String s = HttpUtil.get(oldProperties.getPullOrderUrl(), oldParam); + if (StrUtil.isNotEmpty(s)) { JSONObject entries = JSONUtil.parseObj(s); JSONArray data = entries.getJSONArray("data"); List vos = data.stream().map(p -> BeanUtil.toBean(p, DeliveryNoteVO.class)).collect(Collectors.toList()); - log.info("vos==>{}",JSONUtil.toJsonStr(vos)); - String res = ""; try { - // res = deliveryNoteService.order(vos); + log.info("拉取老系统订单数:{}", vos.size()); + deliveryNoteService.order(vos); } catch (Exception e) { log.error("工厂订单异常:{} ", e); } diff --git a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/pros/OldProperties.java b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/pros/OldProperties.java index eb61e5085..c1d00319a 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/pros/OldProperties.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/pros/OldProperties.java @@ -15,6 +15,10 @@ public class OldProperties { * 推送节点数据到来系统的 url */ private String pushNodeUrl; + /** + * 拉取我乐老系统订单 url + */ + private String pullOrderUrl; /** 是否推送工厂 */ private Boolean enable = true;