Browse Source

feat(all): 增加梦天回传总线开关

dist.1.2.0^2
zhaoqiaobo 5 months ago
parent
commit
f239bf9ba0
  1. 15
      blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/mq/NodeDataPushListener.java

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

Loading…
Cancel
Save