Browse Source

Merge branch 'dev_v1.1.1' into release_v1.1.1
merge

wangliang 3 năm trước cách đây
mục cha
commit
cd9c73ab13
18 tập tin đã thay đổi với 68 bổ sung54 xóa
  1. 4 4
      themis-admin/src/main/java/com/qmth/themis/admin/api/TIeInvigilateCallMobileController.java
  2. 3 2
      themis-business/src/main/java/com/qmth/themis/business/cache/MobileAuthCacheUtil.java
  3. 2 2
      themis-business/src/main/java/com/qmth/themis/business/service/impl/CommonServiceImpl.java
  4. 3 3
      themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamServiceImpl.java
  5. 2 1
      themis-business/src/main/java/com/qmth/themis/business/service/impl/TGErrorServiceImpl.java
  6. 2 2
      themis-business/src/main/java/com/qmth/themis/business/service/impl/TOeExamRecordServiceImpl.java
  7. 2 1
      themis-business/src/main/java/com/qmth/themis/business/util/WebsocketUtil.java
  8. 2 9
      themis-exam/src/main/java/com/qmth/themis/exam/api/TEExamController.java
  9. 2 1
      themis-exam/src/main/java/com/qmth/themis/exam/api/TEFaceController.java
  10. 2 1
      themis-exam/src/main/java/com/qmth/themis/exam/api/TELivenessController.java
  11. 1 1
      themis-exam/src/main/java/com/qmth/themis/exam/api/TEMobileController.java
  12. 6 6
      themis-exam/src/main/java/com/qmth/themis/exam/api/TIeInvigilateCallMobileController.java
  13. 6 6
      themis-exam/src/main/java/com/qmth/themis/exam/api/TIeInvigilateCallOeController.java
  14. 1 1
      themis-exam/src/main/java/com/qmth/themis/exam/websocket/WebSocketMobileServer.java
  15. 2 2
      themis-exam/src/main/java/com/qmth/themis/exam/websocket/WebSocketOeServer.java
  16. 1 1
      themis-exam/src/main/java/com/qmth/themis/exam/websocketTemplete/WebSocketMobileMessageTemplete.java
  17. 21 5
      themis-exam/src/main/java/com/qmth/themis/exam/websocketTemplete/WebSocketOeMessageTemplete.java
  18. 6 6
      themis-mq/src/main/java/com/qmth/themis/mq/service/impl/MqLogicServiceImpl.java

+ 4 - 4
themis-admin/src/main/java/com/qmth/themis/admin/api/TIeInvigilateCallMobileController.java

