|
@@ -2235,13 +2235,16 @@ public class KwtLogisticsConsignmentService {
|
|
|
Set<Long> allEnt = getAllEnt(req.getEntId());
|
|
Set<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);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
//根据商品名称查询物流订单
|
|
//根据商品名称查询物流订单
|
|
|
- Set<Long> logOrderIds = getLogOrderIds(req, entList);
|
|
|
|
|
|
|
+ Set<Long> logOrderIds = getLogOrderIds(req, entList,allEnt);
|
|
|
|
|
|
|
|
|
|
|
|
|
//分页查询物流订单
|
|
//分页查询物流订单
|
|
|
- IPage<KwtLogisticsOrder> page = logisticsOrderRepository.queryByPage(allEnt,logOrderIds,req.getTradeOrderId(), req.getOrderNo(),req.getOrderStatus(),
|
|
|
|
|
|
|
+ IPage<KwtLogisticsOrder> page = logisticsOrderRepository.queryByPage(logOrderIds,req.getTradeOrderId(), req.getOrderNo(),req.getOrderStatus(),
|
|
|
req.getStartTime(), req.getEndTime(), req.getPageNum(), req.getPageSize());
|
|
req.getStartTime(), req.getEndTime(), req.getPageNum(), req.getPageSize());
|
|
|
List<KwtLogisticsOrder> records = page.getRecords();
|
|
List<KwtLogisticsOrder> records = page.getRecords();
|
|
|
if(org.springframework.util.CollectionUtils.isEmpty(records)){
|
|
if(org.springframework.util.CollectionUtils.isEmpty(records)){
|
|
@@ -2352,7 +2355,7 @@ public class KwtLogisticsConsignmentService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@NotNull
|
|
@NotNull
|
|
|
- private Set<Long> getLogOrderIds(QueryLogisticsOrderReq req, Set<Long> entList) {
|
|
|
|
|
|
|
+ private Set<Long> getLogOrderIds(QueryLogisticsOrderReq req, Set<Long> entList, Set<Long> allEnt) {
|
|
|
Set<Long> logOrderIds = Sets.newHashSet();
|
|
Set<Long> logOrderIds = Sets.newHashSet();
|
|
|
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()));
|
|
@@ -2378,8 +2381,15 @@ public class KwtLogisticsConsignmentService {
|
|
|
List<KwtLogisticsOrderUnit> logOrderUnits =logisticsOrderUnitRepository.queryByEntIds(entList);
|
|
List<KwtLogisticsOrderUnit> logOrderUnits =logisticsOrderUnitRepository.queryByEntIds(entList);
|
|
|
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(logOrderUnits)){
|
|
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(logOrderUnits)){
|
|
|
//获取物流订单
|
|
//获取物流订单
|
|
|
|
|
+ Set<Long> logOrderIdList = logOrderUnits.stream()
|
|
|
|
|
+ .filter(x -> allEnt.contains(x.getEntId()))
|
|
|
|
|
+ .map(KwtLogisticsOrderUnit::getLOrderId)
|
|
|
|
|
+ .collect(Collectors.toSet());
|
|
|
Set<Long> logOrderFormUnitIds =
|
|
Set<Long> logOrderFormUnitIds =
|
|
|
- logOrderUnits.stream().map(KwtLogisticsOrderUnit::getLOrderId).collect(Collectors.toSet());
|
|
|
|
|
|
|
+ logOrderUnits.stream()
|
|
|
|
|
+ .filter(x->logOrderIdList.contains(x.getLOrderId()))
|
|
|
|
|
+ .map(KwtLogisticsOrderUnit::getLOrderId)
|
|
|
|
|
+ .collect(Collectors.toSet());
|
|
|
logOrderIds.addAll(logOrderFormUnitIds);
|
|
logOrderIds.addAll(logOrderFormUnitIds);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -3029,6 +3039,10 @@ public class KwtLogisticsConsignmentService {
|
|
|
Set<Long> allEnt = getAllEnt(req.getEntId());
|
|
Set<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 (!org.apache.commons.lang3.StringUtils.isAllBlank(req.getConsignCompanyId(),req.getCarriageCompanyId())
|
|
if (!org.apache.commons.lang3.StringUtils.isAllBlank(req.getConsignCompanyId(),req.getCarriageCompanyId())
|
|
|
&& org.apache.commons.collections4.CollectionUtils.isEmpty(entList)){
|
|
&& org.apache.commons.collections4.CollectionUtils.isEmpty(entList)){
|
|
|
Map<Integer, List<KwtLogisticsOrder>> statusAndLogOrdersMap = Maps.newHashMap() ;
|
|
Map<Integer, List<KwtLogisticsOrder>> statusAndLogOrdersMap = Maps.newHashMap() ;
|
|
@@ -3040,8 +3054,8 @@ public class KwtLogisticsConsignmentService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//根据商品名称查询物流订单
|
|
//根据商品名称查询物流订单
|
|
|
- Set<Long> logOrderIds = getLogOrderIds(req, entList);
|
|
|
|
|
- List<KwtLogisticsOrder> logisticsOrders =logisticsOrderRepository.queryList(allEnt,logOrderIds,req.getTradeOrderId(), req.getOrderNo(),req.getOrderStatus(),
|
|
|
|
|
|
|
+ Set<Long> logOrderIds = getLogOrderIds(req, entList,allEnt);
|
|
|
|
|
+ List<KwtLogisticsOrder> logisticsOrders =logisticsOrderRepository.queryList(logOrderIds,req.getTradeOrderId(), req.getOrderNo(),req.getOrderStatus(),
|
|
|
req.getStartTime(), req.getEndTime());
|
|
req.getStartTime(), req.getEndTime());
|
|
|
|
|
|
|
|
if (Objects.isNull(logisticsOrders)){
|
|
if (Objects.isNull(logisticsOrders)){
|