From 30943f4a43f9b3b997033ce13939ce380b3d8164 Mon Sep 17 00:00:00 2001
From: zepengdev <lzpsmith@outlook.com>
Date: Mon, 21 Jul 2025 22:58:38 +0800
Subject: [PATCH] fix: 商品详情信息增加类目ID字段

---
 oying-system/src/main/java/com/oying/modules/pc/store/rest/StoreCustomerController.java |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/oying-system/src/main/java/com/oying/modules/pc/store/rest/StoreCustomerController.java b/oying-system/src/main/java/com/oying/modules/pc/store/rest/StoreCustomerController.java
index 3a12592..bfcf1c1 100644
--- a/oying-system/src/main/java/com/oying/modules/pc/store/rest/StoreCustomerController.java
+++ b/oying-system/src/main/java/com/oying/modules/pc/store/rest/StoreCustomerController.java
@@ -7,6 +7,7 @@
 import com.oying.modules.pc.product.service.ProductService;
 import com.oying.modules.pc.store.domain.Store;
 import com.oying.modules.pc.store.domain.dto.StoreQueryCriteria;
+import com.oying.modules.pc.store.domain.enums.StoreStatusEnum;
 import com.oying.modules.pc.store.service.StoreQualificationService;
 import com.oying.modules.pc.store.service.StoreQueryService;
 import com.oying.modules.pc.store.service.StoreService;
@@ -46,11 +47,10 @@
     @GetMapping(value = "/page")
     @ApiOperation("查询店铺")
     public ResponseEntity<?> getStoresByPage(StoreQueryCriteria criteria) {
+        criteria.setLimit(1000);
+        criteria.setBusinessStatus(StoreStatusEnum.OPEN.getValue());
         PageResult<Store> pagedStores = storeQueryService.findPagedStores(criteria);
-        List<Store> stores = pagedStores.getContent();
-        for (Store store : stores) {
-            store.setProducts(this.getProductsByStoreId(store.getStoreId()));
-        }
+        pagedStores.getContent().forEach(store -> store.setProducts(this.getProductsByStoreId(store.getStoreId())));
         return ResponseEntity.ok(R.success(pagedStores));
     }
 
@@ -69,7 +69,7 @@
     public ResponseEntity<?> getStoreDetailsById(@PathVariable("storeId") Long storeId) {
         Store store = storeService.getById(storeId);
         if (ObjUtil.isNotEmpty(store)) {
-            store.setQualifications(storeQualificationService.queryByStoreId(storeId));
+            store.setQualifications(storeQualificationService.getByStoreId(storeId));
         }
         return ResponseEntity.ok(R.success(store));
     }
@@ -77,7 +77,7 @@
     private List<Product> getProductsByStoreId(Long storeId) {
         ProductQueryCriteria criteria = new ProductQueryCriteria();
         criteria.setStoreId(storeId);
-        criteria.setStatus(ProductStatusEnum.AVAILABLE.getValue());
+        criteria.setShelfStatus(ProductStatusEnum.AVAILABLE.getValue());
         criteria.setLimit(3);
         return productService.queryAll(criteria);
     }

--
Gitblit v1.9.3