Переглянути джерело

Merge branch 'master' of http://git.zonelife.cn:3000/huangyang/national-motion-backend

zhangxin 2 тижнів тому
батько
коміт
160a5bf9ed

+ 4 - 2
national-motion-base-core/src/main/java/org/jeecg/common/constant/CommonConstant.java

@@ -75,8 +75,10 @@ public interface CommonConstant {
 	 * 操作日志类型: 导出
 	 */
 	int OPERATE_TYPE_6 = 6;
-	
-	
+
+     /** 小程序用户注册关联orgCode */
+     String REGISTER_ORG_CODE = "A02A03";
+
 	/** {@code 500 Server Error} (HTTP/1.0 - RFC 1945) */
     Integer SC_INTERNAL_SERVER_ERROR_500 = 500;
     /** {@code 404 Not Found} (HTTP/1.0 - RFC 1945) */

+ 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;
     }
 

+ 3 - 4
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/UserServiceImpl.java

@@ -28,8 +28,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.UUID;
 
-import static org.jeecg.common.constant.CommonConstant.PREFIX_USER_TOKEN;
-import static org.jeecg.common.constant.CommonConstant.SC_INTERNAL_SERVER_ERROR_500;
+import static org.jeecg.common.constant.CommonConstant.*;
 
 @Service
 @Log4j2
@@ -72,9 +71,9 @@ public class UserServiceImpl implements IUserService {
                             .setCreateBy("admin")
                             .setRealname("微信用户")
                             .setUsername("微信用户_" + UUID.randomUUID())
-                            .setOrgCode("A02A03");
+                            .setOrgCode(REGISTER_ORG_CODE);
                 familyMembersMapper.insert(new FamilyMembers().setDelFlag(0).setUserId(user.getId()).setUserType(0).setRealNameStatus(0));
-                SysDepart sysDepart = sysDepartMapper.selectOne(Wrappers.<SysDepart>lambdaQuery().eq(SysDepart::getOrgCode, "A03"));
+                SysDepart sysDepart = sysDepartMapper.selectOne(Wrappers.<SysDepart>lambdaQuery().eq(SysDepart::getOrgCode, REGISTER_ORG_CODE));
                 sysUserDepartMapper.insert(new SysUserDepart(user.getId(),sysDepart.getId()));
                 boolean result = sysUserMapper.insert(user) > 0;
                     if (!result) {

+ 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;
     }
 }