he2802 2 years ago
parent
commit
5e01143aa1

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodVo.java

@@ -206,6 +206,9 @@ public class ClassPeriodVo implements Comparable<ClassPeriodVo> {
 	private Long endTotalTime;
 
 	private Long secTotalTime;
+
+	@ApiModelProperty("试卷ID")
+	private Long examId;
 	@Override
 	public int compareTo(ClassPeriodVo o) {
 		if(o.getCourseSort()==this.getCourseSort()){

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserStudyRecordService.java

@@ -95,6 +95,8 @@ public interface IUserStudyRecordService extends IService<UserStudyRecord> {
 
 	List<ClassPeriodVo> menuAllList(UserStudyRecordQueryBo bo);
 
+	List<ClassPeriodVo> menuAllListWithExam(UserStudyRecordQueryBo bo);
+
 	List<SectionStudyRecordVo> listUserRecord(UserStudyRecordQueryBo bo);
 
 	Integer getStudyStatus(ClassPeriodVo bo);

+ 66 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java

@@ -215,6 +215,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;
     }
@@ -678,6 +682,68 @@ 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());
+                        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);
+            }
+        }
+        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);

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserStudyRecordVo.java

@@ -122,4 +122,6 @@ public class UserStudyRecordVo {
 	@Excel(name = "访问IP")
 	@ApiModelProperty("访问IP")
 	private String ip;
+	@ApiModelProperty("1已学习")
+	private Long learning;
 }