From f239bf9ba0a85f1bff23d42ecac0548b33e73f90 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo <583671871@qq.com> Date: Thu, 29 Aug 2024 15:28:24 +0800 Subject: [PATCH] =?UTF-8?q?feat(all):=20=E5=A2=9E=E5=8A=A0=E6=A2=A6?= =?UTF-8?q?=E5=A4=A9=E5=9B=9E=E4=BC=A0=E6=80=BB=E7=BA=BF=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mengtian/mq/NodeDataPushListener.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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 485ba3af9..084ab93f4 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 @@ -75,8 +75,10 @@ public class NodeDataPushListener { log.info("接收到节点数据推送:{}", msg); // 1 校验数据 if (checkData(msg)) { + log.info("数据校验不通过"); return; } + JSONObject entries = JSONUtil.parseObj(msg); // 节点 String node = entries.getStr("node"); @@ -335,12 +337,17 @@ public class NodeDataPushListener { entity.setOperationCode(operationCode); entity.setSendUrl(mengTianProperties.getHost() + url); String resBody = ""; + String resultCode = ""; try { - HttpResponse execute = post.execute(); - resBody = execute.body(); + if(mengTianProperties.getEnable()){ + HttpResponse execute = post.execute(); + resBody = execute.body(); + JSONObject entries = JSONUtil.parseObj(resBody); + resultCode = entries.getStr("Result"); + } else { + resBody = "总线推送开关未开启"; + } log.info("推送工厂结果:{}", resBody); - JSONObject entries = JSONUtil.parseObj(resBody); - String resultCode = entries.getStr("Result"); entity.setResultContent(resBody); entity.setSendStatus(StrUtil.isEmpty(resultCode) ? "-1" : resultCode); } catch (Exception e) {