|
@@ -19,6 +19,8 @@ import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.common.utils.http.HttpUtils;
|
|
|
import com.zhongzheng.common.utils.polyv.PolyvUtils;
|
|
|
import com.zhongzheng.modules.alisms.vo.ResultBean;
|
|
|
+import com.zhongzheng.modules.bank.domain.Exam;
|
|
|
+import com.zhongzheng.modules.bank.domain.QuestionBusiness;
|
|
|
import com.zhongzheng.modules.base.service.IProfileTpService;
|
|
|
import com.zhongzheng.modules.base.vo.ProfileTpVo;
|
|
|
import com.zhongzheng.modules.base.vo.UserProfileVo;
|
|
@@ -26,6 +28,7 @@ import com.zhongzheng.modules.course.bo.CourseChapterSectionQueryBo;
|
|
|
import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
|
|
|
import com.zhongzheng.modules.course.bo.CourseModuleChapterQueryBo;
|
|
|
import com.zhongzheng.modules.course.domain.CourseBusiness;
|
|
|
+import com.zhongzheng.modules.course.domain.CourseSection;
|
|
|
import com.zhongzheng.modules.course.service.ICourseChapterSectionService;
|
|
|
import com.zhongzheng.modules.course.service.ICourseMenuService;
|
|
|
import com.zhongzheng.modules.course.service.ICourseModuleChapterService;
|
|
@@ -79,6 +82,7 @@ import com.zhongzheng.modules.order.service.IOrderService;
|
|
|
import com.zhongzheng.modules.order.vo.OrderGoodsVo;
|
|
|
import com.zhongzheng.modules.order.vo.OrderListVo;
|
|
|
import com.zhongzheng.modules.order.vo.OrderVo;
|
|
|
+import com.zhongzheng.modules.polyv.bo.PolyvLiveQueryBo;
|
|
|
import com.zhongzheng.modules.polyv.bo.PolyvVideoAddBo;
|
|
|
import com.zhongzheng.modules.polyv.bo.PolyvVideoEditBo;
|
|
|
import com.zhongzheng.modules.polyv.bo.PolyvVideoQueryBo;
|
|
@@ -86,6 +90,7 @@ import com.zhongzheng.modules.polyv.domain.PolyvVideDo;
|
|
|
import com.zhongzheng.modules.polyv.domain.PolyvVideo;
|
|
|
import com.zhongzheng.modules.polyv.domain.TokenResponse;
|
|
|
import com.zhongzheng.modules.polyv.mapper.PolyvVideoMapper;
|
|
|
+import com.zhongzheng.modules.polyv.service.IPolyvLiveService;
|
|
|
import com.zhongzheng.modules.polyv.vo.PolyvVideoQuerVo;
|
|
|
import com.zhongzheng.modules.polyv.vo.PolyvVideoVo;
|
|
|
import com.zhongzheng.modules.polyv.vo.PolyvVo;
|
|
@@ -97,6 +102,8 @@ import com.zhongzheng.modules.user.mapper.UserStudyRecordMapper;
|
|
|
import com.zhongzheng.modules.user.service.*;
|
|
|
import com.zhongzheng.modules.user.vo.*;
|
|
|
import com.zhongzheng.modules.wx.service.IWxPayService;
|
|
|
+import net.polyv.live.v1.entity.channel.playback.LiveChannelVideoListResponse;
|
|
|
+import net.polyv.live.v1.entity.channel.playback.LiveListChannelSessionInfoResponse;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -110,6 +117,7 @@ import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+import static com.alibaba.fastjson.JSONPatch.OperationType.add;
|
|
|
import static com.squareup.okhttp.internal.Util.md5Hex;
|
|
|
|
|
|
/**
|
|
@@ -159,6 +167,7 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
|
|
|
@Autowired
|
|
|
private ICourseSectionService iCourseSectionService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private ICourseMenuService iCourseMenuService;
|
|
|
|
|
@@ -183,6 +192,9 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
@Autowired
|
|
|
private IUserSubscribeService iUserSubscribeService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IPolyvLiveService iPolyvLiveService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private IUserStudyRecordService iUserStudyRecordService;
|
|
|
|
|
@@ -192,6 +204,7 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
@Autowired
|
|
|
private IUserPlanService userPlanService;
|
|
|
|
|
|
+
|
|
|
@Autowired
|
|
|
private UserPlanMapper userPlanMapper;
|
|
|
|
|
@@ -1065,6 +1078,48 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void liveToReplay(UserQueryBo bo) {
|
|
|
+ Long nowTime = DateUtils.getNowTime();
|
|
|
+ Long startTime = nowTime - 3600 * 24 ;
|
|
|
+ //获取今天直播结束的所有直播节
|
|
|
+ List<CourseSectionVo> list = iCourseSectionService.overSectionList(startTime,nowTime);
|
|
|
+ for(CourseSectionVo sectionVo : list){
|
|
|
+ PolyvLiveQueryBo queryBo = new PolyvLiveQueryBo();
|
|
|
+ try{
|
|
|
+ queryBo.setChannelId(sectionVo.getLiveUrl()); //频道房间ID
|
|
|
+ LiveChannelVideoListResponse.ChannelVedioInfo info = iPolyvLiveService.getListChannelSession(queryBo);
|
|
|
+ if(Validator.isNotEmpty(info)){
|
|
|
+ //秒数误差在1个小时以内的判定为节的保利威直播
|
|
|
+ if(Math.abs(sectionVo.getLiveEndTime().longValue()-(info.getEndTime().getTime()/1000))<3600){
|
|
|
+ if("complete".equals(info.getRecordFileType())){
|
|
|
+ CourseSection oldSection = iCourseSectionService.getOne(new LambdaQueryWrapper<CourseSection>()
|
|
|
+ .eq(CourseSection::getSessionId, info.getChannelSessionId())
|
|
|
+ .last("limit 1"));
|
|
|
+ if(Validator.isEmpty(oldSection)){
|
|
|
+ //录播完成状态且场次ID没被使用
|
|
|
+ sectionVo.setSessionId(info.getChannelSessionId());//场次ID
|
|
|
+ sectionVo.setRealDuration(info.getDuration().longValue()); //视频秒数
|
|
|
+ sectionVo.setRealLiveStartTime(info.getStartTime().getTime());
|
|
|
+ sectionVo.setRealLiveEndTime(info.getEndTime().getTime());
|
|
|
+ sectionVo.setRecordingUrl(info.getUrl());
|
|
|
+ sectionVo.setSectionType(3); //直播变为回放
|
|
|
+ CourseSection section = BeanUtil.toBean(sectionVo, CourseSection.class);
|
|
|
+ section.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ iCourseSectionService.updateById(section);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
//获得可用学习天数
|
|
|
private static int getDutyDays(Date startDateStr, Date endDateStr,Long[] longs,Long studyDay) {
|
|
|
int result = 0;
|