|
|
|
@ -328,23 +328,24 @@ public class NodeDataPushListener {
|
|
|
|
|
HttpRequest post = HttpUtil.createPost(mengTianProperties.getHost() + url); |
|
|
|
|
post.header("ClientId", "mt.ht"); |
|
|
|
|
post.header("OperationCode", operationCode); |
|
|
|
|
post.timeout(5000); |
|
|
|
|
post.timeout(30000); |
|
|
|
|
post.body(body); |
|
|
|
|
// 存入日志表
|
|
|
|
|
entity.setContent(body); |
|
|
|
|
entity.setOperationCode(operationCode); |
|
|
|
|
entity.setSendUrl(mengTianProperties.getHost() + url); |
|
|
|
|
String resBody = ""; |
|
|
|
|
try { |
|
|
|
|
HttpResponse execute = post.execute(); |
|
|
|
|
String resBody = execute.body(); |
|
|
|
|
resBody = execute.body(); |
|
|
|
|
log.info("推送工厂结果:{}", resBody); |
|
|
|
|
JSONObject entries = JSONUtil.parseObj(resBody); |
|
|
|
|
String resultCode = entries.getStr("Result"); |
|
|
|
|
entity.setResultContent(resBody); |
|
|
|
|
entity.setSendStatus(StrUtil.isEmpty(resultCode) ? "0" : resultCode); |
|
|
|
|
entity.setSendStatus(StrUtil.isEmpty(resultCode) ? "-1" : resultCode); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
entity.setResultContent(e.getMessage()); |
|
|
|
|
entity.setSendStatus("0"); |
|
|
|
|
entity.setResultContent(resBody); |
|
|
|
|
entity.setSendStatus("-1"); |
|
|
|
|
} |
|
|
|
|
factoryNodePushService.save(entity); |
|
|
|
|
} |
|
|
|
|