| | |
| | | package com.dsh.course.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.course.entity.CoursePackageScheduling; |
| | | import com.dsh.course.entity.CoursePackageStudent; |
| | | import com.dsh.course.feignclient.model.ExerciseVideo; |
| | | import com.dsh.course.mapper.CoursePackageSchedulingMapper; |
| | | import com.dsh.course.model.vo.response.AppUserVideoResponse; |
| | | import com.dsh.course.service.CoursePackageStudentService; |
| | | import com.dsh.course.service.ICoursePackageSchedulingService; |
| | | import com.dsh.course.service.PostCourseVideoService; |
| | | import com.dsh.course.service.TCoursePackageDiscountService; |
| | | import com.dsh.course.util.ResultUtil; |
| | | import com.dsh.course.util.TokenUtil; |
| | | import com.dsh.course.util.ToolUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | public List<ExerciseVideo> getStuCourseOfVideoList(@RequestBody List<Integer> coursePackIds){ |
| | | return pcvService.queryCourseOfVideos(coursePackIds); |
| | | } |
| | | @Autowired |
| | | private TCoursePackageDiscountService discountService; |
| | | |
| | | @Resource |
| | | private CoursePackageSchedulingMapper coursePackageSchedulingMapper; |
| | | @Autowired |
| | | private ICoursePackageSchedulingService coursePackageSchedulingService; |
| | | @Autowired |
| | | private CoursePackageStudentService coursePackageStudentService; |
| | | @Autowired |
| | | private TokenUtil tokenUtil; |
| | | @ResponseBody |
| | | @PostMapping("/base/courseVideo/query") |
| | | public List<ExerciseVideo> query(@RequestBody Integer id) throws Exception { |
| | | |
| | | List<ExerciseVideo> exerciseVideoList = new ArrayList<>(); |
| | | |
| | | // Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | |
| | | |
| | | |
| | | QueryWrapper<CoursePackageStudent> queryWrapper1 = new QueryWrapper<CoursePackageStudent>().eq("studentId", id); |
| | | List<CoursePackageStudent> list = coursePackageStudentService.list(queryWrapper1); |
| | | List<Long> longs = new ArrayList<>(); |
| | | for (CoursePackageStudent coursePackageStudent : list) { |
| | | longs.add(coursePackageStudent.getCoursePackageSchedulingId()); |
| | | } |
| | | System.out.println("======longs========"+longs); |
| | | // List<CoursePackageScheduling> coursePackageSchedulings = coursePackageSchedulingService.list(new QueryWrapper<CoursePackageScheduling>().in("id",longs).isNotNull("courseId")); |
| | | List<AppUserVideoResponse> coursePackageSchedulings1 = coursePackageSchedulingService.queryAll(longs); |
| | | |
| | | |
| | | if (coursePackageSchedulings1!=null){ |
| | | for (AppUserVideoResponse appUserVideoResponse : coursePackageSchedulings1) { |
| | | ExerciseVideo exerciseVideo = new ExerciseVideo(); |
| | | exerciseVideo.setVideoId(appUserVideoResponse.getVideoId()); |
| | | exerciseVideo.setVideoName(appUserVideoResponse.getVideoName()); |
| | | exerciseVideo.setCoursePackageId(appUserVideoResponse.getCoursePackageId()); |
| | | exerciseVideo.setVideoUrl(appUserVideoResponse.getCourseVideo()); |
| | | exerciseVideo.setVideoCoverImgUrl(appUserVideoResponse.getCourseVideo());exerciseVideoList.add(exerciseVideo); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | // return pcvService.queryCourseOfVideos(coursePackIds); |
| | | return exerciseVideoList; |
| | | } |
| | | |
| | | } |