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