Browse Source

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

1 增加末端仓卸车扫描回推工厂逻辑
visual
zhaoqiaobo 3 months ago
parent
commit
a7a47b36f1
  1. 18
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mq/NodeDataPushListener.java

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

@ -140,9 +140,9 @@ public class NodeDataPushListener {
return;
}
// 订单 warehouse 不为空为干线,否则为仓配,推送干线的同时回推仓配
Map<String, String> orderCodeMap = orderDetailEntities.stream().collect(Collectors.toMap(PushOrderDetailEntity::getOrderId, PushOrderDetailEntity::getCustomItemNo));
// Map<String, String> orderCodeMap = orderDetailEntities.stream().collect(Collectors.toMap(PushOrderDetailEntity::getOrderId, PushOrderDetailEntity::getCustomItemNo));
Map<String, PushOrderDetailEntity> detailEntityMap = orderDetailEntities.stream().collect(Collectors.toMap(PushOrderDetailEntity::getCustomItemNo, v -> v));
List<String> orderIds = orderDetailEntities.stream().map(PushOrderDetailEntity::getOrderId).collect(Collectors.toList());
// List<String> orderIds = orderDetailEntities.stream().map(PushOrderDetailEntity::getOrderId).collect(Collectors.toList());
// Map<String, PushOrderEntity> pushOrderEntityMap = new HashMap<>();
// if (CollUtil.isNotEmpty(orderIds)) {
// List<PushOrderEntity> pushOrderEntities = pushOrderService.listByIds(orderIds);
@ -166,8 +166,8 @@ public class NodeDataPushListener {
}
JSONObject mainJson = JSONUtil.parseObj(main);
// 到站 一个订单只发送一次
for (String orderCode : orderCodes) {
if (pushEntityMap.containsKey(orderCode)) {
// for (String orderCode : orderCodes) {
if (pushEntityMap.containsKey(sendOrderCode)) {
continue;
}
String arriveFor = "carrier";
@ -175,7 +175,7 @@ public class NodeDataPushListener {
if (ObjectUtil.isNotEmpty(pushOrderEntity) && StrUtil.isNotEmpty(pushOrderEntity.getWarehouse())) {
arriveFor = "stock";
}
PushOrderDetailEntity pushOrderDetailEntity = detailEntityMap.get(orderCode);
PushOrderDetailEntity pushOrderDetailEntity = detailEntityMap.get(sendOrderCode);
String boxCodeList = pushOrderDetailEntity.getBoxCodeList();
JSONArray boxCodeListJson = JSONUtil.parseArray(boxCodeList);
// JSONArray details = new JSONArray();
@ -185,9 +185,9 @@ public class NodeDataPushListener {
detail.set(item.toString(), 1);
// details.add(jsonObject);
});
if (!CollUtil.contains(pushEntityMap.keySet(), orderCode)) {
if (!CollUtil.contains(pushEntityMap.keySet(), sendOrderCode)) {
JSONObject js = new JSONObject();
js.set("extOrderNo", orderCode);
js.set("extOrderNo", sendOrderCode);
js.set("extWaybillNO", mainJson.getStr("serviceNumber"));
js.set("detail", detail);
// js.set("shipNo", mainJson.getStr("waybillNumber"));
@ -218,7 +218,7 @@ public class NodeDataPushListener {
log.info("推送工厂结果:{}", result);
// 保存推送记录
factoryNodePushService.save(FactoryNodePushEntity.builder()
.orderCode(orderCode)
.orderCode(sendOrderCode)
.node(FactoryNodeEnums.FINAL_NET_ARRIVE_CAR.getCode().toString())
.content(JSONUtil.toJsonStr(js))
.resultContent(result)
@ -228,7 +228,7 @@ public class NodeDataPushListener {
log.error("推送工厂失败:{}", e);
}
}
}
// }
} else {
// 入库一个包件一次
Map<String, FactoryNodePushEntity> pushEntityMap = new HashMap<>();

Loading…
Cancel
Save