|
@@ -301,34 +301,32 @@ public class GatekeeperOrderService {
|
|
|
Map<Long, KwtLogisticsOrder> logisticsOrderMap = logisticsOrder.stream().collect(Collectors.toMap(KwtLogisticsOrder::getId, Function.identity(), (x, y) -> x));
|
|
Map<Long, KwtLogisticsOrder> logisticsOrderMap = logisticsOrder.stream().collect(Collectors.toMap(KwtLogisticsOrder::getId, Function.identity(), (x, y) -> x));
|
|
|
|
|
|
|
|
|
|
|
|
|
- // 按照order_type区分“正常订单”和“原矿运输订单”
|
|
|
|
|
- Map<Boolean, List<KwtLogisticsOrder>> partitionedMap = logisticsOrder.stream()
|
|
|
|
|
- .collect(Collectors.partitioningBy(order -> Integer.valueOf(1).equals(order.getOrderType())));
|
|
|
|
|
|
|
+// // 按照order_type区分“正常订单”和“原矿运输订单”
|
|
|
|
|
+// Map<Boolean, List<KwtLogisticsOrder>> partitionedMap = logisticsOrder.stream()
|
|
|
|
|
+// .collect(Collectors.partitioningBy(order -> Integer.valueOf(1).equals(order.getOrderType())));
|
|
|
|
|
+//
|
|
|
|
|
+// // 获取order_type=null的订单集合
|
|
|
|
|
+// List<KwtLogisticsOrder> typeNullList = partitionedMap.get(false);
|
|
|
|
|
+// log.info("正常流程的订单信息: {},数量:{}", JSON.toJSONString(typeNullList), typeNullList.size());
|
|
|
|
|
+//
|
|
|
|
|
+// // 获取order_type=1的订单集合
|
|
|
|
|
+// List<KwtLogisticsOrder> typeOneList = partitionedMap.get(true);
|
|
|
|
|
+// log.info("原矿运输的订单信息: {},数量:{}", JSON.toJSONString(typeOneList), typeOneList.size());
|
|
|
|
|
+
|
|
|
|
|
+// List<GatekeeperOrderResp> gatekeeperOrderRespList = new ArrayList<>();
|
|
|
|
|
+// if (CollectionUtils.isNotEmpty(typeNullList)) {
|
|
|
|
|
+// //组装铲车订单数据
|
|
|
|
|
+// List<GatekeeperOrderResp> gatekeeperOrderResp = records.stream()
|
|
|
|
|
+// .map(gatekeeperWaybillOrder -> buildGatekeeperOrderResp(gatekeeperWaybillOrder,
|
|
|
|
|
+// waybillOrderMap, waybillOrderTicketMap, logisticsOrderMap, typeNullList, Boolean.FALSE)).toList();
|
|
|
|
|
+// gatekeeperOrderRespList.addAll(gatekeeperOrderResp);
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
- // 获取order_type=null的订单集合
|
|
|
|
|
- List<KwtLogisticsOrder> typeNullList = partitionedMap.get(false);
|
|
|
|
|
- log.info("正常流程的订单信息: {},数量:{}", JSON.toJSONString(typeNullList), typeNullList.size());
|
|
|
|
|
-
|
|
|
|
|
- // 获取order_type=1的订单集合
|
|
|
|
|
- List<KwtLogisticsOrder> typeOneList = partitionedMap.get(true);
|
|
|
|
|
- log.info("原矿运输的订单信息: {},数量:{}", JSON.toJSONString(typeOneList), typeOneList.size());
|
|
|
|
|
-
|
|
|
|
|
- List<GatekeeperOrderResp> gatekeeperOrderRespList = new ArrayList<>();
|
|
|
|
|
- if (CollectionUtils.isNotEmpty(typeNullList)) {
|
|
|
|
|
- //组装铲车订单数据
|
|
|
|
|
- List<GatekeeperOrderResp> gatekeeperOrderResp = records.stream()
|
|
|
|
|
- .map(gatekeeperWaybillOrder -> buildGatekeeperOrderResp(gatekeeperWaybillOrder,
|
|
|
|
|
- waybillOrderMap, waybillOrderTicketMap, logisticsOrderMap, typeNullList, Boolean.FALSE)).toList();
|
|
|
|
|
- gatekeeperOrderRespList.addAll(gatekeeperOrderResp);
|
|
|
|
|
- }
|
|
|
|
|
- if (CollectionUtils.isNotEmpty(typeOneList)) {
|
|
|
|
|
//组装铲车订单数据
|
|
//组装铲车订单数据
|
|
|
List<GatekeeperOrderResp> rawOreGatekeeperOrderResp = records.stream()
|
|
List<GatekeeperOrderResp> rawOreGatekeeperOrderResp = records.stream()
|
|
|
.map(gatekeeperWaybillOrder -> buildGatekeeperOrderResp(gatekeeperWaybillOrder,
|
|
.map(gatekeeperWaybillOrder -> buildGatekeeperOrderResp(gatekeeperWaybillOrder,
|
|
|
- waybillOrderMap, waybillOrderTicketMap, logisticsOrderMap, typeOneList, Boolean.TRUE)).toList();
|
|
|
|
|
- gatekeeperOrderRespList.addAll(rawOreGatekeeperOrderResp);
|
|
|
|
|
- }
|
|
|
|
|
- return gatekeeperOrderRespList;
|
|
|
|
|
|
|
+ waybillOrderMap, waybillOrderTicketMap, logisticsOrderMap, logisticsOrder)).toList();
|
|
|
|
|
+ return rawOreGatekeeperOrderResp;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -343,9 +341,8 @@ public class GatekeeperOrderService {
|
|
|
Map<Long, KwtWaybillOrder> waybillOrderMap,
|
|
Map<Long, KwtWaybillOrder> waybillOrderMap,
|
|
|
Map<String, KwtWaybillOrderTicket> waybillOrderTicketMap,
|
|
Map<String, KwtWaybillOrderTicket> waybillOrderTicketMap,
|
|
|
Map<Long, KwtLogisticsOrder> logisticsOrderMap,
|
|
Map<Long, KwtLogisticsOrder> logisticsOrderMap,
|
|
|
- List<KwtLogisticsOrder> logisticsOrder,
|
|
|
|
|
- Boolean isRawOre) {
|
|
|
|
|
-
|
|
|
|
|
|
|
+ List<KwtLogisticsOrder> logisticsOrder) {
|
|
|
|
|
+ log.info("开始门卫订单查询,param:{}", JSON.toJSONString(gatekeeperWaybillOrder));
|
|
|
GatekeeperOrderResp gatekeeper = new GatekeeperOrderResp();
|
|
GatekeeperOrderResp gatekeeper = new GatekeeperOrderResp();
|
|
|
gatekeeper.setId(gatekeeperWaybillOrder.getId());
|
|
gatekeeper.setId(gatekeeperWaybillOrder.getId());
|
|
|
gatekeeper.setEntId(gatekeeperWaybillOrder.getEntId());
|
|
gatekeeper.setEntId(gatekeeperWaybillOrder.getEntId());
|
|
@@ -383,20 +380,22 @@ public class GatekeeperOrderService {
|
|
|
gatekeeper.setTareAmount(ticket.getTareAmount());
|
|
gatekeeper.setTareAmount(ticket.getTareAmount());
|
|
|
gatekeeper.setGrossAmount(ticket.getGrossAmount());
|
|
gatekeeper.setGrossAmount(ticket.getGrossAmount());
|
|
|
|
|
|
|
|
- if (!isRawOre){
|
|
|
|
|
|
|
+ KwtLogisticsOrder logOrder = logisticsOrderMap.getOrDefault(waybillOrder.getLOrderId(), new KwtLogisticsOrder());
|
|
|
|
|
+ if (!Objects.equals(1, logOrder.getOrderType())) {
|
|
|
//查询贸易订单企业信息
|
|
//查询贸易订单企业信息
|
|
|
Set<Long> tOrderIds = logisticsOrder.stream().map(KwtLogisticsOrder::getTOrderId).collect(Collectors.toSet());
|
|
Set<Long> tOrderIds = logisticsOrder.stream().map(KwtLogisticsOrder::getTOrderId).collect(Collectors.toSet());
|
|
|
List<OrderUnitInfoDetailVO> orderUnitInfoDetailVOS = tradeOrderInfoService.queryOrderUnitInfByTOrderId(tOrderIds);
|
|
List<OrderUnitInfoDetailVO> orderUnitInfoDetailVOS = tradeOrderInfoService.queryOrderUnitInfByTOrderId(tOrderIds);
|
|
|
if (CollectionUtils.isNotEmpty(orderUnitInfoDetailVOS)) {
|
|
if (CollectionUtils.isNotEmpty(orderUnitInfoDetailVOS)) {
|
|
|
- Map<String, OrderUnitInfoDetailVO> tradeOrderAndUnit = orderUnitInfoDetailVOS.stream().collect(Collectors.toMap(unit -> unit.getTOrderId() + "-" + unit.getUnitType(), Function.identity(), (x, y) -> x));
|
|
|
|
|
|
|
+ Map<String, OrderUnitInfoDetailVO> tradeOrderAndUnit = orderUnitInfoDetailVOS.stream()
|
|
|
|
|
+ .collect(Collectors.toMap(unit -> unit.getTOrderId() + "-" + unit.getUnitType(),
|
|
|
|
|
+ Function.identity(), (x, y) -> x));
|
|
|
//采购企业信息
|
|
//采购企业信息
|
|
|
- KwtLogisticsOrder logOrder = logisticsOrderMap.getOrDefault(waybillOrder.getLOrderId(), new KwtLogisticsOrder());
|
|
|
|
|
OrderUnitInfoDetailVO orderUnit = tradeOrderAndUnit.getOrDefault(logOrder.getTOrderId() + "-" + 1, new OrderUnitInfoDetailVO());
|
|
OrderUnitInfoDetailVO orderUnit = tradeOrderAndUnit.getOrDefault(logOrder.getTOrderId() + "-" + 1, new OrderUnitInfoDetailVO());
|
|
|
gatekeeper.setPrEntId(orderUnit.getEntId());
|
|
gatekeeper.setPrEntId(orderUnit.getEntId());
|
|
|
gatekeeper.setPrEntName(orderUnit.getFirmName());
|
|
gatekeeper.setPrEntName(orderUnit.getFirmName());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ log.info("门卫订单查询结束,result:{}", JSON.toJSONString(gatekeeper));
|
|
|
return gatekeeper;
|
|
return gatekeeper;
|
|
|
}
|
|
}
|
|
|
|
|
|