|
@@ -9,7 +9,6 @@ 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.bean.mobile.MobileAuthorizationMonitorBean;
|
|
import com.qmth.themis.business.bean.mobile.MobileAuthorizationMonitorBean;
|
|
import com.qmth.themis.business.cache.ExamRecordCacheUtil;
|
|
import com.qmth.themis.business.cache.ExamRecordCacheUtil;
|
|
-import com.qmth.themis.business.cache.bean.ExamCacheBean;
|
|
|
|
import com.qmth.themis.business.cache.bean.ExamStudentCacheBean;
|
|
import com.qmth.themis.business.cache.bean.ExamStudentCacheBean;
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
import com.qmth.themis.business.dto.AuthDto;
|
|
import com.qmth.themis.business.dto.AuthDto;
|
|
@@ -20,7 +19,6 @@ import com.qmth.themis.business.enums.*;
|
|
import com.qmth.themis.business.service.*;
|
|
import com.qmth.themis.business.service.*;
|
|
import com.qmth.themis.business.util.*;
|
|
import com.qmth.themis.business.util.*;
|
|
import com.qmth.themis.common.enums.ExceptionResultEnum;
|
|
import com.qmth.themis.common.enums.ExceptionResultEnum;
|
|
-import com.qmth.themis.common.enums.Platform;
|
|
|
|
import com.qmth.themis.common.enums.Source;
|
|
import com.qmth.themis.common.enums.Source;
|
|
import com.qmth.themis.common.exception.BusinessException;
|
|
import com.qmth.themis.common.exception.BusinessException;
|
|
import com.qmth.themis.common.util.Result;
|
|
import com.qmth.themis.common.util.Result;
|
|
@@ -34,10 +32,7 @@ import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import java.io.File;
|
|
import java.io.File;
|
|
import java.security.NoSuchAlgorithmException;
|
|
import java.security.NoSuchAlgorithmException;
|
|
-import java.util.Collections;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.Map;
|
|
|
|
-import java.util.Objects;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description: mobile监考监控通话信息 前端控制器
|
|
* @Description: mobile监考监控通话信息 前端控制器
|
|
@@ -254,58 +249,31 @@ public class TIeInvigilateCallMobileController {
|
|
*/
|
|
*/
|
|
private String getSourceUserId(Long recordId) throws NoSuchAlgorithmException {
|
|
private String getSourceUserId(Long recordId) throws NoSuchAlgorithmException {
|
|
String sourceUserId = null;
|
|
String sourceUserId = null;
|
|
- Long examId = ExamRecordCacheUtil.getExamId(recordId);
|
|
|
|
|
|
+ //Long examId = ExamRecordCacheUtil.getExamId(recordId);
|
|
Long examStudentId = ExamRecordCacheUtil.getExamStudentId(recordId);
|
|
Long examStudentId = ExamRecordCacheUtil.getExamStudentId(recordId);
|
|
- if (Objects.isNull(examId)) {
|
|
|
|
|
|
+ if (Objects.isNull(examStudentId)) {
|
|
TOeExamRecord tOeExamRecord = tOeExamRecordService.getById(recordId);
|
|
TOeExamRecord tOeExamRecord = tOeExamRecordService.getById(recordId);
|
|
- examId = tOeExamRecord.getExamId();
|
|
|
|
- examStudentId = ExamRecordCacheUtil.getExamStudentId(recordId);
|
|
|
|
|
|
+ //examId = tOeExamRecord.getExamId();
|
|
|
|
+ if (tOeExamRecord == null) {
|
|
|
|
+ throw new BusinessException(ExceptionResultEnum.NOT_FOUND_EXAM_RECORD);
|
|
|
|
+ }
|
|
|
|
+ examStudentId = tOeExamRecord.getExamStudentId();
|
|
}
|
|
}
|
|
- ExamCacheBean ec = teExamService.getExamCacheBean(examId);//考试缓存
|
|
|
|
|
|
+ //ExamCacheBean ec = teExamService.getExamCacheBean(examId);//考试缓存
|
|
ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
|
|
ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
|
|
- if (Objects.nonNull(ec.getMonitorAudioEnable())) {
|
|
|
|
- if (ec.getMonitorAudioEnable()) {
|
|
|
|
- for (Source s : Source.values()) {
|
|
|
|
- String sessionId = SessionUtil.digest(examStudentCacheBean.getIdentity(),
|
|
|
|
- Math.abs(Sets.newHashSet(RoleEnum.STUDENT.name()).toString().hashCode()), s.name());
|
|
|
|
- TBSession tbSessionClient = (TBSession) redisUtil.getUserSession(sessionId);
|
|
|
|
- if (Objects.nonNull(tbSessionClient) && tbSessionClient.getExpireTime() > System.currentTimeMillis()
|
|
|
|
- && (Objects.equals(tbSessionClient.getSource(), Source.OE_CLIENT.name()) || Objects
|
|
|
|
- .equals(tbSessionClient.getSource(), Source.ADMIN_CLIENT.name())) && (
|
|
|
|
- Objects.equals(tbSessionClient.getPlatform(), Platform.WIN.name()) || Objects
|
|
|
|
- .equals(tbSessionClient.getPlatform(), Platform.MAC.name()))) {
|
|
|
|
- if (Objects.nonNull(
|
|
|
|
- ExamRecordCacheUtil.getMonitorStatus(recordId, MonitorVideoSourceEnum.CLIENT_CAMERA))) {
|
|
|
|
- sourceUserId = "s_" + tbSessionClient.getId();
|
|
|
|
- break;
|
|
|
|
- } else if (Objects.nonNull(
|
|
|
|
- ExamRecordCacheUtil.getMonitorStatus(recordId, MonitorVideoSourceEnum.CLIENT_SCREEN))) {
|
|
|
|
- sourceUserId = "s_" + tbSessionClient.getId();
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- for (Source s : Source.values()) {
|
|
|
|
- String sessionId = SessionUtil.digest(examStudentCacheBean.getIdentity(),
|
|
|
|
- Math.abs(Sets.newHashSet(RoleEnum.STUDENT.name()).toString().hashCode()), s.name());
|
|
|
|
- TBSession tbSessionPhone = (TBSession) redisUtil.getUserSession(sessionId);
|
|
|
|
- if (Objects.nonNull(tbSessionPhone) && tbSessionPhone.getExpireTime() > System.currentTimeMillis()
|
|
|
|
- && (Objects.equals(tbSessionPhone.getSource(), Source.MOBILE_MONITOR_FIRST.name())
|
|
|
|
- || Objects.equals(tbSessionPhone.getSource(), Source.MOBILE_MONITOR_SECOND.name())) && (
|
|
|
|
- Objects.equals(tbSessionPhone.getPlatform(), Platform.ANDROID.name()) || Objects
|
|
|
|
- .equals(tbSessionPhone.getPlatform(), Platform.IOS.name()))) {
|
|
|
|
- if (Objects.nonNull(
|
|
|
|
- ExamRecordCacheUtil.getMonitorStatus(recordId, MonitorVideoSourceEnum.MOBILE_FIRST))) {
|
|
|
|
- sourceUserId = "s_" + tbSessionPhone.getId();
|
|
|
|
- break;
|
|
|
|
- } else if (Objects.nonNull(
|
|
|
|
- ExamRecordCacheUtil.getMonitorStatus(recordId, MonitorVideoSourceEnum.MOBILE_SECOND))) {
|
|
|
|
- sourceUserId = "s_" + tbSessionPhone.getId();
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ //只针对客户端摄像头/屏幕、移动端主机位开启监考通话
|
|
|
|
+ List<MonitorVideoSourceEnum> sourceList = Arrays
|
|
|
|
+ .asList(MonitorVideoSourceEnum.CLIENT_CAMERA, MonitorVideoSourceEnum.CLIENT_SCREEN,
|
|
|
|
+ MonitorVideoSourceEnum.MOBILE_FIRST);
|
|
|
|
+ for (MonitorVideoSourceEnum source : sourceList) {
|
|
|
|
+ Source sessionSource = source.getSessionSource();
|
|
|
|
+ String sessionId = SessionUtil.digest(examStudentCacheBean.getStudentId(),
|
|
|
|
+ Math.abs(Sets.newHashSet(RoleEnum.STUDENT.name()).toString().hashCode()), sessionSource.name());
|
|
|
|
+ TBSession tbSession = (TBSession) redisUtil.getUserSession(sessionId);
|
|
|
|
+ if (Objects.nonNull(tbSession) && tbSession.getExpireTime() > System.currentTimeMillis() && Objects
|
|
|
|
+ .nonNull(ExamRecordCacheUtil.getMonitorStatus(recordId, source))) {
|
|
|
|
+ sourceUserId = "s_" + tbSession.getId();
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return sourceUserId;
|
|
return sourceUserId;
|