@@ -154,10 +154,10 @@ public class TIeInvigilateCallMobileController {
     public Result callCalling(@ApiJsonObject(name = "callCallingAdminMobile", value = {
             @ApiJsonProperty(key = "recordId", type = "long", example = "1", description = "考试记录id", required = true),
             @ApiJsonProperty(key = "source", description = "监考视频源", required = true)}) @ApiParam(value = "监控信息", required = true) @RequestBody Map<String, Object> mapParameter) {
-        if (Objects.isNull(mapParameter.get("recordId")) || Objects.equals(mapParameter.get("recordId"), "")) {
+        if (Objects.isNull(mapParameter.get(SystemConstant.RECORD_ID)) || Objects.equals(mapParameter.get(SystemConstant.RECORD_ID), "")) {
             throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
         }
-        Long recordId = Long.parseLong(String.valueOf(mapParameter.get("recordId")));
+        Long recordId = Long.parseLong(String.valueOf(mapParameter.get(SystemConstant.RECORD_ID)));
         if (Objects.isNull(mapParameter.get("source")) || Objects.equals(mapParameter.get("source"), "")) {
             throw new BusinessException("来源不能为空!");
         }
@@ -190,10 +190,10 @@ public class TIeInvigilateCallMobileController {
     public Result callCancel(@ApiJsonObject(name = "callCancelAdminMobile", value = {
             @ApiJsonProperty(key = "recordId", type = "long", example = "1", description = "考试记录id", required = true),
             @ApiJsonProperty(key = "source", description = "监考视频源", required = true)}) @ApiParam(value = "监控信息", required = true) @RequestBody Map<String, Object> mapParameter) {
-        if (Objects.isNull(mapParameter.get("recordId")) || Objects.equals(mapParameter.get("recordId"), "")) {
+        if (Objects.isNull(mapParameter.get(SystemConstant.RECORD_ID)) || Objects.equals(mapParameter.get(SystemConstant.RECORD_ID), "")) {
             throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
         }
-        Long recordId = Long.parseLong(String.valueOf(mapParameter.get("recordId")));
+        Long recordId = Long.parseLong(String.valueOf(mapParameter.get(SystemConstant.RECORD_ID)));
         if (Objects.isNull(mapParameter.get("source")) || Objects.equals(mapParameter.get("source"), "")) {
             throw new BusinessException("来源不能为空!");
         }

+ 3 - 2
themis-business/src/main/java/com/qmth/themis/business/cache/MobileAuthCacheUtil.java

@@ -1,6 +1,7 @@
 package com.qmth.themis.business.cache;
 
 import com.qmth.themis.business.constant.SpringContextHolder;
+import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.enums.MobileModeEnum;
 import com.qmth.themis.business.enums.MonitorVideoSourceEnum;
 import com.qmth.themis.business.util.RedisUtil;
@@ -43,11 +44,11 @@ public class MobileAuthCacheUtil {
     }
 
     public static void setRecordId(MobileModeEnum mode, String code, Long recordId) {
-        redisUtil.set(RedisKeyHelper.mobileAuthCacheKey(mode, code), "recordId", recordId);
+        redisUtil.set(RedisKeyHelper.mobileAuthCacheKey(mode, code), SystemConstant.RECORD_ID, recordId);
     }
 
     public static Long getRecordId(MobileModeEnum mode, String code) {
-        return (Long) redisUtil.get(RedisKeyHelper.mobileAuthCacheKey(mode, code), "recordId");
+        return (Long) redisUtil.get(RedisKeyHelper.mobileAuthCacheKey(mode, code), SystemConstant.RECORD_ID);
     }
 
     public static void setMainNumber(MobileModeEnum mode, String code, Integer mainNumber) {

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

@@ -65,9 +65,9 @@ public class CommonServiceImpl implements CommonService {
                 log.info("score is null ,recordId:" + recordId);
                 //算分未完成的 发送10秒延迟消息
                 Map<String, Object> propMap = mqDtoService.buildMqDelayMsg("10s");
-                propMap.put("recordId", recordId);
+                propMap.put(SystemConstant.RECORD_ID, recordId);
                 MqDto mqDto = new MqDto(mqUtil.getMqGroupDomain().getTopic(), MqTagEnum.EXAM_RECORD_PERSISTED.name(),
-                        Collections.singletonMap("recordId", recordId), MqTagEnum.EXAM_RECORD_PERSISTED, recordId.toString(), propMap, recordId.toString());
+                        Collections.singletonMap(SystemConstant.RECORD_ID, recordId), MqTagEnum.EXAM_RECORD_PERSISTED, recordId.toString(), propMap, recordId.toString());
                 mqDtoService.assembleSendAsyncDelayMsg(mqDto);
                 return;
             }

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

@@ -1208,7 +1208,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
 //            Map<String, Object> tranMap = mqDtoService.buildMqDelayMsg("1h");
             //TODO 测试用
             Map<String, Object> tranMap = mqDtoService.buildMqDelayMsg("10m");
-            tranMap.put("recordId", recordId);
+            tranMap.put(SystemConstant.RECORD_ID, recordId);
             MqDto mqDtoTencentVideo = new MqDto(mqUtil.getMqGroupDomain().getTopic(), MqTagEnum.TENCENT_VIDEO.name(), MqTagEnum.TENCENT_VIDEO.name(), MqTagEnum.TENCENT_VIDEO, String.valueOf(recordId), tranMap, String.valueOf(recordId));
             mqDtoService.assembleSendAsyncDelayMsg(mqDtoTencentVideo);
             //发送腾讯云回调延时mq消息end
@@ -1227,8 +1227,8 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
             return;
         }
         Map<String, Object> propMap = mqDtoService.buildMqDelayMsg("10s");
-        propMap.put("recordId", recordId);
-        MqDto mqDto = new MqDto(mqUtil.getMqGroupDomain().getTopic(), MqTagEnum.EXAM_RECORD_PERSISTED.name(), Collections.singletonMap("recordId", recordId),
+        propMap.put(SystemConstant.RECORD_ID, recordId);
+        MqDto mqDto = new MqDto(mqUtil.getMqGroupDomain().getTopic(), MqTagEnum.EXAM_RECORD_PERSISTED.name(), Collections.singletonMap(SystemConstant.RECORD_ID, recordId),
                 MqTagEnum.EXAM_RECORD_PERSISTED, recordId.toString(), propMap, recordId.toString());
         mqDtoService.assembleSendAsyncDelayMsg(mqDto);
     }

+ 2 - 1
themis-business/src/main/java/com/qmth/themis/business/service/impl/TGErrorServiceImpl.java

@@ -3,6 +3,7 @@ package com.qmth.themis.business.service.impl;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.themis.business.cache.ExamRecordCacheUtil;
+import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dao.TGErrorMapper;
 import com.qmth.themis.business.entity.TGError;
 import com.qmth.themis.business.service.TGErrorService;
@@ -26,7 +27,7 @@ public class TGErrorServiceImpl extends ServiceImpl<TGErrorMapper, TGError> impl
     @Override
     public void saveExamTgError(Object... s) {
         JSONObject jsonObject = new JSONObject();
-        jsonObject.put("recordId", (Long) s[0]);
+        jsonObject.put(SystemConstant.RECORD_ID, (Long) s[0]);
         jsonObject.put("method", s[1]);
         jsonObject.put("examStatus", ExamRecordCacheUtil.getStatus((Long) s[0]));
         TGError tgError = new TGError(jsonObject.toJSONString(), System.currentTimeMillis());

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

@@ -120,7 +120,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
             finalMap.put("waiting", waitingMap);
 
             Map<String, Object> activityMap = new HashMap();
-            activityMap.put("recordId", teExamUnFinishDto.getRecordId());
+            activityMap.put(SystemConstant.RECORD_ID, teExamUnFinishDto.getRecordId());
             activityMap.put("minDurationSeconds", teExamUnFinishDto.getMinDurationSeconds());
             activityMap.put("cameraPhotoUpload", teExamUnFinishDto.getCameraPhotoUpload());
             activityMap.put("courseCode", teExamUnFinishDto.getCourseCode());
@@ -1330,7 +1330,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
                 }
             }
             Map<String, Object> tranMap = mqDtoService.buildMqDelayMsg(level);
-            tranMap.put("recordId", recordId);
+            tranMap.put(SystemConstant.RECORD_ID, recordId);
             //考试断点延时消息 发送mq start
             MqDto mqDtoBreakDelay = new MqDto(mqUtil.getMqGroupDomain().getTopic(),
                     MqTagEnum.EXAM_BREAK_DELAY.name(), MqTagEnum.EXAM_BREAK_DELAY, MqTagEnum.EXAM_BREAK_DELAY,

+ 2 - 1
themis-business/src/main/java/com/qmth/themis/business/util/WebsocketUtil.java

@@ -2,6 +2,7 @@ package com.qmth.themis.business.util;
 
 import com.qmth.themis.business.cache.ExamRecordCacheUtil;
 import com.qmth.themis.business.constant.SpringContextHolder;
+import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.enums.WebsocketStatusEnum;
 import com.qmth.themis.business.service.TOeExamRecordService;
 import org.slf4j.Logger;
@@ -109,7 +110,7 @@ public class WebsocketUtil {
     public static Map<String, Object> initWebsocket(Long recordId, Long userId, String deviceId, String ip, Long updateTime) {
         Map<String, Object> tranMap = new HashMap<>();
         if (Objects.nonNull(recordId)) {
-            tranMap.put("recordId", recordId);
+            tranMap.put(SystemConstant.RECORD_ID, recordId);
         } else if (Objects.nonNull(userId)) {
             tranMap.put("userId", userId);
         }

+ 2 - 9
themis-exam/src/main/java/com/qmth/themis/exam/api/TEExamController.java

@@ -7,7 +7,6 @@ import com.qmth.themis.business.annotation.ApiJsonProperty;
 import com.qmth.themis.business.bean.exam.*;
 import com.qmth.themis.business.cache.ExamBreakCacheUtil;
 import com.qmth.themis.business.cache.ExamRecordCacheUtil;
-import com.qmth.themis.business.cache.bean.ExamStudentCacheBean;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.MqDto;
 import com.qmth.themis.business.dto.cache.TEStudentCacheDto;
@@ -128,10 +127,10 @@ public class TEExamController {
     public Result exit(@ApiJsonObject(name = "saveInvigilateUser", value = {
             @ApiJsonProperty(key = "recordId", type = "long", example = "1", description = "考试记录id", required = true)
     }) @ApiParam(value = "考试记录id", required = true) @RequestBody Map<String, Object> mapParameter) throws NoSuchAlgorithmException, IOException {
-        if (Objects.isNull(mapParameter.get("recordId")) || Objects.equals(mapParameter.get("recordId"), "")) {
+        if (Objects.isNull(mapParameter.get(SystemConstant.RECORD_ID)) || Objects.equals(mapParameter.get(SystemConstant.RECORD_ID), "")) {
             throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
         }
-        String recordId = (String) mapParameter.get("recordId");
+        String recordId = (String) mapParameter.get(SystemConstant.RECORD_ID);
         ExamRecordStatusEnum status = ExamRecordCacheUtil.getStatus(Long.valueOf(recordId));
         if (Objects.nonNull(status) && Objects.equals(ExamRecordStatusEnum.ANSWERING, status)) {//答题状态,强制断点
             ExamConstant.sendExamStopMsg(Long.valueOf(recordId), true, false);
@@ -149,12 +148,6 @@ public class TEExamController {
             WebSocketOeServer webSocketOeServer = webSocketMap.get(clientWebsocketId);
             WebSocketOeServer.close(webSocketOeServer);
         }
-
-        Long examStudentId = ExamRecordCacheUtil.getExamStudentId(Long.parseLong(recordId));
-        ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
-        Optional.ofNullable(examStudentCacheBean).orElseThrow(() -> new BusinessException("考生数据为空"));
-
-        SystemConstant.mobileMonitorStatusStop(examStudentCacheBean.getStudentId(), Long.parseLong(recordId), true);
         return ResultUtil.ok(true);
     }
 

+ 2 - 1
themis-exam/src/main/java/com/qmth/themis/exam/api/TEFaceController.java

@@ -2,6 +2,7 @@ package com.qmth.themis.exam.api;
 
 import com.qmth.themis.business.bean.exam.FaceVerifyBean;
 import com.qmth.themis.business.bean.exam.FaceVerifyParamBean;
+import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.MqDto;
 import com.qmth.themis.business.enums.MqTagEnum;
 import com.qmth.themis.business.service.MqDtoService;
@@ -79,7 +80,7 @@ public class TEFaceController {
                 param.getSimilarity(), param.getRealness(), param.getTime(), param.getException());
         Map<String, Object> transMap = new HashMap<String, Object>();
         transMap.put("id", ret.getId());
-        transMap.put("recordId", param.getRecordId());
+        transMap.put(SystemConstant.RECORD_ID, param.getRecordId());
         transMap.put("type", param.getType());
         transMap.put("photoUrl", param.getPhotoUrl());
         transMap.put("faceCount", param.getFaceCount());

+ 2 - 1
themis-exam/src/main/java/com/qmth/themis/exam/api/TELivenessController.java

@@ -2,6 +2,7 @@ package com.qmth.themis.exam.api;
 
 import com.qmth.themis.business.bean.exam.LivenessVerifyBean;
 import com.qmth.themis.business.bean.exam.LivenessVerifyParamBean;
+import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.MqDto;
 import com.qmth.themis.business.enums.MqTagEnum;
 import com.qmth.themis.business.service.MqDtoService;
@@ -78,7 +79,7 @@ public class TELivenessController {
                 param.getException());
         Map<String, Object> transMap = new HashMap<String, Object>();
         transMap.put("id", ret.getId());
-        transMap.put("recordId", param.getRecordId());
+        transMap.put(SystemConstant.RECORD_ID, param.getRecordId());
         transMap.put("type", param.getType());
         transMap.put("actions", param.getActions());
         transMap.put("retry", param.getRetry());

+ 1 - 1
themis-exam/src/main/java/com/qmth/themis/exam/api/TEMobileController.java

@@ -114,7 +114,7 @@ public class TEMobileController {
 
         TEStudentCacheDto teStudent = (TEStudentCacheDto) ServletUtil.getRequestStudentAccount();
         Map<String, Object> mapParameter = new HashMap<String, Object>();
-        mapParameter.put("recordId", param.getRecordId());
+        mapParameter.put(SystemConstant.RECORD_ID, param.getRecordId());
         mapParameter.put("mainNumber", param.getMainNumber());
         mapParameter.put("subNumber", param.getSubNumber());
         if (param.getSubIndex() != null) {

+ 6 - 6
themis-exam/src/main/java/com/qmth/themis/exam/api/TIeInvigilateCallMobileController.java

@@ -116,10 +116,10 @@ public class TIeInvigilateCallMobileController {
             @ApiJsonProperty(key = "recordId", type = "long", example = "1", description = "考试记录id", required = true),
             @ApiJsonProperty(key = "source", description = "监考视频源", required = true)
     }) @ApiParam(value = "监控信息", required = true) @RequestBody Map<String, Object> mapParameter) {
-        if (Objects.isNull(mapParameter.get("recordId")) || Objects.equals(mapParameter.get("recordId"), "")) {
+        if (Objects.isNull(mapParameter.get(SystemConstant.RECORD_ID)) || Objects.equals(mapParameter.get(SystemConstant.RECORD_ID), "")) {
             throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
         }
-        Long recordId = Long.parseLong(String.valueOf(mapParameter.get("recordId")));
+        Long recordId = Long.parseLong(String.valueOf(mapParameter.get(SystemConstant.RECORD_ID)));
         if (Objects.isNull(mapParameter.get("source")) || Objects.equals(mapParameter.get("source"), "")) {
             throw new BusinessException("来源不能为空!");
         }
@@ -156,10 +156,10 @@ public class TIeInvigilateCallMobileController {
             @ApiJsonProperty(key = "status", description = "当前状态", required = true),
             @ApiJsonProperty(key = "type", description = "异常类型,status=stop时需要传递")
     }) @ApiParam(value = "监控信息", required = true) @RequestBody Map<String, Object> mapParameter) {
-        if (Objects.isNull(mapParameter.get("recordId")) || Objects.equals(mapParameter.get("recordId"), "")) {
+        if (Objects.isNull(mapParameter.get(SystemConstant.RECORD_ID)) || Objects.equals(mapParameter.get(SystemConstant.RECORD_ID), "")) {
             throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
         }
-        Long recordId = Long.parseLong(String.valueOf(mapParameter.get("recordId")));
+        Long recordId = Long.parseLong(String.valueOf(mapParameter.get(SystemConstant.RECORD_ID)));
         if (Objects.isNull(mapParameter.get("source")) || Objects.equals(mapParameter.get("source"), "")) {
             throw new BusinessException("监考视频源不能为空");
         }
@@ -215,10 +215,10 @@ public class TIeInvigilateCallMobileController {
             @ApiJsonProperty(key = "recordId", type = "long", example = "1", description = "考试记录id", required = true),
             @ApiJsonProperty(key = "source", description = "监考视频源", required = true)
     }) @ApiParam(value = "监控信息", required = true) @RequestBody Map<String, Object> mapParameter) {
-        if (Objects.isNull(mapParameter.get("recordId")) || Objects.equals(mapParameter.get("recordId"), "")) {
+        if (Objects.isNull(mapParameter.get(SystemConstant.RECORD_ID)) || Objects.equals(mapParameter.get(SystemConstant.RECORD_ID), "")) {
             throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
         }
-        Long recordId = Long.parseLong(String.valueOf(mapParameter.get("recordId")));
+        Long recordId = Long.parseLong(String.valueOf(mapParameter.get(SystemConstant.RECORD_ID)));
         if (Objects.isNull(mapParameter.get("source")) || Objects.equals(mapParameter.get("source"), "")) {
             throw new BusinessException("来源不能为空!");
         }

+ 6 - 6
themis-exam/src/main/java/com/qmth/themis/exam/api/TIeInvigilateCallOeController.java

@@ -117,10 +117,10 @@ public class TIeInvigilateCallOeController {
             @ApiJsonProperty(key = "status", description = "当前状态", required = true),
             @ApiJsonProperty(key = "type", description = "异常类型,status=stop时需要传递")
     }) @ApiParam(value = "监控信息", required = true) @RequestBody Map<String, Object> mapParameter) {
-        if (Objects.isNull(mapParameter.get("recordId")) || Objects.equals(mapParameter.get("recordId"), "")) {
+        if (Objects.isNull(mapParameter.get(SystemConstant.RECORD_ID)) || Objects.equals(mapParameter.get(SystemConstant.RECORD_ID), "")) {
             throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
         }
-        Long recordId = Long.parseLong(String.valueOf(mapParameter.get("recordId")));
+        Long recordId = Long.parseLong(String.valueOf(mapParameter.get(SystemConstant.RECORD_ID)));
         if (Objects.isNull(mapParameter.get("source")) || Objects.equals(mapParameter.get("source"), "")) {
             throw new BusinessException("监考视频源不能为空");
         }
@@ -162,10 +162,10 @@ public class TIeInvigilateCallOeController {
     public Result callApply(@ApiJsonObject(name = "callApplyOe", value = {
             @ApiJsonProperty(key = "recordId", type = "long", example = "1", description = "考试记录id", required = true),
     }) @ApiParam(value = "监控信息", required = true) @RequestBody Map<String, Object> mapParameter) {
-        if (Objects.isNull(mapParameter.get("recordId")) || Objects.equals(mapParameter.get("recordId"), "")) {
+        if (Objects.isNull(mapParameter.get(SystemConstant.RECORD_ID)) || Objects.equals(mapParameter.get(SystemConstant.RECORD_ID), "")) {
             throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
         }
-        Long recordId = Long.parseLong(String.valueOf(mapParameter.get("recordId")));
+        Long recordId = Long.parseLong(String.valueOf(mapParameter.get(SystemConstant.RECORD_ID)));
         //获取考试记录缓存
         MonitorVideoSourceEnum source = MonitorVideoSourceEnum.CLIENT_CAMERA;
         String liveUrl = SystemConstant.setStreamId(dictionaryConfig.monitorDomain().getPrefix(), recordId, source);
@@ -196,10 +196,10 @@ public class TIeInvigilateCallOeController {
     public Result callCancel(@ApiJsonObject(name = "callCancelOe", value = {
             @ApiJsonProperty(key = "recordId", type = "long", example = "1", description = "考试记录id", required = true),
     }) @ApiParam(value = "监控信息", required = true) @RequestBody Map<String, Object> mapParameter) {
-        if (Objects.isNull(mapParameter.get("recordId")) || Objects.equals(mapParameter.get("recordId"), "")) {
+        if (Objects.isNull(mapParameter.get(SystemConstant.RECORD_ID)) || Objects.equals(mapParameter.get(SystemConstant.RECORD_ID), "")) {
             throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
         }
-        Long recordId = Long.parseLong(String.valueOf(mapParameter.get("recordId")));
+        Long recordId = Long.parseLong(String.valueOf(mapParameter.get(SystemConstant.RECORD_ID)));
         //获取考试记录缓存
         MonitorVideoSourceEnum source = MonitorVideoSourceEnum.CLIENT_CAMERA;
         String liveUrl = SystemConstant.setStreamId(dictionaryConfig.monitorDomain().getPrefix(), recordId, source);

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

@@ -148,7 +148,7 @@ public class WebSocketMobileServer implements Concurrently {
 
                     Gson gson = new Gson();
                     WebsocketDto websocketDto = gson.fromJson(gson.toJson(jsonObject), WebsocketDto.class);
-                    jsonObject.getJSONObject("body").put("recordId", this.recordId);
+                    jsonObject.getJSONObject("body").put(SystemConstant.RECORD_ID, this.recordId);
                     websocketDto.setBody(jsonObject.getJSONObject("body"));
                     //2022.04.13 补发exam_stop消息
                     ExamRecordStatusEnum statusEnum = ExamRecordCacheUtil.getStatus(this.recordId);

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

@@ -122,7 +122,7 @@ public class WebSocketOeServer implements Concurrently {
                     //发送延时mq消息start
                     MqDtoService mqDtoService = SpringContextHolder.getBean(MqDtoService.class);
                     tranMap = mqDtoService.buildMqDelayMsg("2m");
-                    tranMap.put("recordId", this.recordId);
+                    tranMap.put(SystemConstant.RECORD_ID, this.recordId);
                     MqUtil mqUtil = SpringContextHolder.getBean(MqUtil.class);
                     MqDto mqDto = new MqDto(mqUtil.getMqGroupDomain().getTopic(), MqTagEnum.OE_UN_NORMAL.name(), MqTagEnum.OE_UN_NORMAL, MqTagEnum.OE_UN_NORMAL, String.valueOf(this.recordId), this.tranMap, this.websocketSessionId);
                     mqDtoService.assembleSendAsyncDelayMsg(mqDto);
@@ -158,7 +158,7 @@ public class WebSocketOeServer implements Concurrently {
                     WebSocketOeMessageTemplete webSocketOeMessageTemplete = SpringContextHolder.getBean(WebSocketOeMessageTemplete.class);
                     Gson gson = new Gson();
                     WebsocketDto websocketDto = gson.fromJson(gson.toJson(jsonObject), WebsocketDto.class);
-                    jsonObject.getJSONObject("body").put("recordId", this.recordId);
+                    jsonObject.getJSONObject("body").put(SystemConstant.RECORD_ID, this.recordId);
                     websocketDto.setBody(jsonObject.getJSONObject("body"));
                     Method method = webSocketOeMessageTemplete.getClass().getDeclaredMethod(WebsocketTypeEnum.valueOf(websocketDto.getType()).getDesc(), String.class, Long.class);
                     WebsocketDto result = (WebsocketDto) method.invoke(webSocketOeMessageTemplete, String.valueOf(websocketDto.getBody()), websocketDto.getTime());

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

@@ -34,7 +34,7 @@ public class WebSocketMobileMessageTemplete {
     public WebsocketDto syncStatus(String body, Long time) {
         JSONObject jsonObject = JSONObject.parseObject(body);
         log.info("syncStatus jsonObject:{}", jsonObject.toJSONString());
-        if (Objects.isNull(jsonObject.get("recordId")) || Objects.equals(jsonObject.get("recordId"), "")) {
+        if (Objects.isNull(jsonObject.get(SystemConstant.RECORD_ID)) || Objects.equals(jsonObject.get(SystemConstant.RECORD_ID), "")) {
             throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
         }
         return this.syncAck(body, time);

+ 21 - 5
themis-exam/src/main/java/com/qmth/themis/exam/websocketTemplete/WebSocketOeMessageTemplete.java

@@ -4,6 +4,7 @@ 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.MonitorVideoSourceEnum;
 import com.qmth.themis.business.enums.WebsocketTypeEnum;
 import com.qmth.themis.business.service.TOeExamRecordService;
 import com.qmth.themis.common.enums.ExceptionResultEnum;
@@ -14,8 +15,7 @@ import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
-import java.util.Collections;
-import java.util.Objects;
+import java.util.*;
 
 /**
  * @Description: 考生端oe websocket模版
@@ -66,10 +66,10 @@ public class WebSocketOeMessageTemplete {
     public WebsocketDto syncStatus(String body, Long time) {
         JSONObject jsonObject = JSONObject.parseObject(body);
         log.info("syncStatus jsonObject:{}", jsonObject.toJSONString());
-        if (Objects.isNull(jsonObject.get("recordId")) || Objects.equals(jsonObject.get("recordId"), "")) {
+        if (Objects.isNull(jsonObject.get(SystemConstant.RECORD_ID)) || Objects.equals(jsonObject.get(SystemConstant.RECORD_ID), "")) {
             throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
         }
-        Long recordId = Long.parseLong(String.valueOf(jsonObject.get("recordId")));
+        Long recordId = Long.parseLong(String.valueOf(jsonObject.get(SystemConstant.RECORD_ID)));
         if (Objects.isNull(jsonObject.get("progress")) || Objects.equals(jsonObject.get("progress"), "")) {
             throw new BusinessException("答题进度不能为空");
         }
@@ -98,7 +98,23 @@ public class WebSocketOeMessageTemplete {
      * @return
      */
     public WebsocketDto syncAck(String body, Long time) {
-        return new WebsocketDto(WebsocketTypeEnum.convertToName(Thread.currentThread().getStackTrace()[1].getMethodName()), Collections.singletonMap(SystemConstant.ACK_MESSAGE, time));
+        JSONObject jsonObject = JSONObject.parseObject(body);
+        Long recordId = Long.parseLong(String.valueOf(jsonObject.get(SystemConstant.RECORD_ID)));
+        Map<String, Object> map = new LinkedHashMap<>();
+        map.put(SystemConstant.RECORD_ID, recordId);
+        map.put(SystemConstant.ACK_MESSAGE, time);
+        String monitorVideoSource = ExamRecordCacheUtil.getMonitorVideoSource(recordId);
+        List<String> monitorVideoSourceList = null;
+        if (Objects.nonNull(monitorVideoSource) && !Objects.equals(monitorVideoSource.trim().replaceAll(" ", ""), "")) {
+            monitorVideoSourceList = Arrays.asList(monitorVideoSource.trim().toUpperCase().replaceAll(" ", "").split(","));
+        }
+        if (Objects.nonNull(monitorVideoSourceList) && monitorVideoSourceList.size() > 0 && monitorVideoSourceList.contains(MonitorVideoSourceEnum.MOBILE_FIRST.name())) {
+            map.put(MonitorVideoSourceEnum.MOBILE_FIRST.name().toLowerCase(), ExamRecordCacheUtil.getMonitorStatus(recordId, MonitorVideoSourceEnum.MOBILE_FIRST));
+        }
+        if (Objects.nonNull(monitorVideoSourceList) && monitorVideoSourceList.size() > 0 && monitorVideoSourceList.contains(MonitorVideoSourceEnum.MOBILE_SECOND.name())) {
+            map.put(MonitorVideoSourceEnum.MOBILE_SECOND.name().toLowerCase(), ExamRecordCacheUtil.getMonitorStatus(recordId, MonitorVideoSourceEnum.MOBILE_SECOND));
+        }
+        return new WebsocketDto(WebsocketTypeEnum.convertToName(Thread.currentThread().getStackTrace()[1].getMethodName()), map);
     }
 
     /**

+ 6 - 6
themis-mq/src/main/java/com/qmth/themis/mq/service/impl/MqLogicServiceImpl.java

@@ -279,7 +279,7 @@ public class MqLogicServiceImpl implements MqLogicService {
     public void execMqWebsocketUnNormalLogic(MqDto mqDto, String key) throws NoSuchAlgorithmException {
         Gson gson = new Gson();
         Map<String, Object> tranMap = mqDto.getProperties();
-        Long recordId = Long.parseLong(String.valueOf(tranMap.get("recordId")));
+        Long recordId = Long.parseLong(String.valueOf(tranMap.get(SystemConstant.RECORD_ID)));
         ExamRecordStatusEnum status = ExamRecordCacheUtil.getStatus(recordId);
         WebsocketStatusEnum websocketStatusEnum = ExamRecordCacheUtil.getClientWebsocketStatus(recordId);
         Long examStudentId = ExamRecordCacheUtil.getExamStudentId(recordId);
@@ -328,7 +328,7 @@ public class MqLogicServiceImpl implements MqLogicService {
     public void execMqTencentVideoLogic(MqDto mqDto, String key) throws NoSuchAlgorithmException, IOException {
         Gson gson = new Gson();
         Map<String, Object> tranMap = mqDto.getProperties();
-        Long recordId = Long.parseLong(String.valueOf(tranMap.get("recordId")));
+        Long recordId = Long.parseLong(String.valueOf(tranMap.get(SystemConstant.RECORD_ID)));
         TOeExamRecord tOeExamRecord = tOeExamRecordService.getById(recordId);
         List<String> monitorRecordList = Arrays.asList(tOeExamRecord.getMonitorRecord().trim().toUpperCase().split(","));
         String[] streamIds = new String[monitorRecordList.size()];
@@ -421,7 +421,7 @@ public class MqLogicServiceImpl implements MqLogicService {
         Gson gson = new Gson();
         Map<String, Object> param = (Map<String, Object>) mqDto.getBody();
         Long id = (Long) param.get("id");
-        Long recordId = (Long) param.get("recordId");
+        Long recordId = (Long) param.get(SystemConstant.RECORD_ID);
         String type = (String) param.get("type");
         String photoUrl = (String) param.get("photoUrl");
         Integer faceCount = (Integer) param.get("faceCount");
@@ -578,7 +578,7 @@ public class MqLogicServiceImpl implements MqLogicService {
         Gson gson = new Gson();
         Map<String, Object> param = (Map<String, Object>) mqDto.getBody();
         Long id = (Long) param.get("id");
-        Long recordId = (Long) param.get("recordId");
+        Long recordId = (Long) param.get(SystemConstant.RECORD_ID);
         String type = (String) param.get("type");
         String actions = (String) param.get("actions");
         Integer retry = (Integer) param.get("retry");
@@ -716,7 +716,7 @@ public class MqLogicServiceImpl implements MqLogicService {
     public void execMqRecordPersistedLogic(MqDto mqDto, String key) {
         Gson gson = new Gson();
         Map<String, Object> param = (Map<String, Object>) mqDto.getBody();
-        Long recordId = (Long) param.get("recordId");
+        Long recordId = (Long) param.get(SystemConstant.RECORD_ID);
         commonService.persisted(recordId);
         mqDto.setAck(SystemConstant.STANDARD_ACK_TYPE);
         TMRocketMessage tmRocketMessage = gson.fromJson(gson.toJson(mqDto), TMRocketMessage.class);
@@ -994,7 +994,7 @@ public class MqLogicServiceImpl implements MqLogicService {
     public void execMqExamBreakDelayLogic(MqDto mqDto, String key) {
         Gson gson = new Gson();
         Map<String, Object> tranMap = mqDto.getProperties();
-        Long recordId = Long.parseLong(String.valueOf(tranMap.get("recordId")));
+        Long recordId = Long.parseLong(String.valueOf(tranMap.get(SystemConstant.RECORD_ID)));
         ExamRecordStatusEnum statusEnum = ExamRecordCacheUtil.getStatus(recordId);
         if (Objects.nonNull(statusEnum) && !Objects.equals(statusEnum, ExamRecordStatusEnum.FINISHED) && !Objects
                 .equals(statusEnum, ExamRecordStatusEnum.PERSISTED) && !Objects