| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alipay.api.domain.Person; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | queryWrapper.in(PostCourseVideo::getCoursePackageId,courseIds); |
| | | } |
| | | videoList = pcvMapper.selectList(queryWrapper); |
| | | // TODO: 2023/8/3 始终查出来是 空的 |
| | | System.out.println(videoList); |
| | | if (videoList.size() > 0){ |
| | | List<Integer> videoIds = videoList.stream().map(PostCourseVideo::getCourseId).collect(Collectors.toList()); |
| | | List<UserVideoDetails> userVideoDetails = uvdmapper.selectList(new QueryWrapper<UserVideoDetails>() |
| | |
| | | BenefitsVideos videosWithIds = bfvoClient.getVideosWithIds(userVideoDetail.getCourseId()); |
| | | response.setVideoId(userVideoDetail.getCourseId()); |
| | | response.setCoverImage(videosWithIds.getCover()); |
| | | if (null != search.getSearch()){ |
| | | // 根据正则模糊匹配 |
| | | String pattern = ".*" + search.getSearch() + ".*"; |
| | | Pattern regex = Pattern.compile(pattern); |
| | | Matcher matcher = regex.matcher(videosWithIds.getName()); |
| | | if (matcher.matches()) { |
| | | response.setVideoName(videosWithIds.getName()); |
| | | } |
| | | }else { |
| | | response.setVideoName(videosWithIds.getName()); |
| | | } |
| | | response.setVideoName(videosWithIds.getName()); |
| | | response.setSynopsis(videosWithIds.getIntroduction()); |
| | | response.setIntegral(videosWithIds.getIntegral()); |
| | | response.setStudyStatus(userVideoDetail.getState()); |
| | | responses.add(response); |
| | | } |
| | | Collections.sort(responses, Comparator.comparing(AppUserVideoResponse::getStudyStatus)); |
| | | } |
| | | if (ToolUtil.isNotEmpty(search.getSearch())){ |
| | | responses = responses.stream() |
| | | .filter(person -> person.getPackageName().contains(search.getSearch())) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | if (ToolUtil.isNotEmpty(search.getCourseTypeId())){ |
| | | responses = responses.stream() |
| | | .filter(person -> Objects.equals(person.getCoursePackageId(), search.getCourseTypeId())) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | | return responses; |
| | |
| | | response.setPackageName(coursePackage.getName()); |
| | | response.setSynopsis(videosWithIds.getIntroduction()); |
| | | response.setDetailedDiagram(coursePackage.getIntroduceDrawing()); |
| | | response.setCover(videosWithIds.getCover()); |
| | | } |
| | | |
| | | return response; |
| | |
| | | List<RegisterCourseVo> courseVos = new ArrayList<>(); |
| | | List<TCoursePackagePayment> tCoursePackagePayments = this.list(new QueryWrapper<TCoursePackagePayment>() |
| | | .eq("appUserId",appUserId )); |
| | | System.out.println(tCoursePackagePayments); |
| | | if (tCoursePackagePayments.size() > 0){ |
| | | for (TCoursePackagePayment tCoursePackagePayment : tCoursePackagePayments) { |
| | | TCoursePackage coursePackage = tcpmapper.selectById(tCoursePackagePayment.getCoursePackageId()); |
| | |
| | | RegisterCourseVo registerCourseVo = new RegisterCourseVo(); |
| | | registerCourseVo.setCoursePayId(tCoursePackagePayment.getId()); |
| | | registerCourseVo.setCoursePackageId(tCoursePackagePayment.getCoursePackageId()); |
| | | registerCourseVo.setCoursePackTypeId(coursePackage.getCoursePackageTypeId()); |
| | | registerCourseVo.setPackageImg(coursePackage.getCoverDrawing()); |
| | | String storeAndCourse = coursePackage.getName()+"("+ store.getName() +")"; |
| | | registerCourseVo.setCourseNameStore(storeAndCourse); |
| | | registerCourseVo.setCourseTime(coursePackage.getClassStartTime()+"-"+coursePackage.getClassEndTime()); |
| | | Coach coach = coachClient.queryCoachById(coursePackage.getCoachId()); |
| | | registerCourseVo.setCourseTeacher(coach.getName()); |
| | | registerCourseVo.setCourseTeacher(ToolUtil.isEmpty(coach) ? "" : coach.getName()); |
| | | List<CoursePackageStudent> coursePackageStudents = cpsMapper.selectList(new QueryWrapper<CoursePackageStudent>() |
| | | .eq("coursePackageId",coursePackage.getId()) |
| | | .eq("studentId",appUserId )); |
| | | registerCourseVo.setCourseNums(coursePackageStudents.size() * 2); |
| | | if (coursePackageStudents.size() > 0 ){ |
| | | registerCourseVo.setCourseNums(coursePackageStudents.size() * 2); |
| | | } |
| | | registerCourseVo.setPayStatus(tCoursePackagePayment.getPayStatus()); |
| | | courseVos.add(registerCourseVo); |
| | | } |
| | | |
| | | if (ToolUtil.isNotEmpty(courseTypeId.getSearch())){ |
| | | courseVos = courseVos.stream() |
| | | .filter(person -> person.getCourseNameStore().contains(courseTypeId.getSearch())) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | if (ToolUtil.isNotEmpty(courseTypeId.getCourseTypeId())){ |
| | | courseVos = courseVos.stream() |
| | | .filter(person -> Objects.equals(person.getCoursePackTypeId(), courseTypeId.getCourseTypeId())) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | if (courseVos.size() > 0 ){ |
| | | courseVos = courseVos.stream() |
| | | .sorted(Comparator.comparingInt(person -> person.getPayStatus() == 1 ? -1 : 1)) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | | return courseVos; |
| | | } |
| | | |
| | | @Override |
| | | public CourseDetailsResponse queryRegisteredCourseDetails(Integer coursePayId, Integer appUserId) { |
| | | public CourseDetailsResponse queryRegisteredCourseDetails(Long coursePayId, Integer appUserId) { |
| | | CourseDetailsResponse response = new CourseDetailsResponse(); |
| | | TCoursePackagePayment tCoursePackagePayment = this.baseMapper.selectById(coursePayId); |
| | | |
| | |
| | | recordVo.setCourseStuRecordId(coursePackageStudent.getId()); |
| | | String classWeeks = coursePackage.getClassWeeks(); |
| | | String[] split = classWeeks.split(";"); |
| | | List<Integer> integerList = Arrays.stream(split) |
| | | .map(Integer::parseInt) |
| | | .collect(Collectors.toList()); |
| | | int dayOfWeek = DateTimeHelper.getDayOfWeek(new Date()); |
| | | List<String> integerList = Arrays.asList(split); |
| | | String weekOfDate = DateTimeHelper.getWeekOfDate(new Date()); |
| | | |
| | | if (integerList.contains(dayOfWeek)){ |
| | | if (integerList.contains(weekOfDate)){ |
| | | String dat = simpleDateFormat.format(date) +" "+ classStartTime; |
| | | |
| | | Date start = null; |