|
|
@@ -4266,11 +4266,18 @@ public class KwtWaybillOrderV1Service {
|
|
|
CompletableFuture<KwtLogisticsOrderGoods> goodsFuture = CompletableFuture.supplyAsync(() ->
|
|
|
kwtLogisticsOrderGoodsRepository.queryByLogOrderId(logOrder.getId()),traceTaskExecutor);
|
|
|
|
|
|
- CompletableFuture<OrderDetailVo> orderDetailFuture = CompletableFuture.supplyAsync(() ->
|
|
|
- getOrderDetail(logOrder.getTOrderId()),traceTaskExecutor).exceptionally(ex -> {
|
|
|
- log.error("异步任务执行失败", ex);
|
|
|
- throw new BusinessException("查询订单详情失败");
|
|
|
- });
|
|
|
+ CompletableFuture<OrderDetailVo> orderDetailFuture;
|
|
|
+ //1.正常流程
|
|
|
+ if (!Objects.equals(1, logOrder.getOrderType())) {
|
|
|
+ orderDetailFuture = CompletableFuture.supplyAsync(() ->
|
|
|
+ getOrderDetail(logOrder.getTOrderId()),traceTaskExecutor).exceptionally(ex -> {
|
|
|
+ log.error("异步任务执行失败", ex);
|
|
|
+ throw new BusinessException("查询订单详情失败");
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ //2.原矿运输
|
|
|
+ orderDetailFuture = new CompletableFuture<>();
|
|
|
+ }
|
|
|
|
|
|
CompletableFuture<List<KwtLogisticsOrderUnit>> unitFuture = CompletableFuture.supplyAsync(() ->
|
|
|
kwtLogisticsOrderUnitRepository.queryByLOrderId(logOrder.getId()),traceTaskExecutor);
|
|
|
@@ -4425,7 +4432,7 @@ public class KwtWaybillOrderV1Service {
|
|
|
KwpGoods kwpGoods = getKwpGoods(goods);
|
|
|
|
|
|
// 处理合同采购单位
|
|
|
- List<TradeContractUnitDto> tradeContractUnitDtos = getTradeContractUnits(orderDetailVo);
|
|
|
+ List<TradeContractUnitDto> tradeContractUnitDtos = getTradeContractUnits(orderDetailVo, logOrder);
|
|
|
|
|
|
// 处理地址信息
|
|
|
Map<String, KwtLogisticsOrderAddress> keyAndAddressMap = processAddresses(kwtWaybillOrderAddresses);
|
|
|
@@ -4472,7 +4479,11 @@ public class KwtWaybillOrderV1Service {
|
|
|
/**
|
|
|
* 获取合同采购单位信息
|
|
|
*/
|
|
|
- private List<TradeContractUnitDto> getTradeContractUnits(OrderDetailVo orderDetailVo) {
|
|
|
+ private List<TradeContractUnitDto> getTradeContractUnits(OrderDetailVo orderDetailVo, KwtLogisticsOrder logOrder) {
|
|
|
+ //原矿运输没有贸易订单
|
|
|
+ if (Objects.equals(1, logOrder.getOrderType())) {
|
|
|
+ return Lists.newArrayList();
|
|
|
+ }
|
|
|
if (Objects.nonNull(orderDetailVo) && Objects.nonNull(orderDetailVo.getContractInfo())
|
|
|
&& Objects.nonNull(orderDetailVo.getContractInfo().getContractId())) {
|
|
|
log.debug("查询合同单位信息,合同ID: {}", orderDetailVo.getContractInfo().getContractId());
|
|
|
@@ -4681,12 +4692,19 @@ public class KwtWaybillOrderV1Service {
|
|
|
resp.setTransEntName(transEnt.getFirmName());
|
|
|
resp.setCarrierEntName(carrierEnt.getFirmName());
|
|
|
|
|
|
- // 供应商信息
|
|
|
- if (!CollectionUtils.isEmpty(tradeContractUnitDtos)) {
|
|
|
- tradeContractUnitDtos.stream()
|
|
|
- .filter(x -> org.apache.commons.lang3.StringUtils.equals(x.getUnitType(), String.valueOf(CooperateTypeEnum.SUPPLIER.getCode())))
|
|
|
- .findFirst()
|
|
|
- .ifPresent(x -> resp.setSupplyEntName(x.getFirmName()));
|
|
|
+
|
|
|
+ //1.正常流程
|
|
|
+ if (!Objects.equals(1, logOrder.getOrderType())) {
|
|
|
+ // 供应商信息
|
|
|
+ if (!CollectionUtils.isEmpty(tradeContractUnitDtos)) {
|
|
|
+ tradeContractUnitDtos.stream()
|
|
|
+ .filter(x -> org.apache.commons.lang3.StringUtils.equals(x.getUnitType(), String.valueOf(CooperateTypeEnum.SUPPLIER.getCode())))
|
|
|
+ .findFirst()
|
|
|
+ .ifPresent(x -> resp.setSupplyEntName(x.getFirmName()));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //2.原矿运输
|
|
|
+ resp.setSupplyEntName(transEnt.getFirmName());
|
|
|
}
|
|
|
|
|
|
// 状态信息
|