|
@@ -34,18 +34,18 @@ import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
|
|
|
import com.zhongzheng.modules.grade.domain.ClassGradeUser;
|
|
|
import com.zhongzheng.modules.grade.domain.UserPeriod;
|
|
|
import com.zhongzheng.modules.grade.domain.UserPeriodStatus;
|
|
|
+import com.zhongzheng.modules.grade.mapper.ClassGradeUserMapper;
|
|
|
import com.zhongzheng.modules.grade.service.IClassGradeUserService;
|
|
|
import com.zhongzheng.modules.grade.service.IUserPeriodService;
|
|
|
import com.zhongzheng.modules.grade.service.IUserPeriodStatusService;
|
|
|
-import com.zhongzheng.modules.grade.vo.ClassPeriodStudentVo;
|
|
|
-import com.zhongzheng.modules.grade.vo.ClassPeriodVo;
|
|
|
-import com.zhongzheng.modules.grade.vo.UserPeriodStatusVo;
|
|
|
+import com.zhongzheng.modules.grade.vo.*;
|
|
|
import com.zhongzheng.modules.inform.bo.InformRemindQueryBo;
|
|
|
import com.zhongzheng.modules.inform.bo.InformUserAddBo;
|
|
|
import com.zhongzheng.modules.inform.service.IInformRemindService;
|
|
|
import com.zhongzheng.modules.inform.service.IInformUserService;
|
|
|
import com.zhongzheng.modules.inform.vo.InformRemindBusinessVo;
|
|
|
import com.zhongzheng.modules.inform.vo.InformRemindVo;
|
|
|
+import com.zhongzheng.modules.order.vo.OrderGoodsVo;
|
|
|
import com.zhongzheng.modules.polyv.bo.PolyvLiveQueryBo;
|
|
|
import com.zhongzheng.modules.polyv.service.IPolyvLiveService;
|
|
|
import com.zhongzheng.modules.user.bo.*;
|
|
@@ -150,6 +150,9 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
@Autowired
|
|
|
private ICourseMenuExamService courseMenuExamService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ClassGradeUserMapper classGradeUserMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public UserStudyRecordVo queryById(Long recordId) {
|
|
|
UserStudyRecord db = this.baseMapper.selectById(recordId);
|
|
@@ -214,6 +217,10 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
vo.setSectionType(sectionVo.getSectionType());
|
|
|
vo.setLiveUrl(sectionVo.getLiveUrl());
|
|
|
vo.setRecordingUrl(sectionVo.getRecordingUrl());
|
|
|
+ Integer learning = courseChapterSectionMapper.learningCheck(vo.getSectionId(), vo.getGradeId(), bo.getUserId(), vo.getModuleId(), vo.getChapterId(), 0L,vo.getCourseId());
|
|
|
+ if (learning > 0) {
|
|
|
+ vo.setLearning(1L);
|
|
|
+ }
|
|
|
}
|
|
|
return vo;
|
|
|
}
|
|
@@ -427,7 +434,11 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
UserStudyRecordVo lastVo = queryLast(queryBo);
|
|
|
if(Validator.isEmpty(lastVo)||Validator.isNotEmpty(bo.getPhoto())||Validator.isEmpty(lastVo.getVideoCurrentTime())||lastVo.getVideoCurrentTime().longValue()>add.getVideoCurrentTime().longValue()){
|
|
|
//如果没有历史数据或者之前播放时长比现在晚,或者携带照片则新增观看记录
|
|
|
- this.save(add);
|
|
|
+ if(Validator.isNotEmpty(lastVo)&&Validator.isNotEmpty(bo.getErJianErZao())&&bo.getErJianErZao()&&Validator.isEmpty(bo.getPhoto())&&(lastVo.getVideoCurrentTime().longValue()>add.getVideoCurrentTime().longValue())){
|
|
|
+ return 0;
|
|
|
+ }else{
|
|
|
+ this.save(add);
|
|
|
+ }
|
|
|
}else{
|
|
|
if(Validator.isNotEmpty(add.getStatus())&&add.getStatus()==1){
|
|
|
lastVo.setStatus(1);
|
|
@@ -671,6 +682,92 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
return sectionList;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<ClassPeriodVo> menuAllListWithExam(UserStudyRecordQueryBo bo) {
|
|
|
+ //存储整个目录节列表
|
|
|
+ List<ClassPeriodVo> sectionList = new ArrayList<>();
|
|
|
+ //获取课程目录
|
|
|
+ List<ClassPeriodVo> list = baseMapper.listMenu(bo);
|
|
|
+ //排序目录
|
|
|
+ Collections.sort(list);
|
|
|
+ for (ClassPeriodVo classPeriodVo : list) {
|
|
|
+ //为模块搜索下面的章 和节
|
|
|
+ if (classPeriodVo.getType() == 1){
|
|
|
+ UserStudyRecordQueryBo moduleQueryBo = new UserStudyRecordQueryBo();
|
|
|
+ moduleQueryBo.setModuleId(classPeriodVo.getId());
|
|
|
+ List<ClassPeriodVo> classPeriodChapterVos = baseMapper.listModuleChapter(moduleQueryBo);
|
|
|
+ //排序章目录
|
|
|
+ Collections.sort(classPeriodChapterVos);
|
|
|
+ for (ClassPeriodVo classChapterVo : classPeriodChapterVos) {
|
|
|
+ UserStudyRecordQueryBo chapterQueryBo = new UserStudyRecordQueryBo();
|
|
|
+ chapterQueryBo.setChapterId(classChapterVo.getId());
|
|
|
+ List<ClassPeriodVo> classPeriodSectionVos = baseMapper.listChapterSection(chapterQueryBo);
|
|
|
+ //排序节目录
|
|
|
+ Collections.sort(classPeriodSectionVos);
|
|
|
+ for (ClassPeriodVo classSectionVo : classPeriodSectionVos) {
|
|
|
+ classSectionVo.setModuleId(classPeriodVo.getId());
|
|
|
+ classSectionVo.setChapterId(classChapterVo.getId());
|
|
|
+ classSectionVo.setSectionId(classSectionVo.getId());
|
|
|
+ classSectionVo.setType(3L);
|
|
|
+ sectionList.add(classSectionVo);
|
|
|
+ }
|
|
|
+ List<ClassPeriodSectionVo> cExamList= classGradeUserMapper.listperiodExam(classChapterVo.getId(), null, classPeriodVo.getCourseId(), null, classPeriodVo.getId());
|
|
|
+ for (ClassPeriodSectionVo sectionVo : cExamList) {
|
|
|
+ ClassPeriodVo classSectionVo = BeanUtil.toBean(sectionVo,ClassPeriodVo.class);
|
|
|
+ classSectionVo.setType(4L);
|
|
|
+ classSectionVo.setExamId(sectionVo.getId());
|
|
|
+ sectionList.add(classSectionVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<ClassPeriodChapterVo> mExamList = classGradeUserMapper.listperiodModuleExam( null, classPeriodVo.getCourseId(), null, classPeriodVo.getId());
|
|
|
+ for (ClassPeriodChapterVo chapterVo : mExamList) {
|
|
|
+ ClassPeriodVo classSectionVo = BeanUtil.toBean(chapterVo,ClassPeriodVo.class);
|
|
|
+ classSectionVo.setType(5L);
|
|
|
+ classSectionVo.setExamId(chapterVo.getId());
|
|
|
+ sectionList.add(classSectionVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //为章搜索节记录
|
|
|
+ if (classPeriodVo.getType() == 2){
|
|
|
+ UserStudyRecordQueryBo chapterQueryBo = new UserStudyRecordQueryBo();
|
|
|
+ chapterQueryBo.setChapterId(classPeriodVo.getId());
|
|
|
+ List<ClassPeriodVo> classPeriodSectionVos = baseMapper.listChapterSection(chapterQueryBo);
|
|
|
+ //排序节目录
|
|
|
+ Collections.sort(classPeriodSectionVos);
|
|
|
+ for (ClassPeriodVo classSectionVo : classPeriodSectionVos) {
|
|
|
+ classSectionVo.setModuleId(0L);
|
|
|
+ classSectionVo.setChapterId(classPeriodVo.getId());
|
|
|
+ classSectionVo.setSectionId(classSectionVo.getId());
|
|
|
+ classSectionVo.setType(3L);
|
|
|
+ sectionList.add(classSectionVo);
|
|
|
+ }
|
|
|
+ List<ClassPeriodSectionVo> cExamList= classGradeUserMapper.listperiodExam(classPeriodVo.getId(), null, classPeriodVo.getCourseId(), null, 0L);
|
|
|
+ for (ClassPeriodSectionVo sectionVo : cExamList) {
|
|
|
+ ClassPeriodVo classSectionVo = BeanUtil.toBean(sectionVo,ClassPeriodVo.class);
|
|
|
+ classSectionVo.setType(4L);
|
|
|
+ classSectionVo.setExamId(sectionVo.getId());
|
|
|
+ sectionList.add(classSectionVo);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ //为节搜索学时记录
|
|
|
+ if (classPeriodVo.getType() == 3){
|
|
|
+ classPeriodVo.setModuleId(0L);
|
|
|
+ classPeriodVo.setChapterId(0L);
|
|
|
+ classPeriodVo.setSectionId(classPeriodVo.getId());
|
|
|
+ sectionList.add(classPeriodVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for(ClassPeriodVo section : sectionList){
|
|
|
+ section.setGoodsId(bo.getGoodsId());
|
|
|
+ section.setGradeId(bo.getGradeId());
|
|
|
+ section.setUserId(bo.getUserId());
|
|
|
+ section.setCourseId(bo.getCourseId());
|
|
|
+ section.setStudyStatus(baseMapper.getStudyStatus(section));
|
|
|
+ }
|
|
|
+ return sectionList;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<SectionStudyRecordVo> listUserRecord(UserStudyRecordQueryBo bo) {
|
|
|
return this.baseMapper.listUserRecord(bo);
|
|
@@ -748,18 +845,24 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
queryBo.setUserId(bo.getUserId());
|
|
|
UserBankRecord bankVo = iUserBankRecordService.getUserLastExam(queryBo);
|
|
|
if(Validator.isEmpty(vo)&&Validator.isNotEmpty(bankVo)){
|
|
|
- vo = new SectionStudyRecordVo();
|
|
|
- vo.setOrderGoodsId(bankVo.getOrderGoodsId());
|
|
|
+ vo = mergeToData(bankVo);
|
|
|
}
|
|
|
if(Validator.isNotEmpty(vo)&&Validator.isNotEmpty(bankVo)){
|
|
|
if(vo.getUpdateTime().longValue()<bankVo.getUpdateTime().longValue()){
|
|
|
- vo = new SectionStudyRecordVo();
|
|
|
- vo.setOrderGoodsId(bankVo.getOrderGoodsId());
|
|
|
+ vo = mergeToData(bankVo);
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
return vo;
|
|
|
}
|
|
|
|
|
|
+ private SectionStudyRecordVo mergeToData(UserBankRecord bankVo){
|
|
|
+ SectionStudyRecordVo vo = BeanUtil.toBean(bankVo, SectionStudyRecordVo.class);
|
|
|
+ vo.setLearning((long)bankVo.getReportStatus());
|
|
|
+ vo.setExamType(bankVo.getType());
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
//判断当前未看完的节是否是点击播放的节
|
|
|
private boolean compareSection(UserStudyRecordVo recordVo,UserStudyRecordQueryBo entity){
|