he2802 2 年之前
父節點
當前提交
ae468ccc0b

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseModuleChapterMapper.java

@@ -21,12 +21,12 @@ public interface CourseModuleChapterMapper extends BaseMapper<CourseModuleChapte
 
     List<CourseUserModuleChapterVo> chapterList(CourseMenuQueryBo bo);
 
-    Integer rebuildChapterCheck(@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("gradeId") Long gradeId,@Param("userId") Long userId,@Param("examId") Long examId);
+    Integer rebuildChapterCheck(@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("gradeId") Long gradeId,@Param("userId") Long userId,@Param("examId") Long examId,@Param("orderGoodsId") Long orderGoodsId);
 
     List<CourseUserModuleChapterVo> examList(CourseMenuQueryBo bo);
 
     Integer learningExamCheck(@Param("typeId") Long typeId,@Param("gradeId") Long gradeId,
-                              @Param("userId") Long userId,@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("examId") Long examId,@Param("courseId") Long courseId);
+                              @Param("userId") Long userId,@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("examId") Long examId,@Param("courseId") Long courseId,@Param("orderGoodsId") Long orderGoodsId);
 
     @InterceptorIgnore(tenantLine = "true")
     void deleteByIdAndTenant(@Param("newModuleId") Long newModuleId,@Param("newTenantId") Long newTenantId);

+ 7 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseModuleChapterServiceImpl.java

@@ -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.common.utils.ServletUtils;
 import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
 import com.zhongzheng.modules.course.bo.CourseModuleChapterAddBo;
@@ -112,10 +113,13 @@ public class CourseModuleChapterServiceImpl extends ServiceImpl<CourseModuleChap
 
     @Override
     public List<CourseUserModuleChapterVo> chapterList(CourseMenuQueryBo bo) {
+        if(Validator.isEmpty(bo.getOrderGoodsId())){
+            throw new CustomException("OrderGoodsId缺失");
+        }
         List<CourseUserModuleChapterVo> courseUserModuleChapterVos = baseMapper.chapterList(bo);
         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());
+            Integer learning = baseMapper.learningExamCheck(0L, vo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), vo.getTypeId(),bo.getCourseId(),bo.getOrderGoodsId());
             if(Validator.isNotEmpty(learning)){
                 vo.setLearning(new Long(learning));
             }
@@ -133,14 +137,14 @@ public class CourseModuleChapterServiceImpl extends ServiceImpl<CourseModuleChap
             }
             if(courseUserModuleChapterVo.getType()==1){
                 //查询章是否重修章
-                Integer rebuild = baseMapper.rebuildChapterCheck(courseUserModuleChapterVo.getModuleId(),courseUserModuleChapterVo.getChapterId(), courseUserModuleChapterVo.getGradeId(), bo.getUserId(),null);
+                Integer rebuild = baseMapper.rebuildChapterCheck(courseUserModuleChapterVo.getModuleId(),courseUserModuleChapterVo.getChapterId(), courseUserModuleChapterVo.getGradeId(), bo.getUserId(),null,bo.getOrderGoodsId());
                 if (rebuild > 0) {
                     courseUserModuleChapterVo.setRebuild(1);
                 }
             }
             if(courseUserModuleChapterVo.getType()==2){
                 //查询模块卷是否重修
-                Integer rebuild = baseMapper.rebuildChapterCheck(courseUserModuleChapterVo.getModuleId(),null, courseUserModuleChapterVo.getGradeId(), bo.getUserId(),courseUserModuleChapterVo.getTypeId());
+                Integer rebuild = baseMapper.rebuildChapterCheck(courseUserModuleChapterVo.getModuleId(),null, courseUserModuleChapterVo.getGradeId(), bo.getUserId(),courseUserModuleChapterVo.getTypeId(),bo.getOrderGoodsId());
                 if (rebuild > 0) {
                     courseUserModuleChapterVo.setRebuild(1);
                 }

+ 2 - 1
zhongzheng-system/src/main/resources/mapper/modules/course/CourseModuleChapterMapper.xml

@@ -101,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         WHERE
         ubr.user_id = #{userId}
         AND ubr.exam_id = e.exam_id
+        AND order_goods_id = #{orderGoodsId}
         AND grade_id = #{gradeId} and `type` = 3) do_num,
         e.exam_id as type_id,
         #{gradeId} as grade_id,
@@ -115,7 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         any_value ( ubr.performance ) performance,
         ubr.exam_id
         FROM
-        ( SELECT record_id, report_status, exam_id, performance FROM user_bank_record WHERE user_id = #{userId} AND grade_id = #{gradeId} and `type` = 3 ORDER BY record_id DESC LIMIT 9999 ) ubr
+        ( SELECT record_id, report_status, exam_id, performance FROM user_bank_record WHERE user_id = #{userId} AND grade_id = #{gradeId} AND order_goods_id = #{orderGoodsId} and `type` = 3 ORDER BY record_id DESC LIMIT 9999 ) ubr
         GROUP BY
         ubr.exam_id)ubr1 on e.exam_id = ubr1.exam_id
         where 1=1