Bläddra i källkod

Merge branch 'dev'
1

wangliang 4 år sedan
förälder
incheckning
7bf3ff88b9

+ 2 - 0
themis-exam/src/main/java/com/qmth/themis/exam/websocket/WebSocketMobileServer.java

@@ -19,6 +19,7 @@ import com.qmth.themis.common.enums.ExceptionResultEnum;
 import com.qmth.themis.common.exception.BusinessException;
 import com.qmth.themis.common.signature.SignatureInfo;
 import com.qmth.themis.common.signature.SignatureType;
+import com.qmth.themis.exam.config.ExamConstant;
 import com.qmth.themis.exam.listener.service.MqOeLogicService;
 import com.qmth.themis.exam.websocketTemplete.WebSocketMobileMessageTemplete;
 import com.qmth.themis.mq.templete.Concurrently;
@@ -150,6 +151,7 @@ public class WebSocketMobileServer implements Concurrently {
                 map.put("monitorVideoSource", this.source.name());
                 WebsocketDto websocketDto = new WebsocketDto(WebsocketTypeEnum.MOBILE_MONITOR_STOP.name(), map);
                 webSocketOeServer.sendMessage(websocketDto);
+                ExamConstant.sendExamStopMsg(this.recordId);
             }
         }
         log.info("用户退出:{},当前在线人数为:{},updateTime:{}", this.sessionId, getOnlineCount(), this.updateTime);

+ 0 - 8
themis-exam/src/main/java/com/qmth/themis/exam/websocketTemplete/WebSocketMobileMessageTemplete.java

@@ -1,14 +1,11 @@
 package com.qmth.themis.exam.websocketTemplete;
 
 import com.alibaba.fastjson.JSONObject;
-import com.qmth.themis.business.cache.ExamRecordCacheUtil;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.WebsocketDto;
-import com.qmth.themis.business.enums.ExamRecordStatusEnum;
 import com.qmth.themis.business.enums.WebsocketTypeEnum;
 import com.qmth.themis.common.enums.ExceptionResultEnum;
 import com.qmth.themis.common.exception.BusinessException;
-import com.qmth.themis.exam.config.ExamConstant;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Component;
@@ -39,11 +36,6 @@ public class WebSocketMobileMessageTemplete {
         if (Objects.isNull(jsonObject.get("recordId")) || Objects.equals(jsonObject.get("recordId"), "")) {
             throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
         }
-        Long recordId = Long.parseLong(String.valueOf(jsonObject.get("recordId")));
-        ExamRecordStatusEnum status = ExamRecordCacheUtil.getStatus(recordId);
-        if (Objects.nonNull(status) && Objects.equals(ExamRecordStatusEnum.BREAK_OFF, status)) {//如果是已中断状态,则给客户端和移动端发送考试停止的消息
-            ExamConstant.sendExamStopMsg(recordId);
-        }
         return this.syncAck(body);
     }
 

+ 0 - 7
themis-exam/src/main/java/com/qmth/themis/exam/websocketTemplete/WebSocketOeMessageTemplete.java

@@ -6,13 +6,11 @@ import com.qmth.themis.business.cache.RedisKeyHelper;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.WebsocketDto;
 import com.qmth.themis.business.enums.ExamRecordFieldEnum;
-import com.qmth.themis.business.enums.ExamRecordStatusEnum;
 import com.qmth.themis.business.enums.WebsocketTypeEnum;
 import com.qmth.themis.business.service.TOeExamRecordService;
 import com.qmth.themis.business.util.RedisUtil;
 import com.qmth.themis.common.enums.ExceptionResultEnum;
 import com.qmth.themis.common.exception.BusinessException;
-import com.qmth.themis.exam.config.ExamConstant;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Component;
@@ -93,11 +91,6 @@ public class WebSocketOeMessageTemplete {
         String[] columns = new String[]{ExamRecordFieldEnum.answer_progress.name(), ExamRecordFieldEnum.duration_seconds.name(), ExamRecordFieldEnum.client_last_sync_time.name()};
         Object[] values = new Object[]{progress, durationSeconds, clientLastSyncTime};
         tOeExamRecordService.dataUpdatesMq(recordId, columns, values);
-
-        ExamRecordStatusEnum status = ExamRecordCacheUtil.getStatus(recordId);
-        if (Objects.nonNull(status) && Objects.equals(ExamRecordStatusEnum.BREAK_OFF, status)) {//如果是已中断状态,则给客户端和移动端发送考试停止的消息
-            ExamConstant.sendExamStopMsg(recordId);
-        }
         return this.syncAck(body);
     }