Browse Source

feat(all): 修改梦天回传逻辑

dist.1.3.0
zhaoqiaobo 6 months ago
parent
commit
f182168e6f
  1. 2
      blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/controller/OrderController.java
  2. 39
      blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/mq/NodeDataPushListener.java

2
blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/controller/OrderController.java

@ -39,7 +39,7 @@ public class OrderController {
public R sendMsg(@RequestBody Map vo) {
log.info("推送工厂订单:{} ", JSONUtil.toJsonStr(vo));
rabbitTemplate.convertAndSend(FactoryDataConstants.Mq.Exchanges.NODE_DATA_PUSH,
FactoryDataConstants.Mq.RoutingKeys.LINSY_NODE_DATA_PUSH, JSONUtil.toJsonStr(vo));
FactoryDataConstants.Mq.RoutingKeys.MENGTIAN_NODE_DATA_PUSH, JSONUtil.toJsonStr(vo));
return R.success("成功");
}

39
blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/mq/NodeDataPushListener.java

@ -10,6 +10,9 @@ import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.json.JsonMapper;
import com.logpm.factory.mt.dto.MtPushDataDTO;
import com.logpm.factory.mt.feign.MtFactoryDataClient;
import com.logpm.factorydata.feign.IFactoryDataClient;
@ -117,7 +120,14 @@ public class NodeDataPushListener {
if (CollUtil.isNotEmpty(collect)) {
for (CentralStkInVO centralStkInVO : collect) {
// 按包件维度推送
sendFactory(JSONUtil.toJsonStr(centralStkInVO), "mt.poc.ht_yc_noms.CentralStkIn", mengTianProperties.getCentralStkInUrl());
ObjectMapper objectMapper = new JsonMapper();
String s = null;
try {
s = objectMapper.writeValueAsString(centralStkInVO);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
sendFactory(s, "mt.poc.ht_yc_noms.CentralStkIn", mengTianProperties.getCentralStkInUrl());
}
}
}
@ -153,7 +163,14 @@ public class NodeDataPushListener {
.build();
}).collect(Collectors.toList())
).build();
sendFactory(JSONUtil.toJsonStr(confirmVO), "mt.poc.ht_yc_noms.CentralStkInConfirm", mengTianProperties.getCentralStkInConfirmUrl());
ObjectMapper objectMapper = new JsonMapper();
String s = null;
try {
s = objectMapper.writeValueAsString(confirmVO);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
sendFactory(s, "mt.poc.ht_yc_noms.CentralStkInConfirm", mengTianProperties.getCentralStkInConfirmUrl());
}
}
}
@ -180,7 +197,14 @@ public class NodeDataPushListener {
}).collect(Collectors.toList());
if (CollUtil.isNotEmpty(signForVOS)) {
for (SignForVO signForVO : signForVOS) {
sendFactory(JSONUtil.toJsonStr(signForVO), "mt.poc.ht_yc_noms.SignFor", mengTianProperties.getSignForUrl());
ObjectMapper objectMapper = new JsonMapper();
String s = null;
try {
s = objectMapper.writeValueAsString(signForVO);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
sendFactory(s, "mt.poc.ht_yc_noms.SignFor", mengTianProperties.getSignForUrl());
}
}
}
@ -214,7 +238,14 @@ public class NodeDataPushListener {
).collect(Collectors.toList()))
.imageVOS(imageVOS)
.build();
sendFactory(JSONUtil.toJsonStr(confirmVO), "mt.poc.ht_yc_noms.SignForConfirm", mengTianProperties.getSignForConfirmUrl());
ObjectMapper objectMapper = new JsonMapper();
String s = null;
try {
s = objectMapper.writeValueAsString(confirmVO);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
sendFactory(s, "mt.poc.ht_yc_noms.SignForConfirm", mengTianProperties.getSignForConfirmUrl());
}
}

Loading…
Cancel
Save