Просмотр исходного кода

feat(app): 门店详情信息查询功能

- 新增 getPlaceInfo 接口,用于查询门店详情信息
- 实现 IDetailService 接口,提供门店详情查询服务
- 更新 PlaceInfoVO 类,移除不必要的字段
SheepHy 2 недель назад
Родитель
Сommit
9d3c2cd940

+ 17 - 4
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/controller/AppHomeController.java

@@ -9,11 +9,9 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.modules.app.dto.GetPlaceListDTO;
 import org.jeecg.modules.app.dto.SearchDTO;
 import org.jeecg.modules.app.service.IAppHomeService;
+import org.jeecg.modules.app.service.IDetailService;
 import org.jeecg.modules.app.service.IUserService;
-import org.jeecg.modules.app.vo.HomeVO;
-import org.jeecg.modules.app.vo.MsgInfoVO;
-import org.jeecg.modules.app.vo.MsgVO;
-import org.jeecg.modules.app.vo.PlaceVO;
+import org.jeecg.modules.app.vo.*;
 import org.jeecg.modules.system.app.entity.AppSearchHot;
 import org.springframework.web.bind.annotation.*;
 
@@ -29,6 +27,8 @@ public class AppHomeController {
     private IAppHomeService appHomeService;
     @Resource
     private IUserService userService;
+    @Resource
+    private IDetailService detailService;
 
     @GetMapping("/homeInfo")
     @Operation(summary = "首页基础数据查询")
@@ -97,4 +97,17 @@ public class AppHomeController {
     public Result<List<AppSearchHot>> getHotSearch(){
         return Result.ok(appHomeService.getHotSearch());
     }
+
+    /**
+     * @Author SheepHy
+     * @Description 门店详情信息查询
+     * @Date 19:41 2025/7/7
+     * @Param id 门店id
+     * @return PlaceInfoVO {@link PlaceInfoVO}
+     **/
+    @GetMapping("/getPlaceInfo")
+    @Operation(summary = "门店详情信息查询")
+    public Result<PlaceInfoVO> getPlaceInfo(@RequestParam @Schema(description="门店ID") String id){
+        return Result.ok(detailService.getPlaceInfo(id));
+    }
 }

+ 18 - 2
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/DetailServiceImpl.java

@@ -3,30 +3,43 @@ package org.jeecg.modules.app.service.impl;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import org.jeecg.modules.app.service.IDetailService;
 import org.jeecg.modules.app.vo.PlaceInfoVO;
+import org.jeecg.modules.system.app.entity.AppInstructor;
 import org.jeecg.modules.system.app.entity.AppOrderProduct;
 import org.jeecg.modules.system.app.entity.AppSite;
 import org.jeecg.modules.system.app.entity.AppSitePriceRules;
 import org.jeecg.modules.system.app.mapper.*;
+import org.springframework.beans.BeanUtils;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
 import java.util.List;
 
 public class DetailServiceImpl implements IDetailService {
     @Resource
     private AppSiteMapper appSiteMapper;
     @Resource
-    private AppCoursesMapper appCoursesMapper;
-    @Resource
     private AppCoursesPriceRulesMapper appCoursesPriceRulesMapper;
     @Resource
     private AppOrderProductMapper appOrderProductMapper;
     @Resource
     private AppSitePriceRulesMapper appSitePriceRulesMapper;
+    @Resource
+    private AppInstructorMapper appInstructorMapper;
 
     @Override
     public PlaceInfoVO getPlaceInfo(String id) {
         AppSite appSite = appSiteMapper.selectById(id);
         PlaceInfoVO placeInfo = appSiteMapper.getPlaceInfo(id);
+        List<PlaceInfoVO.InstructorVO> instructorVOList = new ArrayList<>();
+        List<AppInstructor> appInstructors = appInstructorMapper.selectList(Wrappers.<AppInstructor>lambdaQuery()
+                .eq(AppInstructor::getOrgCode, appSite.getOrgCode()));
+        if (appInstructors != null) {
+            for (AppInstructor instructor : appInstructors) {
+                PlaceInfoVO.InstructorVO vo = new PlaceInfoVO.InstructorVO();
+                BeanUtils.copyProperties(vo, instructor); // 注意参数顺序
+                instructorVOList.add(vo);
+            }
+        }
         AppSitePriceRules appSitePriceRules = appSitePriceRulesMapper.selectOne(Wrappers.<AppSitePriceRules>lambdaQuery()
                 .eq(AppSitePriceRules::getSiteId, id)
                 .eq(AppSitePriceRules::getStatus, 0)
@@ -36,6 +49,9 @@ public class DetailServiceImpl implements IDetailService {
                 .setSales(getPlaceSales(id))
                 .setOriginalPrice(appSitePriceRules.getOriginalPrice())
                 .setSellingPrice(appSitePriceRules.getSellingPrice());
+        placeInfo.setInstructorVOList(instructorVOList)
+                .setPlaceInfoMsgVO(placeInfoMsgVO);
+        //todo 评价查询待添加
         return placeInfo;
     }
 

+ 0 - 2
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/PlaceInfoVO.java

@@ -97,7 +97,5 @@ public class PlaceInfoVO {
         private String avatar;
         @Schema(description = "擅长说明")
         private String excelMsg;
-        @Schema(description = "教练数量")
-        private int count;
     }
 }