|
@@ -7,7 +7,7 @@ import org.jeecg.modules.app.dto.SearchDTO;
|
|
|
import org.jeecg.modules.app.service.IAppHomeService;
|
|
|
import org.jeecg.modules.app.vo.*;
|
|
|
import org.jeecg.modules.system.app.entity.AppBanner;
|
|
|
-import org.jeecg.modules.system.app.entity.AppCourese;
|
|
|
+import org.jeecg.modules.system.app.entity.AppCourses;
|
|
|
import org.jeecg.modules.system.app.entity.AppInstructor;
|
|
|
import org.jeecg.modules.system.app.mapper.*;
|
|
|
import org.jeecg.modules.system.entity.SysDepart;
|
|
@@ -41,6 +41,8 @@ public class AppHomeServiceImpl implements IAppHomeService {
|
|
|
private AppSiteMapper appSiteMapper;
|
|
|
@Resource
|
|
|
private AppCategoryMapper appCategoryMapper;
|
|
|
+ @Resource
|
|
|
+ private AppGameMapper appGameMapper;
|
|
|
|
|
|
@Override
|
|
|
public HomeVO homeInfo() {
|
|
@@ -49,17 +51,17 @@ public class AppHomeServiceImpl implements IAppHomeService {
|
|
|
.eq(AppBanner::getDelFlag, 0).eq(AppBanner::getIsEnabled,1));
|
|
|
|
|
|
// 精品课程(最多3个)
|
|
|
- List<AppCourese> appCoureseFine = appCoursesMapper.selectList(Wrappers.<AppCourese>lambdaQuery()
|
|
|
- .eq(AppCourese::getPriceType, 0).last("LIMIT 3"));
|
|
|
+ List<AppCourses> appCoursesFine = appCoursesMapper.selectList(Wrappers.<AppCourses>lambdaQuery()
|
|
|
+ .eq(AppCourses::getPriceType, 0).last("LIMIT 3"));
|
|
|
|
|
|
// 免费课程(最多3个)
|
|
|
- List<AppCourese> appCoureseFree = appCoursesMapper.selectList(Wrappers.<AppCourese>lambdaQuery()
|
|
|
- .eq(AppCourese::getPriceType, 1).last("LIMIT 3"));
|
|
|
+ List<AppCourses> appCoursesFree = appCoursesMapper.selectList(Wrappers.<AppCourses>lambdaQuery()
|
|
|
+ .eq(AppCourses::getPriceType, 1).last("LIMIT 3"));
|
|
|
|
|
|
// 合并课程信息
|
|
|
List<CoureseVO> courseVO = new ArrayList<>();
|
|
|
- courseVO.addAll(convertToCoureseVOList(appCoureseFine));
|
|
|
- courseVO.addAll(convertToCoureseVOList(appCoureseFree));
|
|
|
+ courseVO.addAll(convertToCoureseVOList(appCoursesFine));
|
|
|
+ courseVO.addAll(convertToCoureseVOList(appCoursesFree));
|
|
|
|
|
|
// 获取好评率最高的两个教练 ID
|
|
|
List<String> topInstructorUserIds = sysUserMapper.getUserIdListByRoleId(INSTRUCTOR).stream()
|
|
@@ -93,8 +95,8 @@ public class AppHomeServiceImpl implements IAppHomeService {
|
|
|
.eq(SysDepart::getOrgCode, sysUser.getOrgCode())).getDepartName());
|
|
|
|
|
|
// 获取该教练的课程(最多取2个)
|
|
|
- List<AppCourese> courses = appCoursesMapper.selectList(
|
|
|
- Wrappers.<AppCourese>lambdaQuery().eq(AppCourese::getUserId, userId).last("LIMIT 2"));
|
|
|
+ List<AppCourses> courses = appCoursesMapper.selectList(
|
|
|
+ Wrappers.<AppCourses>lambdaQuery().eq(AppCourses::getUserId, userId).last("LIMIT 2"));
|
|
|
|
|
|
List<InstructorVO.CourseInfoVO> courseInfoVOS = courses.stream()
|
|
|
.map(course -> {
|
|
@@ -126,10 +128,10 @@ public class AppHomeServiceImpl implements IAppHomeService {
|
|
|
* @Author SheepHy
|
|
|
* @Description 合并课程信息
|
|
|
* @Date 9:14 2025/7/4
|
|
|
- * @Param appCoureseList {@link List<AppCourese>}
|
|
|
+ * @Param appCoureseList {@link List<AppCourses>}
|
|
|
* @return List<CoureseVO> {@link List<CoureseVO>}
|
|
|
**/
|
|
|
- private List<CoureseVO> convertToCoureseVOList(List<AppCourese> appCoureseList) {
|
|
|
+ private List<CoureseVO> convertToCoureseVOList(List<AppCourses> appCoureseList) {
|
|
|
return appCoureseList.stream()
|
|
|
.map(courese -> new CoureseVO()
|
|
|
.setId(courese.getId()).setCover(courese.getCover())
|
|
@@ -168,7 +170,7 @@ public class AppHomeServiceImpl implements IAppHomeService {
|
|
|
case '1':
|
|
|
return convertSearchTrainVOPage(searchDTO);
|
|
|
case '2':
|
|
|
- return new Page<>();
|
|
|
+ return convertSearchCompetitionVOPage(searchDTO);
|
|
|
case '3':
|
|
|
return new Page<>();
|
|
|
}
|
|
@@ -221,8 +223,8 @@ public class AppHomeServiceImpl implements IAppHomeService {
|
|
|
* @Author SheepHy
|
|
|
* @Description 培训课程分页查询
|
|
|
* @Date 13:37 2025/7/7
|
|
|
- * @Param
|
|
|
- * @return
|
|
|
+ * @Param searchDTO {@link SearchDTO}
|
|
|
+ * @return Page<SearchVO.SearchTrainVO>
|
|
|
**/
|
|
|
private Page<SearchVO.SearchTrainVO> convertSearchTrainVOPage(SearchDTO searchDTO) {
|
|
|
Page<SearchVO.SearchTrainVO> page = new Page<>(searchDTO.getCurrent(), searchDTO.getSize());
|
|
@@ -234,4 +236,33 @@ public class AppHomeServiceImpl implements IAppHomeService {
|
|
|
return searchTrainVOPage;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @Author SheepHy
|
|
|
+ * @Description 赛事分页查询
|
|
|
+ * @Date 14:04 2025/7/7
|
|
|
+ * @Param searchDTO {@link SearchDTO}
|
|
|
+ * @return Page<SearchVO.SearchRaceVO>
|
|
|
+ **/
|
|
|
+ private Page<SearchVO.SearchRaceVO> convertSearchCompetitionVOPage(SearchDTO searchDTO) {
|
|
|
+ Page<SearchVO.SearchRaceVO> page = new Page<>(searchDTO.getCurrent(), searchDTO.getSize());
|
|
|
+ Page<SearchVO.SearchRaceVO> searchCompetitionVOPage = appGameMapper.convertSearchCompetitionVOPage(page, searchDTO);
|
|
|
+ searchCompetitionVOPage.getRecords().forEach(competitionVO -> {
|
|
|
+ //todo 待申请第三方地图接口
|
|
|
+ competitionVO.setKm(0.0);
|
|
|
+ });
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Author SheepHy
|
|
|
+ * @Description //TODO
|
|
|
+ * @Date 14:43 2025/7/7
|
|
|
+ * @Param
|
|
|
+ * @return
|
|
|
+ **/
|
|
|
+ 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;
|
|
|
+ }
|
|
|
}
|