|
@@ -382,6 +382,9 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
if(Validator.isEmpty(gradeOgUser)){
|
|
|
throw new CustomException("订单数据错误");
|
|
|
}
|
|
|
+
|
|
|
+ //校验是否有快进
|
|
|
+ checkFastForward(bo);
|
|
|
/*GoodsVo goodsVo = iGoodsService.queryById(bo.getGoodsId());
|
|
|
String fullName;
|
|
|
CourseBusinessQueryBo queryBusinessBo = new CourseBusinessQueryBo();
|
|
@@ -569,11 +572,13 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
&&Validator.isNotEmpty(bo.getErJianErZao())&&bo.getErJianErZao()
|
|
|
&&Validator.isEmpty(bo.getPhoto())&&(lastVo.getVideoCurrentTime().longValue()>add.getVideoCurrentTime().longValue())){
|
|
|
if(Validator.isNotEmpty(add.getStatus())&&add.getStatus()==1){
|
|
|
+ add.setVideoCheckTime(add.getVideoCurrentTime());
|
|
|
this.save(add);
|
|
|
}else{
|
|
|
return 0;
|
|
|
}
|
|
|
}else{
|
|
|
+ add.setVideoCheckTime(add.getVideoCurrentTime());
|
|
|
this.save(add);
|
|
|
}
|
|
|
}else{
|
|
@@ -621,6 +626,29 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+ private void checkFastForward(UserStudyRecordAddBo bo) {
|
|
|
+ UserStudyRecord studyRecord = getOne(new LambdaQueryWrapper<UserStudyRecord>()
|
|
|
+ .eq(UserStudyRecord::getOrderGoodsId, bo.getOrderGoodsId())
|
|
|
+ .eq(UserStudyRecord::getCourseId, bo.getCourseId())
|
|
|
+ .eq(UserStudyRecord::getSectionId, bo.getSectionId())
|
|
|
+ .eq(UserStudyRecord::getCurrentStatus,1)
|
|
|
+ .orderByAsc(UserStudyRecord::getCreateTime)
|
|
|
+ .last("limit 1"));
|
|
|
+ if (ObjectUtils.isNull(studyRecord) || ObjectUtils.isNull(studyRecord.getVideoCheckTime()) || ObjectUtils.isNull(bo.getVideoCurrentTime())){
|
|
|
+ //没有记录或者没有时间
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Long videoCurrentTime = bo.getVideoCurrentTime();
|
|
|
+ Long videoCheckTime = studyRecord.getVideoCheckTime();
|
|
|
+ Long time = videoCurrentTime - videoCheckTime;
|
|
|
+ if ((time - 15) >= 5){
|
|
|
+ //有快进或者拖拽
|
|
|
+ throw new CustomException("系统检测有快进或者拖拽情况",557);
|
|
|
+ }
|
|
|
+ studyRecord.setVideoCheckTime(bo.getVideoCurrentTime());
|
|
|
+ updateById(studyRecord);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void studyFinish(UserStudyRecord bo) {
|
|
|
if(Validator.isEmpty(bo.getOrderGoodsId())){
|
|
@@ -1720,6 +1748,30 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
return iUserStudyVideoService.updateById(video);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public boolean resetCourseSection(UserStudyRecordAddBo bo) {
|
|
|
+ List<UserStudyRecord> studyRecords = list(new LambdaQueryWrapper<UserStudyRecord>()
|
|
|
+ .eq(UserStudyRecord::getUserId,bo.getUserId())
|
|
|
+ .eq(UserStudyRecord::getOrderGoodsId, bo.getOrderGoodsId())
|
|
|
+ .eq(UserStudyRecord::getSectionId, bo.getSectionId())
|
|
|
+ .eq(UserStudyRecord::getCurrentStatus, 1)
|
|
|
+ .eq(UserStudyRecord::getCourseId, bo.getCourseId()));
|
|
|
+ if (CollectionUtils.isNotEmpty(studyRecords)){
|
|
|
+ List<Long> recordIds = studyRecords.stream().map(UserStudyRecord::getRecordId).collect(Collectors.toList());
|
|
|
+ baseMapper.updateTenant(recordIds);
|
|
|
+ }
|
|
|
+ List<UserPeriod> periodList = iUserPeriodService.list(new LambdaQueryWrapper<UserPeriod>()
|
|
|
+ .eq(UserPeriod::getOrderGoodsId, bo.getOrderGoodsId())
|
|
|
+ .eq(UserPeriod::getSectionId, bo.getSectionId())
|
|
|
+ .eq(UserPeriod::getUserId, bo.getUserId())
|
|
|
+ .eq(UserPeriod::getCourseId, bo.getCourseId()));
|
|
|
+ if (CollectionUtils.isNotEmpty(periodList)){
|
|
|
+ List<Long> ids = periodList.stream().map(UserPeriod::getId).collect(Collectors.toList());
|
|
|
+ baseMapper.updatePeriodTenant(ids);
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 获取最后一次看完的节
|