yangdamao 1 жил өмнө
parent
commit
b91703a15b

+ 37 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/UserPeriodServiceImpl.java

@@ -76,9 +76,11 @@ import com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo;
 import com.zhongzheng.modules.user.domain.User;
 import com.zhongzheng.modules.user.domain.UserExamGoods;
 import com.zhongzheng.modules.user.domain.UserStudyRecordPhoto;
+import com.zhongzheng.modules.user.domain.UserStudyVideo;
 import com.zhongzheng.modules.user.service.IUserExamGoodsService;
 import com.zhongzheng.modules.user.service.IUserService;
 import com.zhongzheng.modules.user.service.IUserStudyRecordPhotoService;
+import com.zhongzheng.modules.user.service.IUserStudyVideoService;
 import com.zhongzheng.modules.user.vo.UserVo;
 import com.zhongzheng.modules.wx.service.IWxLoginService;
 import org.apache.commons.lang3.StringUtils;
@@ -214,6 +216,9 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
     @Autowired
     private IUserProfileService iUserProfileService;
 
+    @Autowired
+    private IUserStudyVideoService iUserStudyVideoService;
+
     @Value("${oldStudySys.syncPath}")
     private String SYNC_PATH;
 
@@ -914,7 +919,22 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
                                 SyncUserStudyRec syncUserStudyRec = new SyncUserStudyRec();
                                 syncUserStudyRec.setVideoId(classPeriodSectionVo.getId());
                                 syncUserStudyRec.setVideoKey(classPeriodSectionVo.getRecordingUrl());
-
+                                //获取视频录像
+                                UserStudyVideo studyVideo = iUserStudyVideoService.getOne(new LambdaQueryWrapper<UserStudyVideo>()
+                                        .eq(UserStudyVideo::getOrderGoodsId,gradeUser.getOrderGoodsId())
+                                        .eq(UserStudyVideo::getUserId,classPeriodSectionVo.getUserId())
+                                        .eq(UserStudyVideo::getCourseId,classPeriodSectionVo.getCourseId())
+                                        .eq(UserStudyVideo::getChapterId,courseModuleChapterVo.getId())
+                                        .eq(UserStudyVideo::getModuleId,courseMenuVo.getMenuId())
+                                        .eq(UserStudyVideo::getSectionId,classPeriodSectionVo.getId())
+                                        .eq(UserStudyVideo::getGoodsId,bo.getGoodsId())
+                                        .eq(UserStudyVideo::getCurrentStatus,1)
+                                        .eq(UserStudyVideo::getStatus,1));
+                                if (ObjectUtils.isNotNull(studyVideo)){
+                                    syncUserStudyRec.setVideoUrl(ossHost+"/"+studyVideo.getVideoUrl());
+                                    syncUserStudyRec.setVideoTime(DateUtils.timestampToDateFormat(studyVideo.getCreateTime(),"yyyy-MM-dd HH:mm:ss"));
+                                    syncUserStudyRec.setVideoCurrentTime(studyVideo.getVideoCurrentTime());
+                                }
                                 UserPeriodQueryBo userPeriodQueryBo2 = new UserPeriodQueryBo();
                                 userPeriodQueryBo2.setSectionId(classPeriodSectionVo.getId());
                                 userPeriodQueryBo2.setCourseId(courseVo.getCourseId());
@@ -1043,6 +1063,22 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
                                 syncUserStudyRec.setVideoId(classPeriodSectionVo.getId());
                                 syncUserStudyRec.setVideoKey(classPeriodSectionVo.getRecordingUrl());
 
+                                //获取视频录像
+                                UserStudyVideo studyVideo = iUserStudyVideoService.getOne(new LambdaQueryWrapper<UserStudyVideo>()
+                                        .eq(UserStudyVideo::getOrderGoodsId,gradeUser.getOrderGoodsId())
+                                        .eq(UserStudyVideo::getUserId,classPeriodSectionVo.getUserId())
+                                        .eq(UserStudyVideo::getCourseId,classPeriodSectionVo.getCourseId())
+                                        .eq(UserStudyVideo::getChapterId,courseModuleChapterVo.getId())
+                                        .eq(UserStudyVideo::getModuleId,courseMenuVo.getMenuId())
+                                        .eq(UserStudyVideo::getSectionId,classPeriodSectionVo.getId())
+                                        .eq(UserStudyVideo::getGoodsId,bo.getGoodsId())
+                                        .eq(UserStudyVideo::getCurrentStatus,1)
+                                        .eq(UserStudyVideo::getStatus,1));
+                                if (ObjectUtils.isNotNull(studyVideo)){
+                                    syncUserStudyRec.setVideoUrl(ossHost+"/"+studyVideo.getVideoUrl());
+                                    syncUserStudyRec.setVideoTime(DateUtils.timestampToDateFormat(studyVideo.getCreateTime(),"yyyy-MM-dd HH:mm:ss"));
+                                    syncUserStudyRec.setVideoCurrentTime(studyVideo.getVideoCurrentTime());
+                                }
                                 UserPeriodQueryBo userPeriodQueryBo2 = new UserPeriodQueryBo();
                                 userPeriodQueryBo2.setSectionId(classPeriodSectionVo.getId());
                                 userPeriodQueryBo2.setCourseId(courseVo.getCourseId());

+ 10 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/SyncUserStudyRec.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.modules.grade.vo;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.util.List;
@@ -18,6 +19,15 @@ public class SyncUserStudyRec {
 
     private String StudyIP;
 
+    @ApiModelProperty("视频地址")
+    private String videoUrl;
+
+    @ApiModelProperty("视频时间")
+    private String videoTime;
+
+    @ApiModelProperty("视频当前播放时刻")
+    private Long videoCurrentTime;
+
     private List<SyncUserStudyRec> ReStudyList;
 
     private List<SyncUserImageRc> ImgList;