yangdamao 1 年間 前
コミット
ac76ef6687

+ 49 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -76,6 +76,7 @@ import com.zhongzheng.modules.system.service.ISysUserService;
 import com.zhongzheng.modules.user.bo.*;
 import com.zhongzheng.modules.user.domain.User;
 import com.zhongzheng.modules.user.domain.UserStudyRecordPhoto;
+import com.zhongzheng.modules.user.domain.UserStudyVideo;
 import com.zhongzheng.modules.user.mapper.UserStudyRecordPhotoMapper;
 import com.zhongzheng.modules.user.service.*;
 import com.zhongzheng.modules.user.vo.*;
@@ -236,6 +237,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
     @Autowired
     private IQuestionChapterExamService iQuestionChapterExamService;
 
+    @Autowired
+    private IUserStudyVideoService iUserStudyVideoService;
+
 
     /*private String SEVEN_OFFICIALPUSH_INFOACCOUNT;
     private String SEVEN_OFFICIALPUSH_TOKEN;*/
@@ -3409,6 +3413,21 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                         classPeriodSectionVos.addAll(baseMapper.listperiodExam(classPeriodChapterVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), classPeriodVo.getId()));
                         for (ClassPeriodSectionVo classPeriodSectionVo : classPeriodSectionVos) {
                             if (classPeriodSectionVo.getType() == 3) {
+                                //获取视频录像
+                                UserStudyVideo studyVideo = iUserStudyVideoService.getOne(new LambdaQueryWrapper<UserStudyVideo>()
+                                        .eq(UserStudyVideo::getOrderGoodsId,bo.getOrderGoodsId())
+                                        .eq(UserStudyVideo::getUserId,classPeriodSectionVo.getUserId())
+                                        .eq(UserStudyVideo::getCourseId,classPeriodSectionVo.getCourseId())
+                                        .eq(UserStudyVideo::getChapterId,classPeriodChapterVo.getId())
+                                        .eq(UserStudyVideo::getModuleId,classPeriodVo.getId())
+                                        .eq(UserStudyVideo::getSectionId,classPeriodSectionVo.getId())
+                                        .eq(UserStudyVideo::getGoodsId,bo.getGoodsId())
+                                        .eq(UserStudyVideo::getCurrentStatus,1)
+                                        .eq(UserStudyVideo::getStatus,1));
+                                if (ObjectUtils.isNotNull(studyVideo)){
+                                    classPeriodSectionVo.setVideoUrl(studyVideo.getVideoUrl());
+                                    classPeriodSectionVo.setVideoCurrentTime(studyVideo.getVideoCurrentTime());
+                                }
                                 sectionTotal++;
                                 secTotalTime += classPeriodSectionVo.getDurationTime();
                                 //节
@@ -3573,6 +3592,21 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 List<ClassPeriodSectionVo> classPeriodSectionVos = baseMapper.listPeriodSection(classPeriodVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId());
                 Collections.sort(classPeriodSectionVos);
                 for (ClassPeriodSectionVo classPeriodSectionVo : classPeriodSectionVos) {
+                    //获取视频录像
+                    UserStudyVideo studyVideo = iUserStudyVideoService.getOne(new LambdaQueryWrapper<UserStudyVideo>()
+                            .eq(UserStudyVideo::getOrderGoodsId,bo.getOrderGoodsId())
+                            .eq(UserStudyVideo::getUserId,classPeriodSectionVo.getUserId())
+                            .eq(UserStudyVideo::getCourseId,classPeriodSectionVo.getCourseId())
+                            .eq(UserStudyVideo::getChapterId,classPeriodVo.getId())
+                            .eq(UserStudyVideo::getModuleId,0L)
+                            .eq(UserStudyVideo::getSectionId,classPeriodSectionVo.getId())
+                            .eq(UserStudyVideo::getGoodsId,bo.getGoodsId())
+                            .eq(UserStudyVideo::getCurrentStatus,1)
+                            .eq(UserStudyVideo::getStatus,1));
+                    if (ObjectUtils.isNotNull(studyVideo)){
+                        classPeriodSectionVo.setVideoUrl(studyVideo.getVideoUrl());
+                        classPeriodSectionVo.setVideoCurrentTime(studyVideo.getVideoCurrentTime());
+                    }
                     sectionTotal++;
                     secTotalTime += classPeriodSectionVo.getDurationTime();
                     UserPeriodQueryBo userPeriodQueryBo = new UserPeriodQueryBo();
@@ -3694,6 +3728,21 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
 
             //为节搜索学时记录
             if (classPeriodVo.getType() == 3) {
+                //获取视频录像
+                UserStudyVideo studyVideo = iUserStudyVideoService.getOne(new LambdaQueryWrapper<UserStudyVideo>()
+                        .eq(UserStudyVideo::getOrderGoodsId,bo.getOrderGoodsId())
+                        .eq(UserStudyVideo::getUserId,classPeriodVo.getUserId())
+                        .eq(UserStudyVideo::getCourseId,classPeriodVo.getCourseId())
+                        .eq(UserStudyVideo::getChapterId,0L)
+                        .eq(UserStudyVideo::getModuleId,0L)
+                        .eq(UserStudyVideo::getSectionId,classPeriodVo.getId())
+                        .eq(UserStudyVideo::getGoodsId,bo.getGoodsId())
+                        .eq(UserStudyVideo::getCurrentStatus,1)
+                        .eq(UserStudyVideo::getStatus,1));
+                if (ObjectUtils.isNotNull(studyVideo)){
+                    classPeriodVo.setVideoUrl(studyVideo.getVideoUrl());
+                    classPeriodVo.setVideoCurrentTime(studyVideo.getVideoCurrentTime());
+                }
                 sectionTotal++;
                 secTotalTime += classPeriodVo.getDurationTime();
                 UserPeriodQueryBo userPeriodQueryBo = new UserPeriodQueryBo();

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodSectionVo.java

@@ -185,6 +185,12 @@ public class ClassPeriodSectionVo implements Comparable<ClassPeriodSectionVo> {
 
 	private Long orderGoodsId;
 
+	@ApiModelProperty("视频地址")
+	private String videoUrl;
+
+	@ApiModelProperty("视频当前播放时刻")
+	private Long videoCurrentTime;
+
 	@ApiModelProperty("试卷ID")
 	private Long examId;
 	@Override

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodVo.java

@@ -222,6 +222,11 @@ public class ClassPeriodVo implements Comparable<ClassPeriodVo> {
 	private Long sectionTotal;
 	@ApiModelProperty("复制班级名称")
 	private String commonGradeName;
+	@ApiModelProperty("视频地址")
+	private String videoUrl;
+
+	@ApiModelProperty("视频当前播放时刻")
+	private Long videoCurrentTime;
 	@Override
 	public int compareTo(ClassPeriodVo o) {
 		if(o.getCourseSort()==this.getCourseSort()){