Browse Source

feat(all): 修改金牌手动回推逻辑

1 增加金牌手动回推时老数据查不到的情况,增加去老系统查询的逻辑
visual
zhaoqiaobo 5 months ago
parent
commit
1289e6e0d6
  1. 26
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mq/NodeDataPushListener.java
  2. 4
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/pros/JinPaiProperties.java

26
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mq/NodeDataPushListener.java

@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.UUID;
import cn.hutool.core.util.EnumUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
@ -98,9 +99,31 @@ public class NodeDataPushListener {
log.info("订单数据为空,不处理:{}", JSONUtil.toJsonStr(content));
return;
}
for (String sendOrderCode : orderCodes) {
// 先从新系统查,如果查不到,去老系统查一次
List<PushOrderDetailEntity> orderDetailEntities = pushOrderDetailService.list(Wrappers.<PushOrderDetailEntity>lambdaQuery()
.in(PushOrderDetailEntity::getCustomItemNo, orderCodes)
.in(PushOrderDetailEntity::getCustomItemNo, sendOrderCode)
);
if (CollUtil.isEmpty(orderDetailEntities)) {
// 去老系统查
if(StrUtil.isNotEmpty(jinPaiProperties.getOldSystemHost()) && StrUtil.isNotEmpty(jinPaiProperties.getFindOldDataUrl())){
try {
String result = HttpUtil.get(jinPaiProperties.getOldSystemHost() + jinPaiProperties.getFindOldDataUrl() + "?orderCode=" + sendOrderCode);
if(StrUtil.isNotEmpty(result)){
JSONObject jsonObject = JSONUtil.parseObj(result);
Integer code = jsonObject.getInt("code");
if(NumberUtil.equals(code, 200)){
JSONArray data = jsonObject.getJSONArray("data");
if (CollUtil.isNotEmpty(data)) {
orderDetailEntities = data.toList(PushOrderDetailEntity.class);
}
}
}
}catch (Exception e){
log.error("老系统查询失败",e);
}
}
}
if (CollUtil.isEmpty(orderDetailEntities)) {
log.info("未查到包件数据,不处理:{}", JSONUtil.toJsonStr(content));
return;
@ -232,6 +255,7 @@ public class NodeDataPushListener {
}
}
}
}
private boolean checkData(String msg) {
if (StrUtil.isEmpty(msg)) {

4
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/pros/JinPaiProperties.java

@ -18,6 +18,10 @@ public class JinPaiProperties {
* 金牌工厂推送节点数据url
*/
private String pushNodeUrl;
/**
* 金牌查询老数据查询老系统数据URL
*/
private String findOldDataUrl = "/openApi/jinpai/code-query";
/**
* 是否推送工厂
*/

Loading…
Cancel
Save