|
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.github.pagehelper.Page;
|
|
|
+import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.modules.course.bo.CourseChapterSectionAddBo;
|
|
|
import com.zhongzheng.modules.course.bo.CourseChapterSectionEditBo;
|
|
|
import com.zhongzheng.modules.course.bo.CourseChapterSectionQueryBo;
|
|
@@ -139,6 +140,9 @@ public class CourseChapterSectionServiceImpl extends ServiceImpl<CourseChapterSe
|
|
|
|
|
|
@Override
|
|
|
public List<CourseUserChapterSectionVo> sectionList(CourseMenuQueryBo bo) {
|
|
|
+ if(Validator.isEmpty(bo.getOrderGoodsId())){
|
|
|
+ throw new CustomException("OrderGoodsId缺失");
|
|
|
+ }
|
|
|
List<CourseUserChapterSectionVo> courseUserChapterSectionVos = courseChapterSectionMapper.sectionList(bo);
|
|
|
List<CourseUserChapterSectionVo> examList = null;
|
|
|
if (!CollectionUtils.isEmpty(courseUserChapterSectionVos)) {
|
|
@@ -154,31 +158,31 @@ public class CourseChapterSectionServiceImpl extends ServiceImpl<CourseChapterSe
|
|
|
for (CourseUserChapterSectionVo courseMenuVo : courseUserChapterSectionVos) {
|
|
|
if (courseMenuVo.getType().equals(1)) {
|
|
|
//节
|
|
|
- Integer rebuild = baseMapper.rebuildCheck(courseMenuVo.getTypeId(), courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), null,bo.getCourseId());
|
|
|
+ Integer rebuild = baseMapper.rebuildCheck(courseMenuVo.getTypeId(), courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), null,bo.getCourseId(),bo.getOrderGoodsId());
|
|
|
if (rebuild > 0) {
|
|
|
courseMenuVo.setRebuild(1);
|
|
|
}
|
|
|
- Integer audit = baseMapper.auditCheck(courseMenuVo.getTypeId(), courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), 0L,bo.getCourseId());
|
|
|
+ Integer audit = baseMapper.auditCheck(courseMenuVo.getTypeId(), courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), 0L,bo.getCourseId(),bo.getOrderGoodsId());
|
|
|
if (audit > 0) {
|
|
|
courseMenuVo.setAudit(1L);
|
|
|
}
|
|
|
- Integer learning = baseMapper.learningCheck(courseMenuVo.getTypeId(), courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), null,bo.getCourseId());
|
|
|
+ Integer learning = baseMapper.learningCheck(courseMenuVo.getTypeId(), courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), null,bo.getCourseId(),bo.getOrderGoodsId());
|
|
|
if (learning > 0) {
|
|
|
courseMenuVo.setLearning(1L);
|
|
|
}
|
|
|
- Long studyDuration = baseMapper.getStudyDuration(courseMenuVo.getTypeId(), courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), 0L,bo.getCourseId());
|
|
|
+ Long studyDuration = baseMapper.getStudyDuration(courseMenuVo.getTypeId(), courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), 0L,bo.getCourseId(),bo.getOrderGoodsId());
|
|
|
courseMenuVo.setStudyDuration(studyDuration);
|
|
|
} else {
|
|
|
//章卷
|
|
|
- Integer rebuild = baseMapper.rebuildCheck(0L, courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), courseMenuVo.getTypeId(),bo.getCourseId());
|
|
|
+ Integer rebuild = baseMapper.rebuildCheck(0L, courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), courseMenuVo.getTypeId(),bo.getCourseId(),bo.getOrderGoodsId());
|
|
|
if (rebuild > 0) {
|
|
|
courseMenuVo.setRebuild(1);
|
|
|
}
|
|
|
- Integer audit = baseMapper.auditCheck(0L, courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), courseMenuVo.getTypeId(),bo.getCourseId());
|
|
|
+ Integer audit = baseMapper.auditCheck(0L, courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), courseMenuVo.getTypeId(),bo.getCourseId(),bo.getOrderGoodsId());
|
|
|
if (rebuild > 0) {
|
|
|
courseMenuVo.setAudit(1L);
|
|
|
}
|
|
|
- Integer learning = baseMapper.learningExamCheck(0L, courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), courseMenuVo.getTypeId(),bo.getCourseId());
|
|
|
+ Integer learning = baseMapper.learningExamCheck(0L, courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), courseMenuVo.getTypeId(),bo.getCourseId(),bo.getOrderGoodsId());
|
|
|
if(Validator.isNotEmpty(learning)){
|
|
|
courseMenuVo.setLearning(new Long(learning));
|
|
|
}
|
|
@@ -196,9 +200,12 @@ public class CourseChapterSectionServiceImpl extends ServiceImpl<CourseChapterSe
|
|
|
|
|
|
@Override
|
|
|
public List<CourseUserChapterSectionVo> sectionExamList(CourseMenuQueryBo bo) {
|
|
|
+ if(Validator.isEmpty(bo.getOrderGoodsId())){
|
|
|
+ throw new CustomException("OrderGoodsId缺失");
|
|
|
+ }
|
|
|
List<CourseUserChapterSectionVo> examList = baseMapper.sectionExamList(bo);
|
|
|
for(CourseUserChapterSectionVo vo : examList){
|
|
|
- Integer learning = baseMapper.learningSectionExamCheck(0L, vo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), vo.getTypeId(),bo.getCourseId(),vo.getSectionId());
|
|
|
+ Integer learning = baseMapper.learningSectionExamCheck(0L, vo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), vo.getTypeId(),bo.getCourseId(),vo.getSectionId(),bo.getOrderGoodsId());
|
|
|
if(Validator.isNotEmpty(learning)){
|
|
|
vo.setLearning(new Long(learning));
|
|
|
}
|