Parcourir la source

修改學時審核

change il y a 3 ans
Parent
commit
8b56cb9b3c

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/mapper/ClassGradeUserMapper.java

@@ -35,7 +35,7 @@ public interface ClassGradeUserMapper extends BaseMapper<ClassGradeUser> {
 
     List<ClassPeriodVo> listPeriodAuditExam(ClassGradeUserQueryBo bo);
 
-    List<ClassPeriodSectionVo> listperiodExam(@Param("moduleId") Long id,@Param("goodsId") Long goodsId,@Param("courseId") Long courseId,@Param("userId") Long userId);
+    List<ClassPeriodSectionVo> listperiodExam(@Param("chapterId") Long id,@Param("goodsId") Long goodsId,@Param("courseId") Long courseId,@Param("userId") Long userId,@Param("moduleId") Long moduleId);
 
     List<ClassPeriodSectionVo> listPeriodSectionExam(@Param("chapterId") Long id,@Param("goodsId") Long goodsId,@Param("courseId") Long courseId,@Param("userId") Long userId);
 }

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

@@ -198,7 +198,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 for (ClassPeriodChapterVo classPeriodChapterVo : classPeriodChapterVos) {
                     if (classPeriodChapterVo.getType() == 2) {
                         List<ClassPeriodSectionVo> classPeriodSectionVos = baseMapper.listPeriodSection(classPeriodChapterVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId());
-                        classPeriodSectionVos.addAll(baseMapper.listperiodExam(classPeriodVo.getId(), bo.getGoodsId(),classPeriodVo.getCourseId(), bo.getUserId()));
+                        classPeriodSectionVos.addAll(baseMapper.listperiodExam(classPeriodChapterVo.getId(), bo.getGoodsId(),classPeriodVo.getCourseId(), bo.getUserId(),classPeriodVo.getId()));
                         for (ClassPeriodSectionVo classPeriodSectionVo : classPeriodSectionVos) {
                             if (classPeriodSectionVo.getType() == 3) {
                                 UserPeriodQueryBo userPeriodQueryBo = new UserPeriodQueryBo();

+ 4 - 79
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -541,85 +541,7 @@
         ) as user_id,
         (SELECT e.exam_name FROM exam e where cme.exam_id = e.exam_id) as type_name,
         null as class_hours,
-        4 as type,
-        (
-        SELECT
-        ups.record_start_time
-        FROM
-        user_period_status ups
-        LEFT JOIN user_period up ON up.id = ups.period_id
-        WHERE
-        period_status = 1
-        AND up.course_id = cme.course_id
-        <if test="goodsId != null and goodsId !='' ">
-            AND up.goods_id = #{goodsId}
-        </if>
-        and cme.module_id = up.module_id
-        AND up.exam_id = cme.exam_id
-
-        ) AS study_start_time,
-        (
-        SELECT
-        ups.record_end_time
-        FROM
-        user_period_status ups
-        LEFT JOIN user_period up ON up.id = ups.period_id
-        WHERE
-        period_status = 1
-
-        AND up.course_id = cme.course_id
-
-        <if test="goodsId != null and goodsId !='' ">
-            AND up.goods_id = #{goodsId}
-        </if>
-        and cme.module_id = up.module_id
-        AND up.exam_id = cme.exam_id
-        ) AS study_end_time,
-        (
-        SELECT
-        ups.`status`
-        FROM
-        user_period_status ups
-        LEFT JOIN user_period up ON up.id = ups.period_id
-        WHERE
-        period_status = 1
-        AND up.course_id = cme.course_id
-        <if test="goodsId != null and goodsId !='' ">
-            AND up.goods_id = #{goodsId}
-        </if>
-        and cme.module_id = up.module_id
-        AND up.exam_id = cme.exam_id
-        ) AS STATUS,
-        (
-        SELECT
-        ups.create_time
-        FROM
-        user_period_status ups
-        LEFT JOIN user_period up ON up.id = ups.period_id
-        WHERE
-        period_status = 1
-        AND up.course_id = cme.course_id
-        <if test="goodsId != null and goodsId !='' ">
-            AND up.goods_id = #{goodsId}
-        </if>
-        and cme.module_id = up.module_id
-        AND up.exam_id = cme.exam_id
-        ) AS audit_time,
-        (
-        SELECT
-        COUNT( ups.id )
-        FROM
-        user_period_status ups
-        LEFT JOIN user_period up ON up.id = ups.period_id
-        WHERE
-        period_status = 1
-        AND up.course_id = cme.course_id
-        <if test="goodsId != null and goodsId !='' ">
-            AND up.goods_id = #{goodsId}
-        </if>
-        and cme.module_id = up.module_id
-        AND up.exam_id = cme.exam_id
-        ) AS audit_num
+        4 as type
         FROM
         course_menu_exam cme
         LEFT JOIN exam e ON cme.exam_id = e.exam_id
@@ -627,6 +549,9 @@
         <if test="courseId != null and courseId !='' ">
             AND  cme.course_id=#{courseId}
         </if>
+        <if test="chapterId != null and chapterId !='' ">
+            AND cme.chapter_id =#{chapterId}
+        </if>
         <if test="moduleId != null and moduleId !='' ">
             AND cme.module_id =#{moduleId}
         </if>