فهرست منبع

在线考试2022/05/20临时上线需求更改,管理员报表修改

wangliang 3 سال پیش
والد
کامیت
c65c18c30b

+ 5 - 2
themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeReportServiceImpl.java

@@ -66,12 +66,13 @@ public class TIeReportServiceImpl implements TIeReportService {
     public Map<String, Object> examView(Long orgId, Long examId, Long examActivityId, String roomCode, String courseCode,
                                         String name, String identity) {
         // 缺考人数
-        Integer examTotal = 0, actualExamTotal = 0, absentNum = 0;
+        Integer examTotal = 0, actualExamTotal = 0, absentNum = 0, completeOffExamTotal = 0;
         // 应考人数&实考人数
         List<Integer> list = tOeExamRecordService.findByViewAdmin(orgId, examId, examActivityId, roomCode, courseCode);
         if (Objects.nonNull(list) && list.size() > 0) {
             examTotal = list.get(0);
             actualExamTotal = list.get(1);
+            completeOffExamTotal = list.get(2);
         }
         ExamCacheBean exam = examService.getExamCacheBean(examId);
         if (exam.getMonitorStatus() == InvigilateMonitorStatusEnum.FINISHED) {// 结束监考的,未考试的都是缺考
@@ -81,10 +82,12 @@ public class TIeReportServiceImpl implements TIeReportService {
         List<Map<String, Object>> doneCountByDay = tOeExamRecordMapper.getDoneCountByDay(orgId, examId, examActivityId, roomCode, courseCode);
 
         Map<String, Object> ret = new HashMap<String, Object>();
+        ret.put("monitorStatus", exam.getMonitorStatus());
         ret.put("examTotal", examTotal.intValue());
         ret.put("actualExamTotal", actualExamTotal.intValue());
         ret.put("deficiencyExamTotal", absentNum.intValue());
-        ret.put("completeOffExamTotal", examTotal.intValue() - actualExamTotal.intValue() - absentNum.intValue());
+//        ret.put("completeOffExamTotal", examTotal.intValue() - actualExamTotal.intValue() - absentNum.intValue());
+        ret.put("completeOffExamTotal", completeOffExamTotal);
         ret.put("examTotalList", doneCountByDay);
         return ret;
     }

+ 5 - 7
themis-business/src/main/resources/mapper/TEExamStudentMapper.xml

@@ -182,7 +182,7 @@
         where
         toer.exam_id = t.exam_id
         and toer.exam_activity_id = t.exam_activity_id
-        and tees.room_code = t.room_code and tees.room_name = t.room_name) as actualExamTotal
+        and tees.room_code = t.room_code and tees.room_name = t.room_name and toer.first_start_time is not null) as actualExamTotal
         from
         t_e_exam_student t
         left join t_e_student h on
@@ -271,7 +271,7 @@
         from
         (
         select
-        tee.name as examName,
+        distinct tee.name as examName,
         t.exam_id examId,
         t.exam_activity_id examActivityId,
         t.room_code roomCode,
@@ -290,8 +290,7 @@
         tee.id = t.exam_id
         where
         NOT EXISTS(
-        select
-        toer.exam_student_id
+        select distinct toer.exam_student_id
         from
         t_oe_exam_record toer
         where t.id = toer.exam_student_id)
@@ -318,7 +317,7 @@
         </if>
         union all
         select
-        tee.name as examName,
+        distinct tee.name as examName,
         t.exam_id examId,
         t.exam_activity_id examActivityId,
         t.room_code roomCode,
@@ -361,7 +360,7 @@
         <if test="name != null and name != ''">
             and t.name like concat('%',#{name},'%')
         </if>
-        and (toer.first_start_time is null or toer.first_prepare_time is null)
+        and toer.first_start_time is null
         and not exists(
         select
         *
@@ -375,7 +374,6 @@
         t.exam_student_id = s.id
         where
         t.exam_id = #{examId}
-        and (t.STATUS = 'FINISHED' or t.STATUS = 'PERSISTED')
         and t.first_start_time is not null
         and t.exam_activity_id in
         <foreach collection="activityIds" item="acid" index="index"

+ 31 - 1
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -1563,7 +1563,37 @@
         </where>
         )) t
         where
-        t.id = toer.exam_student_id)
+        t.id = toer.exam_student_id and toer.first_start_time is not null)
+        union all
+        select
+        count(1)
+        from
+        t_e_exam_student tees
+        join t_e_exam tee on
+        tees.exam_id = tee.id
+        where
+        NOT EXISTS(
+        select
+        toer.exam_student_id
+        from
+        t_oe_exam_record toer
+        where
+        tees.id = toer.exam_student_id)
+        <if test="orgId != null and orgId != ''">
+            and tee.org_id = #{orgId}
+        </if>
+        <if test="examId != null and examId != ''">
+            and tees.exam_id = #{examId}
+        </if>
+        <if test="examActivityId != null and examActivityId != ''">
+            and tees.exam_activity_id = #{examActivityId}
+        </if>
+        <if test="roomCode != null and roomCode != ''">
+            and tees.room_code = #{roomCode}
+        </if>
+        <if test="courseCode != null and courseCode != ''">
+            and tees.course_code = #{courseCode}
+        </if>
     </select>
 
     <select id="examRecordDetailQuery" resultType="com.qmth.themis.business.cache.bean.ExamRecordDetailBean">