xdd 1 hafta önce
ebeveyn
işleme
e073171b87

+ 13 - 4
fs-service-system/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java

@@ -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());

+ 3 - 3
fs-user-app/src/main/java/com/fs/app/controller/LiveOrderController.java

@@ -73,9 +73,9 @@ public class LiveOrderController extends AppBaseController
         if (ObjectUtil.isNull(order)) {
             throw new CustomException("订单不存在");
         }
-        if (order.getStatus() < 2) {
-            throw new CustomException("未发货订单不能查询");
-        }
+//        if (order.getStatus() < 2) {
+//            throw new CustomException("未发货订单不能查询");
+//        }
         return liveOrderService.getExpressMulti(order);
     }