he2802 4 лет назад
Родитель
Сommit
75c726c89c

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

@@ -34,4 +34,7 @@ public interface CourseChapterSectionMapper extends BaseMapper<CourseChapterSect
 
     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);
+
+    Long 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);
 }

+ 2 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterSectionServiceImpl.java

@@ -162,10 +162,8 @@ public class CourseChapterSectionServiceImpl extends ServiceImpl<CourseChapterSe
                     if (rebuild > 0) {
                         courseMenuVo.setAudit(1L);
                     }
-                    Integer learning = baseMapper.learningCheck(0L, courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), courseMenuVo.getTypeId());
-                    if (learning > 0) {
-                        courseMenuVo.setLearning(1L);
-                    }
+                    Long learning = baseMapper.learningExamCheck(0L, courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), courseMenuVo.getTypeId());
+                    courseMenuVo.setLearning(learning);
                 }
             }
         }

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -370,8 +370,8 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
             classPeriodUserVo.setSecAllNum(secLong);
             //学习节数
             classPeriodUserVo.setStuAllNum(studyLong);
-            classPeriodUserVo.setPending(classPeriodUserVo.getSecAllNum()-classPeriodUserVo.getPass()-classPeriodUserVo.getCheat());
-            classPeriodUserVo.setExamPending(classPeriodUserVo.getExamNum()-classPeriodUserVo.getExamPass()-classPeriodUserVo.getExamCheat());
+    //        classPeriodUserVo.setPending(classPeriodUserVo.getSecAllNum()-classPeriodUserVo.getPass()-classPeriodUserVo.getCheat());
+    //        classPeriodUserVo.setExamPending(classPeriodUserVo.getExamNum()-classPeriodUserVo.getExamPass()-classPeriodUserVo.getExamCheat());
                 //當前班級學員審核狀態 -1不可审核 0待審  1未通过 2通过
             if (classPeriodUserVo.getStuAllNum().equals(classPeriodUserVo.getSecAllNum()) && classPeriodUserVo.getExamNum().equals(classPeriodUserVo.getRecordNum())){
                 if (classPeriodUserVo.getPending() != 0 || classPeriodUserVo.getExamPending() != 0){

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

@@ -200,6 +200,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           and ups.record_end_time is not null
     </select>
 
+    <select id="learningExamCheck" parameterType="map"  resultType="integer">
+        SELECT
+            ubr.report_status
+        FROM
+            user_bank_record ubr
+        WHERE
+            ubr.grade_id = #{gradeId}
+          AND ubr.user_id = #{userId}
+          AND ubr.module_id = #{moduleId}
+          AND ubr.chapter_id = #{chapterId}
+          AND ubr.exam_id = #{examId}
+        ORDER BY
+            ubr.record_id DESC
+            LIMIT 1
+    </select>
+
     <select id="auditCheck" parameterType="map"  resultType="integer">
         SELECT
             COUNT(up.id)

+ 9 - 2
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -89,7 +89,9 @@
         <result property="recordNum" column="record_num"/>
         <result property="pass" column="pass"/>
         <result property="cheat" column="cheat"/>
+        <result property="pending" column="pending"/>
         <result property="examPass" column="exam_pass"/>
+        <result property="examPending" column="exam_pending"/>
         <result property="examCheat" column="exam_cheat"/>
         <result property="keyValue" column="key_value"/>
     </resultMap>
@@ -277,14 +279,19 @@
         = ubr.goods_id where ubr.`status`=1 and ubr.report_status =1 and ubr.user_id=#{userId} and cg.grade_id=cgg.grade_id ) as record_num,
         (SELECT COUNT(up.id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where
         ups.`status` =1 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.user_id = #{userId} and up.type = 1) as pass,
+        (SELECT COUNT(up.id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where
+        ups.`status` =2 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.user_id = #{userId} and up.type = 1) as pending,
        (SELECT
         COUNT(up.id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where ups.`status`
         =0 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.user_id = #{userId} and up.type = 1) as cheat,
         (SELECT COUNT(up.id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where
-        ups.`status` =1 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.user_id = #{userId} and up.type = 2) as exam_pass,
+        ups.`status` =1 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.user_id = #{userId} and up.grade_id = cg.grade_id and up.type = 2) as exam_pass,
+        (SELECT
+        COUNT(up.id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where ups.`status`
+        =0 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and up.user_id = #{userId} and up.type = 2) as exam_cheat,
         (SELECT
         COUNT(up.id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where ups.`status`
-        =0 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.user_id = #{userId} and up.type = 2) as exam_cheat,
+        =2 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and up.user_id = #{userId} and up.type = 2) as exam_pending,
         (SELECT up.key_value FROM user_profile up where up.goods_id = #{goodsId} and up.user_id =#{userId} and up.current_status = 1 and up.type_status =1 LIMIT 1) as key_value
         FROM
         class_grade_user cgu