Kaynağa Gözat

在线考试2022/05/20临时上线需求更改

wangliang 3 yıl önce
ebeveyn
işleme
c284cc6be0

+ 1 - 3
themis-admin/src/main/java/com/qmth/themis/admin/api/TEExamController.java

@@ -467,13 +467,11 @@ public class TEExamController {
                 examPropCountDto.get().setPrepareCount(list.get(0));
                 examPropCountDto.get().setExamCount(list.get(1));
                 examPropCountDto.get().setAlreadyComplete(list.get(2));
+                examPropCountDto.get().setNotComplete(list.get(3) + list.get(4));
             }
-            Integer notComplete = examPropCountDto.get().getAllCount() - examPropCountDto.get().getAlreadyComplete()
-                    - examPropCountDto.get().getExamCount() - examPropCountDto.get().getPrepareCount();
             BigDecimal completionRate = new BigDecimal(examPropCountDto.get().getAlreadyComplete())
                     .divide(new BigDecimal(examPropCountDto.get().getAllCount()), 2, BigDecimal.ROUND_HALF_UP)
                     .setScale(2, BigDecimal.ROUND_HALF_UP);
-            examPropCountDto.get().setNotComplete(notComplete);
             examPropCountDto.get().setCompletionRate(completionRate);
         }
 //        long end = System.currentTimeMillis();

+ 43 - 0
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -1342,6 +1342,49 @@
         </foreach>
         and (t.STATUS = 'FINISHED'
         or t.STATUS = 'PERSISTED')
+        union all
+        select
+        count(1) as c
+        from
+        t_e_exam_student t
+        left join t_e_exam_activity f on
+        t.exam_activity_id = f.id
+        join t_e_exam tee on
+        tee.id = t.exam_id
+        where
+        NOT EXISTS(
+        select
+        toer.exam_student_id
+        from
+        t_oe_exam_record toer
+        where
+        t.id = toer.exam_student_id)
+        and t.exam_id = #{examId}
+        and t.room_code in
+        <foreach collection="roomCodeSet" item="roomCode" index="index" open="(" close=")" separator=",">
+            #{roomCode}
+        </foreach>
+        union all
+        select
+        count(1) as c
+        from
+        t_oe_exam_record toer
+        join t_e_exam_student t on
+        t.id = toer.exam_student_id
+        and t.exam_id = toer.exam_id
+        and t.exam_activity_id = toer.exam_activity_id
+        join t_e_exam_activity f on
+        t.exam_activity_id = f.id
+        join t_e_exam tee on
+        tee.id = t.exam_id
+        where
+        toer.exam_id = #{examId} and t.room_code in
+        <foreach collection="roomCodeSet" item="roomCode" index="index" open="(" close=")" separator=",">
+            #{roomCode}
+        </foreach>
+        and toer.status = 'FIRST_PREPARE'
+        and (toer.first_start_time is null
+        or toer.first_prepare_time is null)
     </select>
 
     <select id="findByOnlineInfoRecord" resultType="com.qmth.themis.business.entity.TOeExamRecord">