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