Bläddra i källkod

管理员统计修改

wangliang 1 år sedan
förälder
incheckning
5b2124bcba

+ 6 - 0
themis-admin/src/main/java/com/qmth/themis/admin/api/TIeInvigilateController.java

@@ -97,6 +97,9 @@ public class TIeInvigilateController {
     @Resource
     TIeExamMediaLogService tIeExamMediaLogService;
 
+    @Resource
+    TEExamSummaryService teExamSummaryService;
+
     @ApiOperation(value = "实时监控台视频列表接口")
     @RequestMapping(value = "/list/video", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "监考监控信息", response = InvigilateListVideoBean.class)})
@@ -389,6 +392,9 @@ public class TIeInvigilateController {
             tIeInvigilateWarnInfoService.update(tIeExamInvigilateNoticeUpdateWrapper);
             tOeExamRecordService.updateWarningUnreadByDb(examRecordId, 0);
             tOeExamRecordService.updateWarningUnreadCache(examRecordId, 0, false);
+
+            Set<String> roomCodeSet = new HashSet<>(Arrays.asList(examStudentCacheBean.getRoomCode().split(", ")));
+            teExamSummaryService.examSummary(examId, examActivityId, roomCodeSet, true);
         }
         invigilateListDetailBean.setMonitorVideoSource(examCacheBean.getMonitorVideoSource());
         invigilateListDetailBean.setMonitorRecord(examCacheBean.getMonitorRecord());

+ 3 - 22
themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeReportServiceImpl.java

@@ -72,12 +72,6 @@ public class TIeReportServiceImpl implements TIeReportService {
     @Resource
     TEExamService teExamService;
 
-    @Resource
-    TEExamActivityService teExamActivityService;
-
-    @Resource
-    TEExamStudentService teExamStudentService;
-
     /**
      * 考试概览
      *
@@ -94,26 +88,14 @@ 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, completeOffExamTotal = 0;
+        Integer examTotal = 0, actualExamTotal = 0, absentNum = 0;
         ExamCacheBean exam = examService.getExamCacheBean(examId);
-        // 应考人数&实考人数
-//        List<Integer> list = tOeExamRecordService.findByViewAdmin(orgId, examId, examActivityId, roomCode, courseCode, exam.getMonitorStatus());
-//        if (Objects.nonNull(list) && list.size() > 0) {
-//            examTotal = list.get(0);
-//            actualExamTotal = list.get(1);
-//            completeOffExamTotal = list.get(2);
-//        }
         List<TEExamSummary> teExamSummaryList = themisCacheService.getExamSummaryCache(examId, examActivityId, roomCode);
         for (TEExamSummary t : teExamSummaryList) {
             examTotal = examTotal + t.getTotalCount();
-            actualExamTotal = actualExamTotal + t.getFinishCount();
             absentNum = absentNum + t.getAbsentCount();
+            actualExamTotal = examTotal.intValue() - absentNum.intValue();
         }
-
-        if (exam.getMonitorStatus() == InvigilateMonitorStatusEnum.FINISHED) {// 结束监考的,未考试的都是缺考
-            absentNum = examTotal.intValue() - actualExamTotal.intValue();
-        }
-        completeOffExamTotal = absentNum;
         // 每日已考人数
         List<Map<String, Object>> doneCountByDay = tOeExamRecordMapper.getDoneCountByDay(orgId, examId, examActivityId, roomCode, courseCode);
 
@@ -122,8 +104,7 @@ public class TIeReportServiceImpl implements TIeReportService {
         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", completeOffExamTotal);
+        ret.put("completeOffExamTotal", absentNum);
         ret.put("examTotalList", doneCountByDay);
         return ret;
     }

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

@@ -87,7 +87,7 @@
         tiiwi.exam_record_id) temp on
         temp.warningId = tiiwi.id
         2022/09/03新增 end-->
-        left join t_oe_exam_record toer on toer.id = tiiwi.exam_record_id and (toer.id = tees.current_record_id or tees.already_exam_count > 0)
+        left join t_oe_exam_record toer on toer.id = tiiwi.exam_record_id
         left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = tiiwi.exam_id and tbeiu.room_code = tees.room_code
         join t_e_exam tee on tee.id = tiiwi.exam_id
         <where> 1 = 1