|  | @@ -9,6 +9,7 @@ import org.jeecg.modules.app.vo.*;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.system.app.entity.AppBanner;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.system.app.entity.AppCourses;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.system.app.entity.AppInstructor;
 | 
	
		
			
				|  |  | +import org.jeecg.modules.system.app.entity.AppSearchHot;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.system.app.mapper.*;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.system.entity.SysDepart;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.system.entity.SysUser;
 | 
	
	
		
			
				|  | @@ -43,6 +44,8 @@ public class AppHomeServiceImpl implements IAppHomeService {
 | 
	
		
			
				|  |  |      private AppCategoryMapper appCategoryMapper;
 | 
	
		
			
				|  |  |      @Resource
 | 
	
		
			
				|  |  |      private AppGameMapper appGameMapper;
 | 
	
		
			
				|  |  | +    @Resource
 | 
	
		
			
				|  |  | +    private AppSearchHotMapper appSearchHotMapper;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public HomeVO homeInfo() {
 | 
	
	
		
			
				|  | @@ -164,6 +167,18 @@ public class AppHomeServiceImpl implements IAppHomeService {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public Object search(SearchDTO searchDTO) {
 | 
	
		
			
				|  |  | +        AppSearchHot appSearchHot = appSearchHotMapper.selectOne(Wrappers.<AppSearchHot>lambdaQuery()
 | 
	
		
			
				|  |  | +                .eq(AppSearchHot::getSearchContent, searchDTO.getKeyword())
 | 
	
		
			
				|  |  | +                .last("LIMIT 1"));
 | 
	
		
			
				|  |  | +        if(null == appSearchHot){
 | 
	
		
			
				|  |  | +            appSearchHotMapper.insert(new AppSearchHot()
 | 
	
		
			
				|  |  | +                    .setSearchContent(searchDTO.getKeyword())
 | 
	
		
			
				|  |  | +                    .setSearchCount(1)
 | 
	
		
			
				|  |  | +                    .setIsActive(1)
 | 
	
		
			
				|  |  | +                    .setIsRecommend(0));
 | 
	
		
			
				|  |  | +        }else {
 | 
	
		
			
				|  |  | +            appSearchHotMapper.updateById(appSearchHot.setSearchCount(appSearchHot.getSearchCount() + 1));
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          switch (searchDTO.getVenueType().charAt(0)) {
 | 
	
		
			
				|  |  |              case '0':
 | 
	
		
			
				|  |  |                      return convertSearchPlaceVOPage(searchDTO);
 | 
	
	
		
			
				|  | @@ -172,10 +187,17 @@ public class AppHomeServiceImpl implements IAppHomeService {
 | 
	
		
			
				|  |  |              case '2':
 | 
	
		
			
				|  |  |                      return convertSearchCompetitionVOPage(searchDTO);
 | 
	
		
			
				|  |  |              case '3':
 | 
	
		
			
				|  |  | -                    return new Page<>();
 | 
	
		
			
				|  |  | +                    return convertSearchInstructorVOPage(searchDTO);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          return new Page<>();
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public List<AppSearchHot> getHotSearch() {
 | 
	
		
			
				|  |  | +        return appSearchHotMapper.selectList(Wrappers.<AppSearchHot>lambdaQuery()
 | 
	
		
			
				|  |  | +                .last("LIMIT 10").orderByDesc(AppSearchHot::getSearchCount));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  |       * @Author SheepHy
 | 
	
		
			
				|  |  |       * @Description 全局搜索场地分页查询
 | 
	
	
		
			
				|  | @@ -212,10 +234,12 @@ public class AppHomeServiceImpl implements IAppHomeService {
 | 
	
		
			
				|  |  |       **/
 | 
	
		
			
				|  |  |      private List<String> getCategoryName(String categoryId) {
 | 
	
		
			
				|  |  |          List<String> list = new ArrayList<>();
 | 
	
		
			
				|  |  | -        String[] split = categoryId.split(",");
 | 
	
		
			
				|  |  | -        Arrays.stream(split).forEach(id -> {
 | 
	
		
			
				|  |  | -            list.add(appCategoryMapper.selectById(id).getName());
 | 
	
		
			
				|  |  | -        });
 | 
	
		
			
				|  |  | +        if(null != categoryId){
 | 
	
		
			
				|  |  | +            String[] split = categoryId.split(",");
 | 
	
		
			
				|  |  | +            Arrays.stream(split).forEach(id -> {
 | 
	
		
			
				|  |  | +                list.add(appCategoryMapper.selectById(id).getName());
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          return list;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -257,12 +281,26 @@ public class AppHomeServiceImpl implements IAppHomeService {
 | 
	
		
			
				|  |  |       * @Author SheepHy
 | 
	
		
			
				|  |  |       * @Description //TODO 
 | 
	
		
			
				|  |  |       * @Date 14:43 2025/7/7
 | 
	
		
			
				|  |  | -     * @Param
 | 
	
		
			
				|  |  | -     * @return 
 | 
	
		
			
				|  |  | +     * @Param searchDTO {@link SearchDTO}
 | 
	
		
			
				|  |  | +     * @return Page<SearchVO.SearchInstructorVO>
 | 
	
		
			
				|  |  |       **/
 | 
	
		
			
				|  |  |      private Page<SearchVO.SearchInstructorVO> convertSearchInstructorVOPage(SearchDTO searchDTO) {
 | 
	
		
			
				|  |  |          Page<SearchVO.SearchInstructorVO> page = new Page<>(searchDTO.getCurrent(), searchDTO.getSize());
 | 
	
		
			
				|  |  | -//        Page<SearchVO.SearchInstructorVO> searchInstructorVOPage = appInstructorMapper.convertSearchInstructorVOPage(page, searchDTO);
 | 
	
		
			
				|  |  | -        return page;
 | 
	
		
			
				|  |  | +        Page<SearchVO.SearchInstructorVO> searchInstructorVOPage = appInstructorMapper.convertSearchInstructorVOPage(page, searchDTO);
 | 
	
		
			
				|  |  | +        searchInstructorVOPage.getRecords().forEach(instructorVO -> {
 | 
	
		
			
				|  |  | +            // 获取该教练的课程(最多取2个)
 | 
	
		
			
				|  |  | +            List<AppCourses> courses = appCoursesMapper.selectList(
 | 
	
		
			
				|  |  | +                    Wrappers.<AppCourses>lambdaQuery().eq(AppCourses::getUserId, instructorVO.getUserId()).last("LIMIT 2"));
 | 
	
		
			
				|  |  | +            List<SearchVO.SearchCoursesVO> courseInfoVOS = courses.stream()
 | 
	
		
			
				|  |  | +                    .map(course -> {
 | 
	
		
			
				|  |  | +                        SearchVO.SearchCoursesVO vo = new SearchVO.SearchCoursesVO();
 | 
	
		
			
				|  |  | +                        BeanUtils.copyProperties(vo, course);
 | 
	
		
			
				|  |  | +                        return vo;
 | 
	
		
			
				|  |  | +                    })
 | 
	
		
			
				|  |  | +                    .collect(Collectors.toList());
 | 
	
		
			
				|  |  | +            instructorVO.setKm(0.0)
 | 
	
		
			
				|  |  | +                    .setCourseList(courseInfoVOS);
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +        return searchInstructorVOPage;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  }
 |