瀏覽代碼

商家pc端-酒水管理

qrs 1 周之前
父節點
當前提交
d4112a83c2

+ 12 - 10
alien-store-platform/src/main/java/shop/alien/storeplatform/service/impl/StorePlatformBarMenuServiceImpl.java

@@ -96,16 +96,18 @@ public class StorePlatformBarMenuServiceImpl extends ServiceImpl<StorePlatformSt
 
 
         // 查询图片
         // 查询图片
         List<Integer> ids = list.stream().map(StorePlatformStoreMenu::getId).collect(Collectors.toList());
         List<Integer> ids = list.stream().map(StorePlatformStoreMenu::getId).collect(Collectors.toList());
-        List<StoreImg> imgList = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>()
-                .eq(StoreImg::getStoreId, storeId).eq(StoreImg::getImgType, 7).in(StoreImg::getBusinessId, ids));
-
-        if (CollectionUtil.isNotEmpty(imgList)) {
-            list.forEach(menu -> {
-                imgList.stream()
-                        .filter(img -> img.getBusinessId().equals(menu.getId()))
-                        .findFirst()
-                        .ifPresent(img -> menu.setImgUrl(img.getImgUrl()));
-            });
+        if (CollectionUtil.isNotEmpty(ids)) {
+            List<StoreImg> imgList = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>()
+                    .eq(StoreImg::getStoreId, storeId).eq(StoreImg::getImgType, 7).in(StoreImg::getBusinessId, ids));
+
+            if (CollectionUtil.isNotEmpty(imgList)) {
+                list.forEach(menu -> {
+                    imgList.stream()
+                            .filter(img -> img.getBusinessId().equals(menu.getId()))
+                            .findFirst()
+                            .ifPresent(img -> menu.setImgUrl(img.getImgUrl()));
+                });
+            }
         }
         }
 
 
 //        // 查询图片
 //        // 查询图片