|
|
@@ -560,6 +560,10 @@ public class WaybillOrderService {
|
|
|
OrderUnitInfoDetailVO supplierEnt = tOrderIdAndUnitMap.getOrDefault(order.getTOrderId() + "-" + "2", new OrderUnitInfoDetailVO());
|
|
|
orderResp.setSupplierCompanyId(Optional.ofNullable(supplierEnt.getEntId()).map(String::valueOf).orElse(null));
|
|
|
orderResp.setSupplierCompanyName(supplierEnt.getFirmName());
|
|
|
+ //采购单位
|
|
|
+ OrderUnitInfoDetailVO proEnt = tOrderIdAndUnitMap.getOrDefault(order.getTOrderId() + "-" + "1", new OrderUnitInfoDetailVO());
|
|
|
+ orderResp.setPrEntId(proEnt.getEntId());
|
|
|
+ orderResp.setPrEntName(proEnt.getFirmName());
|
|
|
|
|
|
//装货地址
|
|
|
KwtLogisticsOrderAddress shipmentAddress = logOrderIdAndAddressMap.getOrDefault(order.getId() + "-" + AddressTypeEnum.SHIPMENT.getCode(), new KwtLogisticsOrderAddress());
|
|
|
@@ -991,6 +995,7 @@ public class WaybillOrderService {
|
|
|
// 贸易订单相关(仅非原矿运输查询)
|
|
|
Map<Long, OrderDetailVo> tradeIdAndOrderDetailVoMap;
|
|
|
Map<Long, List<KwtLogisticsOrder>> tradeIdAndLogOrderList;
|
|
|
+ Map<String, OrderUnitInfoDetailVO> tOrderIdAndUnitMap;
|
|
|
if (!isRawOre) {
|
|
|
Set<Long> tradeIds = logOrderList.stream().map(KwtLogisticsOrder::getTOrderId).collect(Collectors.toSet());
|
|
|
//获取贸易订单
|
|
|
@@ -1003,9 +1008,20 @@ public class WaybillOrderService {
|
|
|
Function.identity(), (x, y) -> x));
|
|
|
|
|
|
tradeIdAndLogOrderList = logOrderList.stream().collect(Collectors.groupingBy(KwtLogisticsOrder::getTOrderId));
|
|
|
+
|
|
|
+ //贸易企业
|
|
|
+ List<OrderUnitInfoDetailVO> orderUnitDetailVOS = tradeOrderInfoService.queryOrderUnitInfByTOrderId(tradeIds);
|
|
|
+ if (CollectionUtils.isEmpty(orderUnitDetailVOS)) {
|
|
|
+ log.info("交易订单无关联采取/销售企业,tradeOrderIds:{}", JSON.toJSONString(tradeIds));
|
|
|
+ throw new BusinessPlatfromException(ErrorCodeEnum.TRADE_ORDER_NOT_ENT, "交易订单无关联采取/销售企业");
|
|
|
+ }
|
|
|
+ tOrderIdAndUnitMap = orderUnitDetailVOS.stream().collect(Collectors.toMap(
|
|
|
+ unit -> unit.getTOrderId() + "-" + unit.getUnitType(), Function.identity(), (x, y) -> x));
|
|
|
+
|
|
|
} else {
|
|
|
tradeIdAndOrderDetailVoMap = new HashMap<>();
|
|
|
tradeIdAndLogOrderList = new HashMap<>();
|
|
|
+ tOrderIdAndUnitMap = new HashMap<>();
|
|
|
}
|
|
|
|
|
|
// 子任务分组
|
|
|
@@ -1062,7 +1078,7 @@ public class WaybillOrderService {
|
|
|
return getWaybillOrderResp(billOrder, subtaskMap, logOrderMap, logOrderIdAndCirculateMap,
|
|
|
logOrderIdAndGoodsMap, logOrderIdAndUnitMap, logOrderIdAndAddressMap, ticketMap,
|
|
|
tradeIdAndOrderDetailVoMap,tradeIdAndLogOrderList,logisticsOrderIdAndSubtaskList,
|
|
|
- dictValueAndDictResDtoMap, goodsIdAndGoodsMap);
|
|
|
+ dictValueAndDictResDtoMap, goodsIdAndGoodsMap, tOrderIdAndUnitMap);
|
|
|
}).collect(Collectors.toList());
|
|
|
log.info("{}物流运单查询结束,result:{}", isRawOre ? "原矿运输" : "正常流程", JSON.toJSONString(orderList));
|
|
|
return orderList;
|
|
|
@@ -1088,7 +1104,8 @@ public class WaybillOrderService {
|
|
|
Map<Long, List<KwtLogisticsOrder>> tradeIdAndLogOrderList ,
|
|
|
Map<Long, List<KwtWaybillOrderSubtask>> logisticsOrderIdAndSubtaskList,
|
|
|
Map<String, Map<String, String>> dictValueAndDictResDtoMap,
|
|
|
- Map<Long, KwpGoods> goodsIdAndGoodsMap) {
|
|
|
+ Map<Long, KwpGoods> goodsIdAndGoodsMap,
|
|
|
+ Map<String, OrderUnitInfoDetailVO> tOrderIdAndUnitMap) {
|
|
|
WaybillOrderStatusResp wbOrderResp = new WaybillOrderStatusResp();
|
|
|
wbOrderResp.setId(wbOrder.getId());
|
|
|
wbOrderResp.setLogisticsOrderId(Optional.ofNullable(wbOrder.getLOrderId()).map(String::valueOf).orElse(null));
|
|
|
@@ -1121,6 +1138,11 @@ public class WaybillOrderService {
|
|
|
wbOrderResp.setConsignCompanyId(Optional.ofNullable(consignEnt.getEntId()).map(String::valueOf).orElse(null));
|
|
|
wbOrderResp.setConsignCompanyName(consignEnt.getFirmName());
|
|
|
|
|
|
+ //采购单位
|
|
|
+ OrderUnitInfoDetailVO proEnt = tOrderIdAndUnitMap.getOrDefault(logOrder.getTOrderId() + "-" + "1", new OrderUnitInfoDetailVO());
|
|
|
+ wbOrderResp.setPrEntId(proEnt.getEntId());
|
|
|
+ wbOrderResp.setPrEntName(proEnt.getFirmName());
|
|
|
+
|
|
|
//商品信息
|
|
|
KwtLogisticsOrderGoods orderGoods = logOrderIdAndGoodsMap.getOrDefault(wbOrder.getLOrderId(), new KwtLogisticsOrderGoods());
|
|
|
KwpGoods goods = goodsIdAndGoodsMap.getOrDefault(orderGoods.getGoodsId(), new KwpGoods());
|