Przeglądaj źródła

考情监控人数bug

xiatian 4 lat temu
rodzic
commit
096b520db6

+ 2 - 0
themis-business/src/main/java/com/qmth/themis/business/dao/TOeExamRecordMapper.java

@@ -293,6 +293,8 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
     public TOeExamRecord findOneByExamId(@Param("examId") Long examId,@Param("status") String status);
 
     public Long getExamingCount();
+    
+    public Long getOnlineCount();
 
     public Long getExceptionCount();
 

+ 40 - 14
themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeReportServiceImpl.java

@@ -1,14 +1,48 @@
 package com.qmth.themis.business.service.impl;
 
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import javax.annotation.Resource;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.time.DateUtils;
+import org.springframework.stereotype.Service;
+
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.OrderItem;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.qmth.themis.business.bean.backend.*;
+import com.qmth.themis.business.bean.backend.ExamBreachDetailListBean;
+import com.qmth.themis.business.bean.backend.ExamBreachListBean;
+import com.qmth.themis.business.bean.backend.ExamDeficiencyListBean;
+import com.qmth.themis.business.bean.backend.ExamExceptionDetailListBean;
+import com.qmth.themis.business.bean.backend.ExamExceptionListBean;
+import com.qmth.themis.business.bean.backend.ExamReexamListBean;
+import com.qmth.themis.business.bean.backend.ExamStudentLogDetailListBean;
+import com.qmth.themis.business.bean.backend.ExamStudentLogListBean;
+import com.qmth.themis.business.bean.backend.ExamViewCountListBean;
+import com.qmth.themis.business.bean.backend.ExaminationMonitorCountBean;
+import com.qmth.themis.business.bean.backend.ExaminationMonitorHourWarnCountBean;
+import com.qmth.themis.business.bean.backend.ExaminationMonitorWarnDistributionBean;
+import com.qmth.themis.business.bean.backend.ExaminationMonitorWarnMsgBean;
+import com.qmth.themis.business.bean.backend.InvigilateListPatrolReportBean;
+import com.qmth.themis.business.bean.backend.WarningNotifyBean;
 import com.qmth.themis.business.cache.bean.ExamActivityCacheBean;
 import com.qmth.themis.business.cache.bean.ExamCacheBean;
-import com.qmth.themis.business.constant.SystemConstant;
-import com.qmth.themis.business.dao.*;
+import com.qmth.themis.business.dao.TBExamInvigilateUserMapper;
+import com.qmth.themis.business.dao.TEExamBreachLogMapper;
+import com.qmth.themis.business.dao.TEExamReexamMapper;
+import com.qmth.themis.business.dao.TEExamStudentLogMapper;
+import com.qmth.themis.business.dao.TEExamStudentMapper;
+import com.qmth.themis.business.dao.TIeInvigilateExceptionInfoMapper;
+import com.qmth.themis.business.dao.TIeInvigilateWarnInfoMapper;
+import com.qmth.themis.business.dao.TOeExamRecordMapper;
 import com.qmth.themis.business.entity.TEExamActivity;
 import com.qmth.themis.business.enums.BreachCancelTypeEnum;
 import com.qmth.themis.business.enums.BreachTypeEnum;
@@ -18,14 +52,6 @@ import com.qmth.themis.business.service.TEExamActivityService;
 import com.qmth.themis.business.service.TEExamService;
 import com.qmth.themis.business.service.TIeReportService;
 import com.qmth.themis.business.util.RedisUtil;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.time.DateUtils;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.stream.Collectors;
 
 @Service
 public class TIeReportServiceImpl implements TIeReportService {
@@ -377,12 +403,12 @@ public class TIeReportServiceImpl implements TIeReportService {
     @Override
     public ExaminationMonitorCountBean examinationMonitorCount() {
         ExaminationMonitorCountBean ret = new ExaminationMonitorCountBean();
-        Integer onlineCount = (Integer) redisUtil.get(SystemConstant.WEBSOCKET_OE_ONLINE_COUNT);
+        Long onlineCount = tOeExamRecordMapper.getOnlineCount();
         if (onlineCount == null) {
-            onlineCount = 0;
+            onlineCount = 0L;
         }
         // 在线人数
-        ret.setOnlineCount(Long.valueOf(onlineCount.toString()));
+        ret.setOnlineCount(onlineCount);
         // 考试人数
         Long examingCount = tOeExamRecordMapper.getExamingCount();
         if (examingCount == null) {

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

@@ -669,9 +669,13 @@
 		order by t.roomCode
 	</select>
 
+	<select id="getOnlineCount" resultType="java.lang.Long">
+		select count(1) from t_oe_exam_record f
+		where f.client_websocket_status='ON_LINE'
+	</select>
 	<select id="getExamingCount" resultType="java.lang.Long">
 		select count(1) from t_oe_exam_record f
-		where f.status != 'FINISHED' and f.status != 'PERSISTED'
+		where f.status != 'FINISHED' and f.status != 'PERSISTED' and f.client_websocket_status='ON_LINE'
 	</select>
 	<select id="getExceptionCount" resultType="java.lang.Long">
 			SELECT
@@ -712,6 +716,7 @@
 			WHERE
 				f. STATUS != 'FINISHED'
 			AND f. STATUS != 'PERSISTED'
+			AND f.client_websocket_status='ON_LINE'
 			GROUP BY
 				h.org_id
 		) tem