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) {