|
|
@@ -710,9 +710,14 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
if(CollectionUtils.isEmpty(liveOrders)){
|
|
|
return liveOrders;
|
|
|
}
|
|
|
+ List<Long> collect = liveOrders.stream().map(LiveOrder::getOrderId)
|
|
|
+ .filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
+
|
|
|
+ if(CollectionUtils.isEmpty(collect)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
Map<Long, FsStoreDelivers> byOrderIdWithTypeBatch = fsStoreDeliversMapper
|
|
|
- .findByOrderIdWithTypeBatch(liveOrders.stream().map(LiveOrder::getOrderId)
|
|
|
- .filter(Objects::nonNull).collect(Collectors.toList()), 1);
|
|
|
+ .findByOrderIdWithTypeBatch(collect, 1);
|
|
|
|
|
|
for (LiveOrder order : liveOrders) {
|
|
|
FsStoreDelivers delivers = byOrderIdWithTypeBatch.get(order.getOrderId());
|
|
|
@@ -736,10 +741,14 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
@Override
|
|
|
public List<LiveOrderListVo> selectLiveOrderListVo(LiveOrder liveOrder) {
|
|
|
List<LiveOrderListVo> liveOrders = baseMapper.selectLiveOrderListVo(liveOrder.getUserId(),liveOrder.getStatus());
|
|
|
+ List<Long> collect = liveOrders.stream().map(LiveOrderListVo::getOrderId)
|
|
|
+ .filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
|
|
|
+ if(CollectionUtils.isEmpty(collect)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
Map<Long, FsStoreDelivers> byOrderIdWithTypeBatch = fsStoreDeliversMapper
|
|
|
- .findByOrderIdWithTypeBatch(liveOrders.stream().map(LiveOrderListVo::getOrderId)
|
|
|
- .filter(Objects::nonNull).collect(Collectors.toList()), 1);
|
|
|
+ .findByOrderIdWithTypeBatch(collect, 1);
|
|
|
|
|
|
for (LiveOrderListVo order : liveOrders) {
|
|
|
FsStoreDelivers delivers = byOrderIdWithTypeBatch.get(order.getOrderId());
|