|
@@ -18,6 +18,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.github.pagehelper.Page;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Collection;
|
|
|
import java.util.Collections;
|
|
|
import java.util.List;
|
|
@@ -109,14 +110,17 @@ public class CourseModuleChapterServiceImpl extends ServiceImpl<CourseModuleChap
|
|
|
@Override
|
|
|
public List<CourseUserModuleChapterVo> chapterList(CourseMenuQueryBo bo) {
|
|
|
List<CourseUserModuleChapterVo> courseUserModuleChapterVos = baseMapper.chapterList(bo);
|
|
|
- if (!CollectionUtils.isEmpty(courseUserModuleChapterVos)) {
|
|
|
- List<CourseUserModuleChapterVo> examList = baseMapper.examList(bo);
|
|
|
- for(CourseUserModuleChapterVo vo : examList){
|
|
|
- Integer learning = baseMapper.learningExamCheck(0L, vo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), vo.getTypeId(),bo.getCourseId());
|
|
|
- if(Validator.isNotEmpty(learning)){
|
|
|
- vo.setLearning(new Long(learning));
|
|
|
- }
|
|
|
+ List<CourseUserModuleChapterVo> examList = baseMapper.examList(bo);
|
|
|
+ for(CourseUserModuleChapterVo vo : examList){
|
|
|
+ Integer learning = baseMapper.learningExamCheck(0L, vo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), vo.getTypeId(),bo.getCourseId());
|
|
|
+ if(Validator.isNotEmpty(learning)){
|
|
|
+ vo.setLearning(new Long(learning));
|
|
|
}
|
|
|
+ }
|
|
|
+ if (!CollectionUtils.isEmpty(courseUserModuleChapterVos)) {
|
|
|
+ courseUserModuleChapterVos.addAll(examList);
|
|
|
+ }else{
|
|
|
+ courseUserModuleChapterVos = new ArrayList<>();
|
|
|
courseUserModuleChapterVos.addAll(examList);
|
|
|
}
|
|
|
|