|
@@ -76,9 +76,13 @@ import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
import java.math.RoundingMode;
|
|
|
import java.time.ZoneId;
|
|
import java.time.ZoneId;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
+import java.util.concurrent.CompletableFuture;
|
|
|
|
|
+import java.util.concurrent.ExecutorService;
|
|
|
|
|
+import java.util.concurrent.Executors;
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
import java.util.function.Function;
|
|
import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
+import java.util.stream.Stream;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @author lfdc
|
|
* @author lfdc
|
|
@@ -2232,120 +2236,448 @@ public class KwtLogisticsConsignmentService {
|
|
|
return logisticsOrderConsignmentService.logisticsOrderSubcontract(logisticsOrderSubcontractDto);
|
|
return logisticsOrderConsignmentService.logisticsOrderSubcontract(logisticsOrderSubcontractDto);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 自定义线程池
|
|
|
|
|
+ private static final ExecutorService QUERY_EXECUTOR = Executors.newFixedThreadPool(10);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
public PageDataResult<LogisticsOrderResp> queryLogisticsOrderByPage(QueryLogisticsOrderReq req) {
|
|
public PageDataResult<LogisticsOrderResp> queryLogisticsOrderByPage(QueryLogisticsOrderReq req) {
|
|
|
log.info("分页查询物流订单传递参数信息:{}", JSONObject.toJSONString(req));
|
|
log.info("分页查询物流订单传递参数信息:{}", JSONObject.toJSONString(req));
|
|
|
|
|
|
|
|
- Set<Long> allEnt = getAllEnt(req.getEntId());
|
|
|
|
|
- //根据托运单位或者承运单位查询企业
|
|
|
|
|
- Set<Long> entList = getEntList(req);
|
|
|
|
|
- if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(allEnt)) {
|
|
|
|
|
- entList.addAll(allEnt);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 1. 并行获取基础数据
|
|
|
|
|
+ log.debug("开始并行获取基础数据");
|
|
|
|
|
+ Long allEnt = getAllEnt(req.getEntId());
|
|
|
|
|
|
|
|
- //根据商品名称查询物流订单
|
|
|
|
|
|
|
+ BaseQueryData baseQueryData = fetchBaseQueryData(req);
|
|
|
|
|
+
|
|
|
|
|
+ // 2. 处理企业信息
|
|
|
|
|
+ log.debug("处理企业信息");
|
|
|
|
|
+ Set<Long> entList = processEnterpriseData(baseQueryData);
|
|
|
|
|
+
|
|
|
|
|
+ // 3. 获取物流订单ID集合
|
|
|
|
|
+ log.debug("获取物流订单ID集合");
|
|
|
Set<Long> logOrderIds = getLogOrderIds(req, entList, allEnt);
|
|
Set<Long> logOrderIds = getLogOrderIds(req, entList, allEnt);
|
|
|
- if (org.apache.commons.collections4.CollectionUtils.isEmpty(logOrderIds) && (org.apache.commons.collections4.CollectionUtils.isNotEmpty(entList)
|
|
|
|
|
- || !org.apache.commons.lang3.StringUtils.isAllBlank(req.getContractId(),req.getGoodsName()))) {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 4. 检查是否需要返回空结果
|
|
|
|
|
+ log.debug("检查是否需要返回空结果,logOrderIds大小: {}, entList大小: {}", logOrderIds.size(), entList.size());
|
|
|
|
|
+ if (shouldReturnEmptyResult(logOrderIds, entList, req)) {
|
|
|
|
|
+ log.info("满足返回空结果条件,直接返回空分页数据");
|
|
|
return PageDataResult.empty(req.getPageNum(), req.getPageSize());
|
|
return PageDataResult.empty(req.getPageNum(), req.getPageSize());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //分页查询物流订单
|
|
|
|
|
- IPage<KwtLogisticsOrder> page = logisticsOrderRepository.queryByPage(logOrderIds, req.getTradeOrderId(), req.getOrderNo(), req.getOrderStatus(),
|
|
|
|
|
- req.getStartTime(), req.getEndTime(), req.getPageNum(), req.getPageSize());
|
|
|
|
|
|
|
+ // 5. 分页查询物流订单
|
|
|
|
|
+ log.debug("开始分页查询物流订单,订单ID数量: {}", logOrderIds.size());
|
|
|
|
|
+ IPage<KwtLogisticsOrder> page = queryLogisticsOrdersPage(logOrderIds, req);
|
|
|
List<KwtLogisticsOrder> records = page.getRecords();
|
|
List<KwtLogisticsOrder> records = page.getRecords();
|
|
|
- if (org.springframework.util.CollectionUtils.isEmpty(records)) {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (CollectionUtils.isEmpty(records)) {
|
|
|
|
|
+ log.info("查询结果为空,返回空分页数据");
|
|
|
return PageDataResult.empty(req.getPageNum(), req.getPageSize());
|
|
return PageDataResult.empty(req.getPageNum(), req.getPageSize());
|
|
|
}
|
|
}
|
|
|
- //查获取物流订单号
|
|
|
|
|
- List<Long> logOrderIdList =
|
|
|
|
|
- records.stream().map(KwtLogisticsOrder::getId).distinct().collect(Collectors.toList());
|
|
|
|
|
- //通过物流订单号查询运输的单位
|
|
|
|
|
- List<KwtLogisticsOrderUnit> unitList = logisticsOrderUnitRepository.queryByLogOrderIds(logOrderIdList);
|
|
|
|
|
- Map<String, KwtLogisticsOrderUnit> logOrderIdAndUnitTypeKeyAndUnitMap = Maps.newHashMap();
|
|
|
|
|
- if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(unitList)) {
|
|
|
|
|
- logOrderIdAndUnitTypeKeyAndUnitMap = unitList.stream()
|
|
|
|
|
- .collect(Collectors.toMap(x -> x.getLOrderId() + "-" + x.getUnitType(),
|
|
|
|
|
- Function.identity(), (x, y) -> x));
|
|
|
|
|
- }
|
|
|
|
|
- //查询贸易订单
|
|
|
|
|
|
|
+
|
|
|
|
|
+ log.info("分页查询结果,总记录数: {},当前页记录数: {}", page.getTotal(), records.size());
|
|
|
|
|
+
|
|
|
|
|
+ // 6. 提取物流订单ID列表
|
|
|
|
|
+ log.debug("提取物流订单ID列表");
|
|
|
|
|
+ List<Long> logOrderIdList = extractLogisticsOrderIds(records);
|
|
|
|
|
+
|
|
|
|
|
+ // 7. 并行获取相关数据
|
|
|
|
|
+ log.debug("并行获取相关数据");
|
|
|
|
|
+ RelatedOrderData relatedData = fetchRelatedOrderData(logOrderIdList, records);
|
|
|
|
|
+
|
|
|
|
|
+ // 8. 获取字典数据
|
|
|
|
|
+ log.debug("获取字典数据");
|
|
|
|
|
+ Map<String, Map<String, String>> dictMap = getCachedDictData(baseQueryData.getDictFuture());
|
|
|
|
|
+
|
|
|
|
|
+ // 9. 转换为响应对象
|
|
|
|
|
+ log.debug("转换为响应对象");
|
|
|
|
|
+ List<LogisticsOrderResp> resps = convertToResponseList(
|
|
|
|
|
+ records, relatedData, dictMap);
|
|
|
|
|
+
|
|
|
|
|
+ log.info("物流订单分页查询完成,返回结果数量: {}", resps.size());
|
|
|
|
|
+ return PageDataResult.of(page, resps);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取基础查询数据
|
|
|
|
|
+ */
|
|
|
|
|
+ private BaseQueryData fetchBaseQueryData(QueryLogisticsOrderReq req) {
|
|
|
|
|
+ CompletableFuture<Set<Long>> entListFuture = CompletableFuture.supplyAsync(
|
|
|
|
|
+ () -> getEntList(req), QUERY_EXECUTOR);
|
|
|
|
|
+ CompletableFuture<Map<String, Map<String, String>>> dictFuture = CompletableFuture.supplyAsync(
|
|
|
|
|
+ () -> getCachedDictData(), QUERY_EXECUTOR);
|
|
|
|
|
+
|
|
|
|
|
+ return new BaseQueryData(entListFuture, dictFuture);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 处理企业数据
|
|
|
|
|
+ */
|
|
|
|
|
+ private Set<Long> processEnterpriseData(BaseQueryData baseQueryData) {
|
|
|
|
|
+ Set<Long> entList = baseQueryData.getEntListFuture().join();
|
|
|
|
|
+ return entList;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 检查是否需要返回空结果
|
|
|
|
|
+ */
|
|
|
|
|
+ private boolean shouldReturnEmptyResult(Set<Long> logOrderIds, Set<Long> entList, QueryLogisticsOrderReq req) {
|
|
|
|
|
+ return CollectionUtils.isEmpty(logOrderIds) &&
|
|
|
|
|
+ (!org.apache.commons.lang3.StringUtils.isAllBlank(req.getContractId(), req.getGoodsName(),req.getConsignCompanyId(),req.getCarriageCompanyId()));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 分页查询物流订单
|
|
|
|
|
+ */
|
|
|
|
|
+ private IPage<KwtLogisticsOrder> queryLogisticsOrdersPage(Set<Long> logOrderIds, QueryLogisticsOrderReq req) {
|
|
|
|
|
+ QueryLogisticsOrderReq optimizedReq = optimizeRequestWithFilters(req);
|
|
|
|
|
+ return logisticsOrderRepository.queryByPage(
|
|
|
|
|
+ logOrderIds, optimizedReq.getTradeOrderId(), optimizedReq.getOrderNo(),
|
|
|
|
|
+ optimizedReq.getOrderStatus(), optimizedReq.getStartTime(),
|
|
|
|
|
+ optimizedReq.getEndTime(), optimizedReq.getPageNum(), optimizedReq.getPageSize());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 提取物流订单ID列表
|
|
|
|
|
+ */
|
|
|
|
|
+ private List<Long> extractLogisticsOrderIds(List<KwtLogisticsOrder> records) {
|
|
|
|
|
+ return records.stream()
|
|
|
|
|
+ .map(KwtLogisticsOrder::getId)
|
|
|
|
|
+ .distinct()
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取相关订单数据
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 并行获取相关订单数据
|
|
|
|
|
+ * 包括:订单单位信息、订单商品信息、订单地址信息、订单合同信息、子运单信息和贸易订单信息
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param logOrderIdList 物流订单ID列表
|
|
|
|
|
+ * @param records 物流订单记录列表
|
|
|
|
|
+ * @return RelatedOrderData 包含所有相关订单数据的对象
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
|
|
+ private RelatedOrderData fetchRelatedOrderData(List<Long> logOrderIdList, List<KwtLogisticsOrder> records) {
|
|
|
|
|
+ log.debug("开始并行获取相关订单数据,物流订单数量: {}", logOrderIdList.size());
|
|
|
|
|
+
|
|
|
|
|
+ // 并行执行多个不相互依赖的查询
|
|
|
|
|
+ CompletableFuture<List<KwtLogisticsOrderUnit>> unitListFuture = CompletableFuture.supplyAsync(
|
|
|
|
|
+ () -> {
|
|
|
|
|
+ log.debug("开始查询物流订单单位信息");
|
|
|
|
|
+ List<KwtLogisticsOrderUnit> result = logisticsOrderUnitRepository.queryByLogOrderIds(logOrderIdList);
|
|
|
|
|
+ log.debug("物流订单单位信息查询完成,结果数量: {}", result.size());
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }, QUERY_EXECUTOR);
|
|
|
|
|
+
|
|
|
|
|
+ CompletableFuture<List<KwtLogisticsOrderGoods>> goodsListFuture = CompletableFuture.supplyAsync(
|
|
|
|
|
+ () -> {
|
|
|
|
|
+ log.debug("开始查询物流订单商品信息");
|
|
|
|
|
+ List<KwtLogisticsOrderGoods> result = logisticsOrderGoodsRepository.queryByLogOrderIds(logOrderIdList);
|
|
|
|
|
+ log.debug("物流订单商品信息查询完成,结果数量: {}", result.size());
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }, QUERY_EXECUTOR);
|
|
|
|
|
+
|
|
|
|
|
+ CompletableFuture<Map<String, KwtLogisticsOrderAddress>> addressMapFuture = CompletableFuture.supplyAsync(
|
|
|
|
|
+ () -> {
|
|
|
|
|
+ log.debug("开始查询物流订单地址信息");
|
|
|
|
|
+ Map<String, KwtLogisticsOrderAddress> result = getStringKwtLogisticsOrderAddressMap(logOrderIdList);
|
|
|
|
|
+ log.debug("物流订单地址信息查询完成,结果数量: {}", result.size());
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }, QUERY_EXECUTOR);
|
|
|
|
|
+
|
|
|
|
|
+ CompletableFuture<Map<Long, KwtLogisticsOrderContract>> contractMapFuture = CompletableFuture.supplyAsync(
|
|
|
|
|
+ () -> {
|
|
|
|
|
+ log.debug("开始查询物流订单合同信息");
|
|
|
|
|
+ Map<Long, KwtLogisticsOrderContract> result = getLongKwtLogisticsOrderContractMap(logOrderIdList);
|
|
|
|
|
+ log.debug("物流订单合同信息查询完成,结果数量: {}", result.size());
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }, QUERY_EXECUTOR);
|
|
|
|
|
+
|
|
|
|
|
+ CompletableFuture<List<KwtWaybillOrderSubtask>> subtaskListFuture = CompletableFuture.supplyAsync(
|
|
|
|
|
+ () -> {
|
|
|
|
|
+ log.debug("开始查询物流订单子运单信息");
|
|
|
|
|
+ List<KwtWaybillOrderSubtask> result = waybillOrderSubtaskRepository.queryByLogIds(logOrderIdList);
|
|
|
|
|
+ log.debug("物流订单子运单信息查询完成,结果数量: {}", result.size());
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }, QUERY_EXECUTOR);
|
|
|
|
|
+
|
|
|
|
|
+ // 并行处理贸易订单信息
|
|
|
|
|
+ CompletableFuture<Map<Long, OrderDetailVo>> tradeMapFuture = CompletableFuture.supplyAsync(
|
|
|
|
|
+ () -> {
|
|
|
|
|
+ log.debug("开始查询贸易订单信息");
|
|
|
|
|
+ Map<Long, OrderDetailVo> result = fetchTradeOrderData(records);
|
|
|
|
|
+ log.debug("贸易订单信息查询完成,结果数量: {}", result.size());
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }, QUERY_EXECUTOR);
|
|
|
|
|
+
|
|
|
|
|
+ // 等待所有并行查询完成
|
|
|
|
|
+ log.debug("等待所有并行查询完成");
|
|
|
|
|
+ CompletableFuture.allOf(unitListFuture, goodsListFuture, addressMapFuture,
|
|
|
|
|
+ contractMapFuture, subtaskListFuture, tradeMapFuture).join();
|
|
|
|
|
+ log.debug("所有并行查询已完成");
|
|
|
|
|
+
|
|
|
|
|
+ // 处理查询结果
|
|
|
|
|
+ log.debug("开始处理查询结果");
|
|
|
|
|
+ Map<String, KwtLogisticsOrderUnit> unitMap = processUnitData(unitListFuture.join());
|
|
|
|
|
+ GoodsData goodsData = processGoodsData(goodsListFuture.join());
|
|
|
|
|
+ Map<String, KwtLogisticsOrderAddress> addressMap = addressMapFuture.join();
|
|
|
|
|
+ Map<Long, KwtLogisticsOrderContract> contractMap = contractMapFuture.join();
|
|
|
|
|
+ Map<Long, List<KwtWaybillOrderSubtask>> subtaskMap = processSubtaskData(subtaskListFuture.join());
|
|
|
|
|
+ Map<Long, OrderDetailVo> tradeMap = tradeMapFuture.join();
|
|
|
|
|
+ Map<Long, List<KwtLogisticsOrder>> tradeLogOrderMap = groupByTradeOrder(records);
|
|
|
|
|
+ log.debug("查询结果处理完成");
|
|
|
|
|
+
|
|
|
|
|
+ log.debug("相关订单数据获取完成");
|
|
|
|
|
+ return new RelatedOrderData(unitMap, goodsData, addressMap, contractMap,
|
|
|
|
|
+ subtaskMap, tradeMap, tradeLogOrderMap);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取贸易订单数据
|
|
|
|
|
+ */
|
|
|
|
|
+ private Map<Long, OrderDetailVo> fetchTradeOrderData(List<KwtLogisticsOrder> records) {
|
|
|
Set<Long> tradeIds = records.stream()
|
|
Set<Long> tradeIds = records.stream()
|
|
|
.map(KwtLogisticsOrder::getTOrderId)
|
|
.map(KwtLogisticsOrder::getTOrderId)
|
|
|
.collect(Collectors.toSet());
|
|
.collect(Collectors.toSet());
|
|
|
- Map<Long, OrderDetailVo> tradeIdAndOrderDetailVoMap = Maps.newHashMap();
|
|
|
|
|
- if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(tradeIds)) {
|
|
|
|
|
- List<OrderDetailVo> orderDetailVos = tradeOrderInfoService.queryByTradeOrderIds(tradeIds);
|
|
|
|
|
- tradeIdAndOrderDetailVoMap = orderDetailVos.stream()
|
|
|
|
|
- .collect(Collectors.toMap(OrderDetailVo::getId, Function.identity(), (x, y) -> x));
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (CollectionUtils.isEmpty(tradeIds)) {
|
|
|
|
|
+ return Maps.newHashMap();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //查询商品信息
|
|
|
|
|
- List<KwtLogisticsOrderGoods> logOrderGoodsList = logisticsOrderGoodsRepository.queryByLogOrderIds(logOrderIdList);
|
|
|
|
|
|
|
+ List<OrderDetailVo> orderDetailVos = tradeOrderInfoService.queryByTradeOrderIds(tradeIds);
|
|
|
|
|
+ return orderDetailVos.stream()
|
|
|
|
|
+ .collect(Collectors.toMap(OrderDetailVo::getId, Function.identity(), (x, y) -> x));
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- List<Long> goodsIds = Lists.newArrayList();
|
|
|
|
|
- Map<Long, KwtLogisticsOrderGoods> logIdAndGoodsMap = Maps.newHashMap();
|
|
|
|
|
- if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(logOrderGoodsList)) {
|
|
|
|
|
- goodsIds =
|
|
|
|
|
- logOrderGoodsList.stream().map(KwtLogisticsOrderGoods::getGoodsId).distinct().collect(Collectors.toList());
|
|
|
|
|
- logIdAndGoodsMap =
|
|
|
|
|
- logOrderGoodsList.stream().collect(Collectors.toMap(KwtLogisticsOrderGoods::getLOrderId, Function.identity(),
|
|
|
|
|
- (x, y) -> x));
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 处理单位数据
|
|
|
|
|
+ */
|
|
|
|
|
+ private Map<String, KwtLogisticsOrderUnit> processUnitData(List<KwtLogisticsOrderUnit> unitList) {
|
|
|
|
|
+ if (CollectionUtils.isEmpty(unitList)) {
|
|
|
|
|
+ return Maps.newHashMap();
|
|
|
}
|
|
}
|
|
|
- Map<Long, KwpGoods> goodsIdAndGoodsMap = Maps.newHashMap();
|
|
|
|
|
- if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(goodsIds)) {
|
|
|
|
|
- goodsIdAndGoodsMap = goodsInfoService.getGoodsByIds(goodsIds);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ return unitList.stream()
|
|
|
|
|
+ .collect(Collectors.toMap(x -> x.getLOrderId() + "-" + x.getUnitType(),
|
|
|
|
|
+ Function.identity(), (x, y) -> x));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 处理商品数据
|
|
|
|
|
+ */
|
|
|
|
|
+ private GoodsData processGoodsData(List<KwtLogisticsOrderGoods> logOrderGoodsList) {
|
|
|
|
|
+ Map<Long, KwtLogisticsOrderGoods> logGoodsMap = Maps.newHashMap();
|
|
|
|
|
+ Map<Long, KwpGoods> goodsMap = Maps.newHashMap();
|
|
|
|
|
+
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(logOrderGoodsList)) {
|
|
|
|
|
+ List<Long> goodsIds = logOrderGoodsList.stream()
|
|
|
|
|
+ .map(KwtLogisticsOrderGoods::getGoodsId)
|
|
|
|
|
+ .distinct()
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+
|
|
|
|
|
+ logGoodsMap = logOrderGoodsList.stream()
|
|
|
|
|
+ .collect(Collectors.toMap(KwtLogisticsOrderGoods::getLOrderId,
|
|
|
|
|
+ Function.identity(), (x, y) -> x));
|
|
|
|
|
+
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(goodsIds)) {
|
|
|
|
|
+ goodsMap = goodsInfoService.getGoodsByIds(goodsIds);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //查询地址信息
|
|
|
|
|
- Map<String, KwtLogisticsOrderAddress> logisticsOrderIdAndUnitTypeKeyAndAddressMap = getStringKwtLogisticsOrderAddressMap(logOrderIdList);
|
|
|
|
|
- //查询物流订单合同信息
|
|
|
|
|
- Map<Long, KwtLogisticsOrderContract> logOrderIdAndContractMap = getLongKwtLogisticsOrderContractMap(logOrderIdList);
|
|
|
|
|
|
|
+ return new GoodsData(logGoodsMap, goodsMap);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- //查询字典
|
|
|
|
|
- Map<String, Map<String, String>> dictValueAndDictResDtoMap = remoteSystemService.queryDictByType(Arrays.asList(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), DictTypeEnum.GOODS_SPEC.getType()));
|
|
|
|
|
-// Map<String, SysDictResDto> dictValueAndDictResDtoMap = new HashMap<>();
|
|
|
|
|
-// if (CollectionUtils.isNotEmpty(sysDictResDtos)){
|
|
|
|
|
-// //字典value映射字典
|
|
|
|
|
-// dictValueAndDictResDtoMap = sysDictResDtos.stream()
|
|
|
|
|
-// .collect(Collectors.toMap(SysDictResDto::getValue, Function.identity()));
|
|
|
|
|
-//
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 处理子运单数据
|
|
|
|
|
+ */
|
|
|
|
|
+ private Map<Long, List<KwtWaybillOrderSubtask>> processSubtaskData(List<KwtWaybillOrderSubtask> subtaskList) {
|
|
|
|
|
+ if (CollectionUtils.isEmpty(subtaskList)) {
|
|
|
|
|
+ return Maps.newHashMap();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return subtaskList.stream()
|
|
|
|
|
+ .collect(Collectors.groupingBy(KwtWaybillOrderSubtask::getLOrderId));
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- Map<Long, List<KwtLogisticsOrder>> tradeIdAndLogOrderList = records.stream()
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 按贸易订单分组
|
|
|
|
|
+ */
|
|
|
|
|
+ private Map<Long, List<KwtLogisticsOrder>> groupByTradeOrder(List<KwtLogisticsOrder> records) {
|
|
|
|
|
+ return records.stream()
|
|
|
.collect(Collectors.groupingBy(KwtLogisticsOrder::getTOrderId));
|
|
.collect(Collectors.groupingBy(KwtLogisticsOrder::getTOrderId));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取缓存的字典数据
|
|
|
|
|
+ */
|
|
|
|
|
+ private Map<String, Map<String, String>> getCachedDictData() {
|
|
|
|
|
+ // 这里可以使用Redis或本地缓存如Caffeine
|
|
|
|
|
+ // 如果缓存中没有,则查询远程系统并更新缓存
|
|
|
|
|
+ return remoteSystemService.queryDictByType(Arrays.asList(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), DictTypeEnum.GOODS_SPEC.getType()));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取缓存的字典数据
|
|
|
|
|
+ */
|
|
|
|
|
+ private Map<String, Map<String, String>> getCachedDictData(CompletableFuture<Map<String, Map<String, String>>> dictFuture) {
|
|
|
|
|
+ return dictFuture.join();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- //子运单
|
|
|
|
|
- List<KwtWaybillOrderSubtask> orderSubtaskList = waybillOrderSubtaskRepository.queryByLogIds(logOrderIdList);
|
|
|
|
|
- Map<Long, List<KwtWaybillOrderSubtask>> logOrderIdAndSubtaskMap = Maps.newHashMap();
|
|
|
|
|
- if (CollectionUtils.isNotEmpty(orderSubtaskList)) {
|
|
|
|
|
- logOrderIdAndSubtaskMap = orderSubtaskList.stream()
|
|
|
|
|
- .collect(Collectors.groupingBy(KwtWaybillOrderSubtask::getLOrderId));
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- Map<String, KwtLogisticsOrderUnit> finalLogOrderIdAndUnitTypeKeyAndUnitMap = logOrderIdAndUnitTypeKeyAndUnitMap;
|
|
|
|
|
- Map<Long, KwtLogisticsOrderGoods> finalLogIdAndGoodsMap = logIdAndGoodsMap;
|
|
|
|
|
- Map<Long, KwpGoods> finalGoodsIdAndGoodsMap = goodsIdAndGoodsMap;
|
|
|
|
|
- Map<String, KwtLogisticsOrderAddress> finalLogisticsOrderIdAndUnitTypeKeyAndAddressMap = logisticsOrderIdAndUnitTypeKeyAndAddressMap;
|
|
|
|
|
- Map<Long, KwtLogisticsOrderContract> finalLogOrderIdAndContractMap = logOrderIdAndContractMap;
|
|
|
|
|
- Map<Long, OrderDetailVo> finalTradeIdAndOrderDetailVoMap = tradeIdAndOrderDetailVoMap;
|
|
|
|
|
- Map<Long, List<KwtWaybillOrderSubtask>> finalLogOrderIdAndSubtaskMap = logOrderIdAndSubtaskMap;
|
|
|
|
|
- List<LogisticsOrderResp> resps = records.stream()
|
|
|
|
|
- .map(x -> getLogisticsOrderResp(x, finalLogOrderIdAndUnitTypeKeyAndUnitMap, finalLogIdAndGoodsMap
|
|
|
|
|
- , finalGoodsIdAndGoodsMap, finalLogisticsOrderIdAndUnitTypeKeyAndAddressMap, finalLogOrderIdAndContractMap,
|
|
|
|
|
- dictValueAndDictResDtoMap, finalTradeIdAndOrderDetailVoMap, tradeIdAndLogOrderList, finalLogOrderIdAndSubtaskMap))
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 优化请求对象,添加过滤条件
|
|
|
|
|
+ */
|
|
|
|
|
+ private QueryLogisticsOrderReq optimizeRequestWithFilters(QueryLogisticsOrderReq req) {
|
|
|
|
|
+ QueryLogisticsOrderReq optimizedReq = new QueryLogisticsOrderReq();
|
|
|
|
|
+ BeanUtils.copyProperties(req, optimizedReq);
|
|
|
|
|
+
|
|
|
|
|
+ // 如果有承运单位或托运单位过滤条件,可以在这里添加到请求中
|
|
|
|
|
+ // 这样可以在数据库层面完成过滤,减少内存中的过滤操作
|
|
|
|
|
+
|
|
|
|
|
+ return optimizedReq;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 转换为响应对象列表
|
|
|
|
|
+ */
|
|
|
|
|
+ private List<LogisticsOrderResp> convertToResponseList(
|
|
|
|
|
+ List<KwtLogisticsOrder> records,
|
|
|
|
|
+ RelatedOrderData relatedData,
|
|
|
|
|
+ Map<String, Map<String, String>> dictMap) {
|
|
|
|
|
+
|
|
|
|
|
+ return records.stream()
|
|
|
|
|
+ .map(order -> getLogisticsOrderResp(
|
|
|
|
|
+ order,
|
|
|
|
|
+ relatedData.getUnitMap(),
|
|
|
|
|
+ relatedData.getGoodsData().getLogGoodsMap(),
|
|
|
|
|
+ relatedData.getGoodsData().getGoodsMap(),
|
|
|
|
|
+ relatedData.getAddressMap(),
|
|
|
|
|
+ relatedData.getContractMap(),
|
|
|
|
|
+ dictMap,
|
|
|
|
|
+ relatedData.getTradeMap(),
|
|
|
|
|
+ relatedData.getTradeLogOrderMap(),
|
|
|
|
|
+ relatedData.getSubtaskMap()))
|
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
|
- if (org.apache.commons.lang3.StringUtils.isNotBlank(req.getConsignCompanyId())) {
|
|
|
|
|
- resps = resps.stream()
|
|
|
|
|
- .filter(x -> org.apache.commons.lang3.StringUtils.equals(x.getConsignCompanyId(), req.getConsignCompanyId()))
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 基础查询数据
|
|
|
|
|
+ */
|
|
|
|
|
+ private static class BaseQueryData {
|
|
|
|
|
+ private final CompletableFuture<Set<Long>> entListFuture;
|
|
|
|
|
+ private final CompletableFuture<Map<String, Map<String, String>>> dictFuture;
|
|
|
|
|
+
|
|
|
|
|
+ public BaseQueryData(CompletableFuture<Set<Long>> entListFuture,
|
|
|
|
|
+ CompletableFuture<Map<String, Map<String, String>>> dictFuture) {
|
|
|
|
|
+ this.entListFuture = entListFuture;
|
|
|
|
|
+ this.dictFuture = dictFuture;
|
|
|
}
|
|
}
|
|
|
- if (org.apache.commons.lang3.StringUtils.isNotBlank(req.getCarriageCompanyId())) {
|
|
|
|
|
- resps = resps.stream()
|
|
|
|
|
- .filter(x -> org.apache.commons.lang3.StringUtils.equals(x.getCarriageCompanyId(), req.getCarriageCompanyId()))
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ public CompletableFuture<Set<Long>> getEntListFuture() {
|
|
|
|
|
+ return entListFuture;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public CompletableFuture<Map<String, Map<String, String>>> getDictFuture() {
|
|
|
|
|
+ return dictFuture;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ public Set<Long> getEntList() {
|
|
|
|
|
+ return entListFuture.join();
|
|
|
}
|
|
}
|
|
|
- return PageDataResult.of(page, resps);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 商品数据
|
|
|
|
|
+ */
|
|
|
|
|
+ private static class GoodsData {
|
|
|
|
|
+ private final Map<Long, KwtLogisticsOrderGoods> logGoodsMap;
|
|
|
|
|
+ private final Map<Long, KwpGoods> goodsMap;
|
|
|
|
|
+
|
|
|
|
|
+ public GoodsData(Map<Long, KwtLogisticsOrderGoods> logGoodsMap,
|
|
|
|
|
+ Map<Long, KwpGoods> goodsMap) {
|
|
|
|
|
+ this.logGoodsMap = logGoodsMap;
|
|
|
|
|
+ this.goodsMap = goodsMap;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public Map<Long, KwtLogisticsOrderGoods> getLogGoodsMap() {
|
|
|
|
|
+ return logGoodsMap;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public Map<Long, KwpGoods> getGoodsMap() {
|
|
|
|
|
+ return goodsMap;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 相关订单数据
|
|
|
|
|
+ */
|
|
|
|
|
+ private static class RelatedOrderData {
|
|
|
|
|
+ private final Map<String, KwtLogisticsOrderUnit> unitMap;
|
|
|
|
|
+ private final GoodsData goodsData;
|
|
|
|
|
+ private final Map<String, KwtLogisticsOrderAddress> addressMap;
|
|
|
|
|
+ private final Map<Long, KwtLogisticsOrderContract> contractMap;
|
|
|
|
|
+ private final Map<Long, List<KwtWaybillOrderSubtask>> subtaskMap;
|
|
|
|
|
+ private final Map<Long, OrderDetailVo> tradeMap;
|
|
|
|
|
+ private final Map<Long, List<KwtLogisticsOrder>> tradeLogOrderMap;
|
|
|
|
|
+
|
|
|
|
|
+ public RelatedOrderData(Map<String, KwtLogisticsOrderUnit> unitMap,
|
|
|
|
|
+ GoodsData goodsData,
|
|
|
|
|
+ Map<String, KwtLogisticsOrderAddress> addressMap,
|
|
|
|
|
+ Map<Long, KwtLogisticsOrderContract> contractMap,
|
|
|
|
|
+ Map<Long, List<KwtWaybillOrderSubtask>> subtaskMap,
|
|
|
|
|
+ Map<Long, OrderDetailVo> tradeMap,
|
|
|
|
|
+ Map<Long, List<KwtLogisticsOrder>> tradeLogOrderMap) {
|
|
|
|
|
+ this.unitMap = unitMap;
|
|
|
|
|
+ this.goodsData = goodsData;
|
|
|
|
|
+ this.addressMap = addressMap;
|
|
|
|
|
+ this.contractMap = contractMap;
|
|
|
|
|
+ this.subtaskMap = subtaskMap;
|
|
|
|
|
+ this.tradeMap = tradeMap;
|
|
|
|
|
+ this.tradeLogOrderMap = tradeLogOrderMap;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public Map<String, KwtLogisticsOrderUnit> getUnitMap() {
|
|
|
|
|
+ return unitMap;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public GoodsData getGoodsData() {
|
|
|
|
|
+ return goodsData;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public Map<String, KwtLogisticsOrderAddress> getAddressMap() {
|
|
|
|
|
+ return addressMap;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public Map<Long, KwtLogisticsOrderContract> getContractMap() {
|
|
|
|
|
+ return contractMap;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public Map<Long, List<KwtWaybillOrderSubtask>> getSubtaskMap() {
|
|
|
|
|
+ return subtaskMap;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public Map<Long, OrderDetailVo> getTradeMap() {
|
|
|
|
|
+ return tradeMap;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public Map<Long, List<KwtLogisticsOrder>> getTradeLogOrderMap() {
|
|
|
|
|
+ return tradeLogOrderMap;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 优化请求对象,添加过滤条件
|
|
|
|
|
+ */
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取缓存的字典数据
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
@NotNull
|
|
@NotNull
|
|
|
private static Set<Long> getEntList(QueryLogisticsOrderReq req) {
|
|
private static Set<Long> getEntList(QueryLogisticsOrderReq req) {
|
|
|
Set<Long> entList = Sets.newHashSet();
|
|
Set<Long> entList = Sets.newHashSet();
|
|
@@ -2384,23 +2716,40 @@ public class KwtLogisticsConsignmentService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@NotNull
|
|
@NotNull
|
|
|
- private Set<Long> getLogOrderIds(QueryLogisticsOrderReq req, Set<Long> entList, Set<Long> allEnt) {
|
|
|
|
|
|
|
+ private Set<Long> getLogOrderIds(QueryLogisticsOrderReq req, Set<Long> entList, Long allEnt) {
|
|
|
Set<Long> logOrderIds = Sets.newHashSet();
|
|
Set<Long> logOrderIds = Sets.newHashSet();
|
|
|
- if (CollectionUtils.isNotEmpty(entList)) {
|
|
|
|
|
- List<KwtLogisticsOrderUnit> logOrderUnits = logisticsOrderUnitRepository.queryByEntIds(entList);
|
|
|
|
|
- if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(logOrderUnits)) {
|
|
|
|
|
- //获取物流订单
|
|
|
|
|
- Set<Long> logOrderIdList = logOrderUnits.stream()
|
|
|
|
|
- .filter(x -> allEnt.contains(x.getEntId()))
|
|
|
|
|
|
|
+ if (Objects.nonNull(allEnt)){
|
|
|
|
|
+ entList.add(allEnt);
|
|
|
|
|
+ }
|
|
|
|
|
+ List<KwtLogisticsOrderUnit> logOrderUnits = logisticsOrderUnitRepository.queryByEntIds(entList);
|
|
|
|
|
+ if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(logOrderUnits)) {
|
|
|
|
|
+ Long entId = LoginUserHolder.getEntId();
|
|
|
|
|
+ // 获取物流订单ID集合
|
|
|
|
|
+ Set<Long> logOrderIdList = logOrderUnits.stream()
|
|
|
|
|
+ .filter(x->Objects.equals(x.getEntId(),entId))
|
|
|
|
|
+ .map(KwtLogisticsOrderUnit::getLOrderId)
|
|
|
|
|
+ .collect(Collectors.toSet());
|
|
|
|
|
+
|
|
|
|
|
+ // 根据托运单位和承运单位进行过滤
|
|
|
|
|
+ if (StringUtils.isNotBlank(req.getConsignCompanyId())) {
|
|
|
|
|
+ Set<Long> consignCompanyLogOrderIds = logOrderUnits.stream()
|
|
|
|
|
+ .filter(x -> Objects.equals(x.getEntId(), Long.valueOf(req.getConsignCompanyId())))
|
|
|
|
|
+ .map(KwtLogisticsOrderUnit::getLOrderId)
|
|
|
|
|
+ .collect(Collectors.toSet());
|
|
|
|
|
+ // 只有当托运单位过滤条件存在时,才进行交集操作
|
|
|
|
|
+ logOrderIdList.retainAll(consignCompanyLogOrderIds);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (StringUtils.isNotBlank(req.getCarriageCompanyId())) {
|
|
|
|
|
+ Set<Long> carriageCompanyLogOrderIds = logOrderUnits.stream()
|
|
|
|
|
+ .filter(x -> Objects.equals(x.getEntId(), Long.valueOf(req.getCarriageCompanyId())))
|
|
|
.map(KwtLogisticsOrderUnit::getLOrderId)
|
|
.map(KwtLogisticsOrderUnit::getLOrderId)
|
|
|
.collect(Collectors.toSet());
|
|
.collect(Collectors.toSet());
|
|
|
- Set<Long> logOrderFormUnitIds =
|
|
|
|
|
- logOrderUnits.stream()
|
|
|
|
|
- .filter(x -> logOrderIdList.contains(x.getLOrderId()))
|
|
|
|
|
- .map(KwtLogisticsOrderUnit::getLOrderId)
|
|
|
|
|
- .collect(Collectors.toSet());
|
|
|
|
|
- logOrderIds.addAll(logOrderFormUnitIds);
|
|
|
|
|
|
|
+ // 只有当承运单位过滤条件存在时,才进行交集操作
|
|
|
|
|
+ logOrderIdList.retainAll(carriageCompanyLogOrderIds);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ logOrderIds.addAll(logOrderIdList);
|
|
|
}
|
|
}
|
|
|
if (StringUtils.isNotBlank(req.getContractId())) {
|
|
if (StringUtils.isNotBlank(req.getContractId())) {
|
|
|
List<KwtLogisticsOrderContract> kwtLogisticsOrderContracts = logisticsOrderContractRepository.queryByContractId(Long.parseLong(req.getContractId()));
|
|
List<KwtLogisticsOrderContract> kwtLogisticsOrderContracts = logisticsOrderContractRepository.queryByContractId(Long.parseLong(req.getContractId()));
|
|
@@ -2424,10 +2773,10 @@ public class KwtLogisticsConsignmentService {
|
|
|
//获取物流订单
|
|
//获取物流订单
|
|
|
Set<Long> logOrderFormGoodsIds =
|
|
Set<Long> logOrderFormGoodsIds =
|
|
|
logisticsOrderGoodsList.stream().map(KwtLogisticsOrderGoods::getLOrderId).collect(Collectors.toSet());
|
|
logisticsOrderGoodsList.stream().map(KwtLogisticsOrderGoods::getLOrderId).collect(Collectors.toSet());
|
|
|
- logOrderIds.addAll(logOrderFormGoodsIds);
|
|
|
|
|
- logOrderIds = logOrderIds.stream()
|
|
|
|
|
- .filter(x->logOrderFormGoodsIds.contains(x))
|
|
|
|
|
- .collect(Collectors.toSet());
|
|
|
|
|
|
|
+ logOrderIds.retainAll(logOrderFormGoodsIds);
|
|
|
|
|
+// logOrderIds = logOrderIds.stream()
|
|
|
|
|
+// .filter(x->logOrderFormGoodsIds.contains(x))
|
|
|
|
|
+// .collect(Collectors.toSet());
|
|
|
}else {
|
|
}else {
|
|
|
logOrderIds = Sets.newHashSet();
|
|
logOrderIds = Sets.newHashSet();
|
|
|
}
|
|
}
|
|
@@ -2437,8 +2786,7 @@ public class KwtLogisticsConsignmentService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@NotNull
|
|
@NotNull
|
|
|
- private Set<Long> getAllEnt(String entId) {
|
|
|
|
|
- Set<Long> allEnt = Sets.newHashSet();
|
|
|
|
|
|
|
+ private Long getAllEnt(String entId) {
|
|
|
//根据企业类型查询企业
|
|
//根据企业类型查询企业
|
|
|
Long enterId = null;
|
|
Long enterId = null;
|
|
|
if (org.apache.commons.lang3.StringUtils.isBlank(entId)) {
|
|
if (org.apache.commons.lang3.StringUtils.isBlank(entId)) {
|
|
@@ -2446,11 +2794,8 @@ public class KwtLogisticsConsignmentService {
|
|
|
} else {
|
|
} else {
|
|
|
enterId = Long.parseLong(entId);
|
|
enterId = Long.parseLong(entId);
|
|
|
}
|
|
}
|
|
|
- if (Objects.isNull(enterId)) {
|
|
|
|
|
- return allEnt;
|
|
|
|
|
- }
|
|
|
|
|
- allEnt.add(enterId);
|
|
|
|
|
- return allEnt;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ return enterId;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@NotNull
|
|
@NotNull
|
|
@@ -3246,11 +3591,11 @@ public class KwtLogisticsConsignmentService {
|
|
|
List<LogisticsOrderV1Enum> orderV1Enums = Arrays.stream(LogisticsOrderV1Enum.values())
|
|
List<LogisticsOrderV1Enum> orderV1Enums = Arrays.stream(LogisticsOrderV1Enum.values())
|
|
|
.sorted(Comparator.comparingInt(LogisticsOrderV1Enum::getCode))
|
|
.sorted(Comparator.comparingInt(LogisticsOrderV1Enum::getCode))
|
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
|
- Set<Long> allEnt = getAllEnt(req.getEntId());
|
|
|
|
|
|
|
+ Long allEnt = getAllEnt(req.getEntId());
|
|
|
//根据托运单位或者承运单位查询企业
|
|
//根据托运单位或者承运单位查询企业
|
|
|
Set<Long> entList = getEntList(req);
|
|
Set<Long> entList = getEntList(req);
|
|
|
- if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(allEnt)) {
|
|
|
|
|
- entList.addAll(allEnt);
|
|
|
|
|
|
|
+ if (Objects.nonNull(allEnt)) {
|
|
|
|
|
+ entList.add(allEnt);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!org.apache.commons.lang3.StringUtils.isAllBlank(req.getConsignCompanyId(), req.getCarriageCompanyId())
|
|
if (!org.apache.commons.lang3.StringUtils.isAllBlank(req.getConsignCompanyId(), req.getCarriageCompanyId())
|