| | |
| | | .eq(Objects.nonNull(courseDTO.getCourseType()), Course::getCourseType, courseDTO.getCourseType()) |
| | | .eq(Objects.nonNull(courseDTO.getChargeType()), Course::getChargeType, courseDTO.getChargeType()) |
| | | .eq(Objects.nonNull(courseDTO.getListingStatus()), Course::getListingStatus, courseDTO.getListingStatus()) |
| | | .orderByDesc(Course::getSortNum); |
| | | .orderByDesc(Course::getCreateTime); |
| | | if (org.springframework.util.StringUtils.hasLength(courseDTO.getCourseTitle())){ |
| | | List<Long> collect = courseService.lambdaQuery().like(Course::getCourseTitle, courseDTO.getCourseTitle()).list() |
| | | .stream().map(Course::getId).collect(Collectors.toList()); |
| | |
| | | }else{ |
| | | clientCourseVO.setIsVip(0); |
| | | } |
| | | List<Long> collect9 = data.stream().map(AppUser::getId).collect(Collectors.toList()); |
| | | if (!collect9.isEmpty()){ |
| | | if (collect9.contains(userId)){ |
| | | clientCourseVO.setIsBuy(1); |
| | | } |
| | | } |
| | | if(byId.getChargeType() != 1){ |
| | | List<CourseChapter> list = courseChapterService.lambdaQuery().eq(CourseChapter::getCourseId, byId.getId()) |
| | | .list(); |
| | |
| | | b+=courseChapter.getVirtualLearnedNum(); |
| | | } |
| | | clientCourseVO.setCount(a+b); |
| | | clientCourseVO.setIsBuy(1); |
| | | }else if (data!=null){ |
| | | // 查询学习人数和头像列表 |
| | | clientCourseVO.setCount(data.size()); |
| | |
| | | Long data2 = remoteAppUserService.getCourseChapterHistoryCount(courseChapter.getId()).getData(); |
| | | a+=data2; |
| | | b+=courseChapter.getVirtualLearnedNum(); |
| | | courseChapter.setRealLearnedNum(a+b); |
| | | courseChapter.setVirtualLearnedNum(0); |
| | | courseChapter.setRealLearnedNum(a); |
| | | courseChapter.setVirtualLearnedNum(b); |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | if (loginUser!=null){ |
| | | Integer data1 = remoteAppUserService.getCourseChapterHistoryState(loginUser.getUserid(), courseChapter.getId()).getData(); |
| | |
| | | List<Course> courses = new ArrayList<>(); |
| | | courses.add(list1.get(0)); |
| | | courses.add(list1.get(1)); |
| | | for (Course cours : courses) { |
| | | List<CourseChapter> list3 = courseChapterService.lambdaQuery().eq(CourseChapter::getCourseId, cours.getId()).list(); |
| | | int a = 0; |
| | | int b = 0; |
| | | for (CourseChapter courseChapter : list3) { |
| | | a+= courseChapter.getVirtualLearnedNum(); |
| | | Long data2 = remoteAppUserService.getCourseChapterHistoryCount(courseChapter.getId()).getData(); |
| | | b+=data2; |
| | | } |
| | | cours.setCount(a+b); |
| | | cours.setRealLearnedNum(a+b); |
| | | } |
| | | studyPageVO.setFreeCourseList(courses); |
| | | }else if (list1.size()==1){ |
| | | List<Course> courses = new ArrayList<>(); |
| | |
| | | break; |
| | | } |
| | | } |
| | | for (Course cours : courses) { |
| | | List<CourseChapter> list3 = courseChapterService.lambdaQuery().eq(CourseChapter::getCourseId, cours.getId()).list(); |
| | | int a = 0; |
| | | int b = 0; |
| | | for (CourseChapter courseChapter : list3) { |
| | | a+= courseChapter.getVirtualLearnedNum(); |
| | | Long data2 = remoteAppUserService.getCourseChapterHistoryCount(courseChapter.getId()).getData(); |
| | | b+=data2; |
| | | } |
| | | cours.setCount(a+b); |
| | | cours.setRealLearnedNum(a+b); |
| | | } |
| | | studyPageVO.setFreeCourseList(courses); |
| | | } |
| | | studyPageVO.setCourseList(courseVOS); |