From 6e0a83c55db4bae4d23a4c281946bda1d610f678 Mon Sep 17 00:00:00 2001
From: zepengdev <lzpsmith@outlook.com>
Date: Sat, 14 Jun 2025 12:32:31 +0800
Subject: [PATCH] 补充前次提交的遗漏内容,前次提交SHA:a6f4dd

---
 oying-system/src/main/java/com/oying/modules/pc/store/rest/StoreCustomerController.java |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 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 04dd21d..3208951 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
@@ -1,5 +1,6 @@
 package com.oying.modules.pc.store.rest;
 
+import cn.hutool.core.util.ObjUtil;
 import com.oying.modules.pc.product.domain.Product;
 import com.oying.modules.pc.product.domain.dto.ProductQueryCriteria;
 import com.oying.modules.pc.product.domain.enums.ProductStatusEnum;
@@ -12,6 +13,7 @@
 import com.oying.modules.pc.store.service.StoreQualificationService;
 import com.oying.modules.pc.store.service.StoreQueryService;
 import com.oying.modules.pc.store.service.StoreService;
+import com.oying.modules.pc.store.view.CustomerStoreView;
 import com.oying.modules.pc.utils.BusinessHoursUtils;
 import com.oying.utils.PageResult;
 import com.oying.utils.R;
@@ -57,19 +59,22 @@
 
     @GetMapping(value = "/{storeId}")
     @ApiOperation("查询店铺")
-    public ResponseEntity<?> getStoreDetailsById(@PathVariable("storeId") Long storeId) {
+    public ResponseEntity<?> getStoreById(@PathVariable("storeId") Long storeId) {
         Store store = storeService.getById(storeId);
-        //store.setQualifications(this.getQualificationsByStoreId(store.getStoreId()));
-        StoreCustomerDetailDto storeDto = new StoreCustomerDetailDto();
-        BeanUtils.copyProperties(store, storeDto);
-        storeDto.setBusinessHours(BusinessHoursUtils.formatBusinessHours(store.getOpenTime(), store.getCloseTime()));
-        return ResponseEntity.ok(R.success(storeDto));
+        CustomerStoreView view = new CustomerStoreView();
+        BeanUtils.copyProperties(store, view);
+        view.setBusinessHours(BusinessHoursUtils.formatBusinessHours(store.getOpenTime(), store.getCloseTime()));
+        return ResponseEntity.ok(R.success(view));
     }
 
-    private List<StoreQualification> getQualificationsByStoreId(Long storeId) {
-        StoreQualificationQueryCriteria criteria = new StoreQualificationQueryCriteria();
-        criteria.setStoreId(storeId);
-        return storeQualificationService.queryAll(criteria);
+    @GetMapping(value = "/{storeId}/details")
+    @ApiOperation("查询店铺")
+    public ResponseEntity<?> getStoreDetailsById(@PathVariable("storeId") Long storeId) {
+        Store store = storeService.getById(storeId);
+        if (ObjUtil.isNotEmpty(store)) {
+            store.setQualifications(storeQualificationService.queryByStoreId(storeId));
+        }
+        return ResponseEntity.ok(R.success(store));
     }
 
     private List<Product> getProductsByStoreId(Long storeId) {

--
Gitblit v1.9.3