|
@@ -2,6 +2,7 @@ package com.qmth.themis.exam.api;
|
|
|
|
|
|
import com.qmth.themis.business.annotation.ApiJsonObject;
|
|
import com.qmth.themis.business.annotation.ApiJsonObject;
|
|
import com.qmth.themis.business.annotation.ApiJsonProperty;
|
|
import com.qmth.themis.business.annotation.ApiJsonProperty;
|
|
|
|
+import com.qmth.themis.business.cache.ExamRecordCacheUtil;
|
|
import com.qmth.themis.business.cache.RedisKeyHelper;
|
|
import com.qmth.themis.business.cache.RedisKeyHelper;
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
import com.qmth.themis.business.dto.MqDto;
|
|
import com.qmth.themis.business.dto.MqDto;
|
|
@@ -74,7 +75,8 @@ public class TIeInvigilateCallMobileController {
|
|
throw new BusinessException("观看地址不能为空");
|
|
throw new BusinessException("观看地址不能为空");
|
|
}
|
|
}
|
|
String liveUrl = String.valueOf(mapParameter.get("liveUrl"));
|
|
String liveUrl = String.valueOf(mapParameter.get("liveUrl"));
|
|
- TIeExamInvigilateCallLog tIeExamInvigilateCallLog = new TIeExamInvigilateCallLog(recordId, source, liveUrl, MonitorStatusSourceEnum.INIT);
|
|
|
|
|
|
+ String monitorKey = ExamRecordCacheUtil.getMonitorKey(recordId);
|
|
|
|
+ TIeExamInvigilateCallLog tIeExamInvigilateCallLog = new TIeExamInvigilateCallLog(recordId, source, liveUrl, MonitorStatusSourceEnum.INIT, monitorKey);
|
|
//获取考试记录缓存
|
|
//获取考试记录缓存
|
|
Map<String, Object> objectMap = redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(recordId));
|
|
Map<String, Object> objectMap = redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(recordId));
|
|
objectMap.put(SystemConstant.MONITOR_LIVE_URL_ + source.name(), liveUrl);
|
|
objectMap.put(SystemConstant.MONITOR_LIVE_URL_ + source.name(), liveUrl);
|
|
@@ -122,8 +124,16 @@ public class TIeInvigilateCallMobileController {
|
|
source = MonitorVideoSourceEnum.MOBILE_SECOND;
|
|
source = MonitorVideoSourceEnum.MOBILE_SECOND;
|
|
liveUrl = String.valueOf(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.MOBILE_SECOND.name()));
|
|
liveUrl = String.valueOf(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.MOBILE_SECOND.name()));
|
|
}
|
|
}
|
|
- objectMap.put(SystemConstant.MONITOR_STATUS_ + source.name(), MonitorStatusSourceEnum.START);
|
|
|
|
- TIeExamInvigilateCallLog tIeExamInvigilateCallLog = new TIeExamInvigilateCallLog(recordId, source, liveUrl, MonitorStatusSourceEnum.START);
|
|
|
|
|
|
+ if (Objects.isNull(objectMap.get(SystemConstant.MONITOR_STATUS_ + source.name()))) {
|
|
|
|
+ throw new BusinessException("推流状态为空");
|
|
|
|
+ }
|
|
|
|
+ MonitorStatusSourceEnum status = MonitorStatusSourceEnum.valueOf(String.valueOf(objectMap.get(SystemConstant.MONITOR_STATUS_ + source.name())));
|
|
|
|
+ if (!Objects.equals(status, MonitorStatusSourceEnum.START)) {
|
|
|
|
+ throw new BusinessException("推流状态不正常");
|
|
|
|
+ }
|
|
|
|
+ objectMap.put(SystemConstant.MONITOR_CALL_STATUS_ + source.name(), MonitorCallStatusSourceEnum.START);
|
|
|
|
+ String monitorKey = ExamRecordCacheUtil.getMonitorKey(recordId);
|
|
|
|
+ TIeExamInvigilateCallLog tIeExamInvigilateCallLog = new TIeExamInvigilateCallLog(recordId, source, liveUrl, status, monitorKey, MonitorCallStatusSourceEnum.START);
|
|
redisUtil.setForHash(RedisKeyHelper.examRecordCacheKey(recordId), objectMap);
|
|
redisUtil.setForHash(RedisKeyHelper.examRecordCacheKey(recordId), objectMap);
|
|
|
|
|
|
//监考监控通话信息 发送mq start
|
|
//监考监控通话信息 发送mq start
|
|
@@ -164,8 +174,14 @@ public class TIeInvigilateCallMobileController {
|
|
if (Objects.nonNull(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + source.name()))) {
|
|
if (Objects.nonNull(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + source.name()))) {
|
|
liveUrl = String.valueOf(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + source.name()));
|
|
liveUrl = String.valueOf(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + source.name()));
|
|
}
|
|
}
|
|
|
|
+ MonitorCallStatusSourceEnum callStatus = null;
|
|
|
|
+ if (Objects.nonNull(objectMap.get(SystemConstant.MONITOR_CALL_STATUS_ + source.name()))) {
|
|
|
|
+ callStatus = MonitorCallStatusSourceEnum.valueOf(String.valueOf(objectMap.get(SystemConstant.MONITOR_CALL_STATUS_ + source.name())));
|
|
|
|
+ }
|
|
objectMap.put(SystemConstant.MONITOR_STATUS_ + source.name(), status);
|
|
objectMap.put(SystemConstant.MONITOR_STATUS_ + source.name(), status);
|
|
- TIeExamInvigilateCallLog tIeExamInvigilateCallLog = new TIeExamInvigilateCallLog(recordId, source, liveUrl, MonitorStatusSourceEnum.START);
|
|
|
|
|
|
+ objectMap.put(SystemConstant.MONITOR_CALL_STATUS_ + source.name(), callStatus);
|
|
|
|
+ String monitorKey = ExamRecordCacheUtil.getMonitorKey(recordId);
|
|
|
|
+ TIeExamInvigilateCallLog tIeExamInvigilateCallLog = new TIeExamInvigilateCallLog(recordId, source, liveUrl, MonitorStatusSourceEnum.START, monitorKey, callStatus);
|
|
if (Objects.nonNull(mapParameter.get("type")) && !Objects.equals(mapParameter.get("type"), "")) {
|
|
if (Objects.nonNull(mapParameter.get("type")) && !Objects.equals(mapParameter.get("type"), "")) {
|
|
tIeExamInvigilateCallLog.setType(ExceptionEnum.valueOf(String.valueOf(mapParameter.get("type"))));
|
|
tIeExamInvigilateCallLog.setType(ExceptionEnum.valueOf(String.valueOf(mapParameter.get("type"))));
|
|
}
|
|
}
|
|
@@ -220,8 +236,13 @@ public class TIeInvigilateCallMobileController {
|
|
source = MonitorVideoSourceEnum.MOBILE_SECOND;
|
|
source = MonitorVideoSourceEnum.MOBILE_SECOND;
|
|
liveUrl = String.valueOf(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.MOBILE_SECOND.name()));
|
|
liveUrl = String.valueOf(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.MOBILE_SECOND.name()));
|
|
}
|
|
}
|
|
- objectMap.put(SystemConstant.MONITOR_STATUS_ + source.name(), MonitorStatusSourceEnum.STOP);
|
|
|
|
- TIeExamInvigilateCallLog tIeExamInvigilateCallLog = new TIeExamInvigilateCallLog(recordId, source, liveUrl, MonitorStatusSourceEnum.STOP);
|
|
|
|
|
|
+ if (Objects.isNull(objectMap.get(SystemConstant.MONITOR_STATUS_ + source.name()))) {
|
|
|
|
+ throw new BusinessException("推流状态为空");
|
|
|
|
+ }
|
|
|
|
+ objectMap.put(SystemConstant.MONITOR_CALL_STATUS_ + source.name(), MonitorCallStatusSourceEnum.STOP);
|
|
|
|
+ String monitorKey = ExamRecordCacheUtil.getMonitorKey(recordId);
|
|
|
|
+ MonitorStatusSourceEnum status = MonitorStatusSourceEnum.valueOf(String.valueOf(objectMap.get(SystemConstant.MONITOR_STATUS_ + source.name())));
|
|
|
|
+ TIeExamInvigilateCallLog tIeExamInvigilateCallLog = new TIeExamInvigilateCallLog(recordId, source, liveUrl, status, monitorKey, MonitorCallStatusSourceEnum.STOP);
|
|
redisUtil.setForHash(RedisKeyHelper.examRecordCacheKey(recordId), objectMap);
|
|
redisUtil.setForHash(RedisKeyHelper.examRecordCacheKey(recordId), objectMap);
|
|
//监考监控通话信息 发送mq start
|
|
//监考监控通话信息 发送mq start
|
|
MqDto mqDto = new MqDto(MqTopicEnum.themisTopic.getCode(), MqTagEnum.MONITOR_LOG.name(), tIeExamInvigilateCallLog, MqTagEnum.MONITOR_LOG, String.valueOf(tIeExamInvigilateCallLog.getId()), source.name());
|
|
MqDto mqDto = new MqDto(MqTopicEnum.themisTopic.getCode(), MqTagEnum.MONITOR_LOG.name(), tIeExamInvigilateCallLog, MqTagEnum.MONITOR_LOG, String.valueOf(tIeExamInvigilateCallLog.getId()), source.name());
|