From f182168e6f0b6c408b7a58630c9eb9a12eb55067 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo <583671871@qq.com> Date: Wed, 24 Jul 2024 11:22:21 +0800 Subject: [PATCH] =?UTF-8?q?feat(all):=20=E4=BF=AE=E6=94=B9=E6=A2=A6?= =?UTF-8?q?=E5=A4=A9=E5=9B=9E=E4=BC=A0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mengtian/controller/OrderController.java | 2 +- .../mengtian/mq/NodeDataPushListener.java | 39 +++++++++++++++++-- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/controller/OrderController.java b/blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/controller/OrderController.java index 958de7abc..47a332709 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/controller/OrderController.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/controller/OrderController.java @@ -39,7 +39,7 @@ public class OrderController { public R sendMsg(@RequestBody Map vo) { log.info("推送工厂订单:{} ", JSONUtil.toJsonStr(vo)); rabbitTemplate.convertAndSend(FactoryDataConstants.Mq.Exchanges.NODE_DATA_PUSH, - FactoryDataConstants.Mq.RoutingKeys.LINSY_NODE_DATA_PUSH, JSONUtil.toJsonStr(vo)); + FactoryDataConstants.Mq.RoutingKeys.MENGTIAN_NODE_DATA_PUSH, JSONUtil.toJsonStr(vo)); return R.success("成功"); } diff --git a/blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/mq/NodeDataPushListener.java b/blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/mq/NodeDataPushListener.java index 64b94341c..7d46ff848 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/mq/NodeDataPushListener.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/mq/NodeDataPushListener.java @@ -10,6 +10,9 @@ import cn.hutool.http.HttpUtil; import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.json.JsonMapper; import com.logpm.factory.mt.dto.MtPushDataDTO; import com.logpm.factory.mt.feign.MtFactoryDataClient; import com.logpm.factorydata.feign.IFactoryDataClient; @@ -117,7 +120,14 @@ public class NodeDataPushListener { if (CollUtil.isNotEmpty(collect)) { for (CentralStkInVO centralStkInVO : collect) { // 按包件维度推送 - sendFactory(JSONUtil.toJsonStr(centralStkInVO), "mt.poc.ht_yc_noms.CentralStkIn", mengTianProperties.getCentralStkInUrl()); + ObjectMapper objectMapper = new JsonMapper(); + String s = null; + try { + s = objectMapper.writeValueAsString(centralStkInVO); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + sendFactory(s, "mt.poc.ht_yc_noms.CentralStkIn", mengTianProperties.getCentralStkInUrl()); } } } @@ -153,7 +163,14 @@ public class NodeDataPushListener { .build(); }).collect(Collectors.toList()) ).build(); - sendFactory(JSONUtil.toJsonStr(confirmVO), "mt.poc.ht_yc_noms.CentralStkInConfirm", mengTianProperties.getCentralStkInConfirmUrl()); + ObjectMapper objectMapper = new JsonMapper(); + String s = null; + try { + s = objectMapper.writeValueAsString(confirmVO); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + sendFactory(s, "mt.poc.ht_yc_noms.CentralStkInConfirm", mengTianProperties.getCentralStkInConfirmUrl()); } } } @@ -180,7 +197,14 @@ public class NodeDataPushListener { }).collect(Collectors.toList()); if (CollUtil.isNotEmpty(signForVOS)) { for (SignForVO signForVO : signForVOS) { - sendFactory(JSONUtil.toJsonStr(signForVO), "mt.poc.ht_yc_noms.SignFor", mengTianProperties.getSignForUrl()); + ObjectMapper objectMapper = new JsonMapper(); + String s = null; + try { + s = objectMapper.writeValueAsString(signForVO); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + sendFactory(s, "mt.poc.ht_yc_noms.SignFor", mengTianProperties.getSignForUrl()); } } } @@ -214,7 +238,14 @@ public class NodeDataPushListener { ).collect(Collectors.toList())) .imageVOS(imageVOS) .build(); - sendFactory(JSONUtil.toJsonStr(confirmVO), "mt.poc.ht_yc_noms.SignForConfirm", mengTianProperties.getSignForConfirmUrl()); + ObjectMapper objectMapper = new JsonMapper(); + String s = null; + try { + s = objectMapper.writeValueAsString(confirmVO); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + sendFactory(s, "mt.poc.ht_yc_noms.SignForConfirm", mengTianProperties.getSignForConfirmUrl()); } }