|
@@ -25,7 +25,10 @@ import com.zhongzheng.modules.course.mapper.CourseChapterSectionMapper;
|
|
|
import com.zhongzheng.modules.course.service.*;
|
|
|
import com.zhongzheng.modules.course.vo.CourseChapterSectionVo;
|
|
|
import com.zhongzheng.modules.course.vo.CourseSectionVo;
|
|
|
+import com.zhongzheng.modules.course.vo.CourseVo;
|
|
|
+import com.zhongzheng.modules.goods.bo.GoodsCourseQueryBo;
|
|
|
import com.zhongzheng.modules.goods.domain.Goods;
|
|
|
+import com.zhongzheng.modules.goods.service.IGoodsCourseService;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
|
import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
|
|
@@ -152,6 +155,8 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
|
|
|
@Autowired
|
|
|
private ClassGradeUserMapper classGradeUserMapper;
|
|
|
+ @Autowired
|
|
|
+ private IGoodsCourseService iGoodsCourseService;
|
|
|
|
|
|
@Override
|
|
|
public UserStudyRecordVo queryById(Long recordId) {
|
|
@@ -802,6 +807,112 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
return sectionList;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<ClassPeriodVo> goodsAllListWithExam(UserStudyRecordQueryBo bo) {
|
|
|
+ if(Validator.isEmpty(bo.getGoodsId())){
|
|
|
+ throw new CustomException("参数缺失");
|
|
|
+ }
|
|
|
+ //存储整个目录节列表
|
|
|
+ List<ClassPeriodVo> sectionList = new ArrayList<>();
|
|
|
+ GoodsCourseQueryBo queryBo = new GoodsCourseQueryBo();
|
|
|
+ queryBo.setGoodsId(bo.getGoodsId());
|
|
|
+ List<CourseVo> courseList = iGoodsCourseService.selectList(queryBo);
|
|
|
+ for(CourseVo courseVo : courseList){
|
|
|
+ bo.setCourseId(courseVo.getCourseId());
|
|
|
+ //获取课程目录
|
|
|
+ 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(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), 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( bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), 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(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), 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());
|
|
|
+ if(section.getType()<4){
|
|
|
+ section.setStudyStatus(baseMapper.getStudyStatus(section));
|
|
|
+ }else{
|
|
|
+ if(section.getType()==4){
|
|
|
+ section.setExamType(1);
|
|
|
+ }
|
|
|
+ if(section.getType()==5){
|
|
|
+ section.setExamType(3);
|
|
|
+ }
|
|
|
+ section.setStudyStatus(baseMapper.getStudyExamStatus(section));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return sectionList;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<SectionStudyRecordVo> listUserRecord(UserStudyRecordQueryBo bo) {
|
|
|
return this.baseMapper.listUserRecord(bo);
|
|
@@ -884,7 +995,6 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
if(Validator.isNotEmpty(vo)&&Validator.isNotEmpty(bankVo)){
|
|
|
if(vo.getUpdateTime().longValue()<bankVo.getUpdateTime().longValue()){
|
|
|
vo = mergeToData(bankVo);
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
return vo;
|