he2802 2 yıl önce
ebeveyn
işleme
89ce70fcd8

+ 6 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseChapterSectionMapper.java

@@ -30,22 +30,22 @@ public interface CourseChapterSectionMapper extends BaseMapper<CourseChapterSect
     List<CourseUserChapterSectionVo> sectionExamList(CourseMenuQueryBo bo);
 
     Integer rebuildCheck(@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);
 
     Integer learningCheck(@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);
 
     Integer auditCheck(@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);
 
     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);
 
     Integer learningSectionExamCheck(@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("sectionId") Long sectionId);
+                              @Param("userId") Long userId,@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("examId") Long examId,@Param("courseId") Long courseId,@Param("sectionId") Long sectionId,@Param("orderGoodsId") Long orderGoodsId);
 
     Long getStudyDuration(@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("chapterId") Long chapterId,@Param("newTenantId") Long newTenantId);

+ 15 - 8
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterSectionServiceImpl.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.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));
             }

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseUserChapterSectionVo.java

@@ -123,4 +123,5 @@ public class CourseUserChapterSectionVo {
 	private String teacherName;
 	@ApiModelProperty("观看时长(秒)")
 	private Long studyDuration;
+	private Long orderGoodsId;
 }

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

@@ -229,7 +229,7 @@ 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());
+            Integer learning = courseChapterSectionMapper.learningCheck(vo.getSectionId(), vo.getGradeId(), bo.getUserId(), vo.getModuleId(), vo.getChapterId(), 0L,vo.getCourseId(),vo.getOrderGoodsId());
             if (learning > 0) {
                 vo.setLearning(1L);
             }
@@ -1028,7 +1028,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
     public SectionStudyRecordVo getUserWatchLast(UserStudyRecordQueryBo bo) {
         SectionStudyRecordVo vo = this.baseMapper.getUserWatchLast(bo);
         if(Validator.isNotEmpty(vo)){
-            Integer learning = courseChapterSectionMapper.learningCheck(vo.getSectionId(), vo.getGradeId(), bo.getUserId(), vo.getModuleId(), vo.getChapterId(), 0L,vo.getCourseId());
+            Integer learning = courseChapterSectionMapper.learningCheck(vo.getSectionId(), vo.getGradeId(), bo.getUserId(), vo.getModuleId(), vo.getChapterId(), 0L,vo.getCourseId(),vo.getOrderGoodsId());
             if (learning > 0) {
                 vo.setLearning(1L);
             }
@@ -1041,7 +1041,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
     public SectionStudyRecordVo getUserStudyLast(UserStudyRecordQueryBo bo) {
         SectionStudyRecordVo vo = this.baseMapper.getUserWatchLast(bo);
         if(Validator.isNotEmpty(vo)){
-            Integer learning = courseChapterSectionMapper.learningCheck(vo.getSectionId(), vo.getGradeId(), bo.getUserId(), vo.getModuleId(), vo.getChapterId(), 0L,vo.getCourseId());
+            Integer learning = courseChapterSectionMapper.learningCheck(vo.getSectionId(), vo.getGradeId(), bo.getUserId(), vo.getModuleId(), vo.getChapterId(), 0L,vo.getCourseId(),vo.getOrderGoodsId());
             if (learning > 0) {
                 vo.setLearning(1L);
             }

+ 1 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseChapterSectionMapper.xml

@@ -307,6 +307,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           AND ubr.chapter_id = #{chapterId}
           AND ubr.section_id = #{sectionId}
           AND ubr.exam_id = #{examId}
+          AND ubr.order_goods_id = #{orderGoodsId}
           AND ubr.current_status = 1
           AND ubr.type = 2
         ORDER BY

+ 1 - 0
zhongzheng-system/src/main/resources/mapper/modules/order/OrderGoodsMapper.xml

@@ -538,6 +538,7 @@
         cg.class_name,
         g.goods_name,
         og.goods_price,
+        og.seven_year as order_year,
         og.goods_real_price
         FROM
         `order` o