|
@@ -22,6 +22,7 @@ import com.zhongzheng.modules.face.service.IFaceService;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsUserVo;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
|
+import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
|
|
|
import com.zhongzheng.modules.grade.bo.UserPeriodAddBo;
|
|
|
import com.zhongzheng.modules.grade.bo.UserPeriodStatusAddBo;
|
|
|
import com.zhongzheng.modules.grade.domain.ClassGradeUser;
|
|
@@ -30,6 +31,9 @@ import com.zhongzheng.modules.grade.domain.UserPeriodStatus;
|
|
|
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.ClassPeriodChapterVo;
|
|
|
+import com.zhongzheng.modules.grade.vo.ClassPeriodSectionVo;
|
|
|
+import com.zhongzheng.modules.grade.vo.ClassPeriodVo;
|
|
|
import com.zhongzheng.modules.grade.vo.UserPeriodStatusVo;
|
|
|
import com.zhongzheng.modules.inform.bo.InformRemindQueryBo;
|
|
|
import com.zhongzheng.modules.inform.bo.InformUserAddBo;
|
|
@@ -404,12 +408,109 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取课程目录
|
|
|
+ * @param bo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@Override
|
|
|
- public boolean checkStudyOrder2(UserStudyRecordQueryBo entity) {
|
|
|
-
|
|
|
+ public boolean menuAllList(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());
|
|
|
+ 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());
|
|
|
+ sectionList.add(classSectionVo);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ //为节搜索学时记录
|
|
|
+ if (classPeriodVo.getType() == 3){
|
|
|
+ classPeriodVo.setModuleId(0L);
|
|
|
+ classPeriodVo.setChapterId(0L);
|
|
|
+ classPeriodVo.setSectionId(classPeriodVo.getId());
|
|
|
+ sectionList.add(classPeriodVo);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ System.out.println("事件"+sectionList.size());
|
|
|
+ System.out.println(sectionList);
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //判断当前未看完的节是否是点击播放的节
|
|
|
+ private boolean compareSection(UserStudyRecordVo recordVo,UserStudyRecordQueryBo entity){
|
|
|
+ if(recordVo.getModuleId().equals(entity.getModuleId())){
|
|
|
+ if(recordVo.getChapterId().equals(entity.getChapterId())){
|
|
|
+ if(recordVo.getSectionId().equals(entity.getSectionId())){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取最后一次看完的节
|
|
|
+ * @param bo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private UserStudyRecordVo queryLastOver(UserStudyRecordQueryBo bo) {
|
|
|
+ LambdaQueryWrapper<UserStudyRecord> lqw = Wrappers.lambdaQuery();
|
|
|
+ lqw.eq(UserStudyRecord::getUserId, bo.getUserId());
|
|
|
+ lqw.eq( UserStudyRecord::getCourseId, bo.getCourseId());
|
|
|
+ lqw.eq(UserStudyRecord::getSectionId, bo.getSectionId());
|
|
|
+ lqw.eq(UserStudyRecord::getGradeId, bo.getGradeId());
|
|
|
+ lqw.eq(UserStudyRecord::getGoodsId, bo.getGoodsId());
|
|
|
+ lqw.eq(UserStudyRecord::getModuleId, bo.getModuleId());
|
|
|
+ lqw.eq(UserStudyRecord::getChapterId, bo.getChapterId());
|
|
|
+ lqw.eq( UserStudyRecord::getCurrentStatus, 1);
|
|
|
+ lqw.eq( UserStudyRecord::getStatus, 1);
|
|
|
+ lqw.orderByDesc(UserStudyRecord::getRecordId);
|
|
|
+ UserStudyRecord last = this.getOne(lqw.last("limit 1"));
|
|
|
+ return BeanUtil.toBean(last, UserStudyRecordVo.class);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Boolean updateByEditBo(UserStudyRecordEditBo bo) {
|
|
|
UserStudyRecord update = BeanUtil.toBean(bo, UserStudyRecord.class);
|