|
@@ -3,6 +3,8 @@ package com.qmth.themis.backend.api;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
+import com.google.common.reflect.TypeToken;
|
|
|
|
+import com.google.gson.Gson;
|
|
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.base.BasePage;
|
|
import com.qmth.themis.business.base.BasePage;
|
|
@@ -13,14 +15,9 @@ import com.qmth.themis.business.cache.RedisKeyHelper;
|
|
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.MqDto;
|
|
import com.qmth.themis.business.dto.MqDto;
|
|
-import com.qmth.themis.business.entity.TBUser;
|
|
|
|
-import com.qmth.themis.business.entity.TEExamBreachLog;
|
|
|
|
-import com.qmth.themis.business.entity.TOeExamRecord;
|
|
|
|
|
|
+import com.qmth.themis.business.entity.*;
|
|
import com.qmth.themis.business.enums.*;
|
|
import com.qmth.themis.business.enums.*;
|
|
-import com.qmth.themis.business.service.MqDtoService;
|
|
|
|
-import com.qmth.themis.business.service.TEExamBreachLogService;
|
|
|
|
-import com.qmth.themis.business.service.TEExamStudentService;
|
|
|
|
-import com.qmth.themis.business.service.TOeExamRecordService;
|
|
|
|
|
|
+import com.qmth.themis.business.service.*;
|
|
import com.qmth.themis.business.util.JacksonUtil;
|
|
import com.qmth.themis.business.util.JacksonUtil;
|
|
import com.qmth.themis.business.util.RedisUtil;
|
|
import com.qmth.themis.business.util.RedisUtil;
|
|
import com.qmth.themis.business.util.ServletUtil;
|
|
import com.qmth.themis.business.util.ServletUtil;
|
|
@@ -64,6 +61,15 @@ public class TIeInvigilateController {
|
|
@Resource
|
|
@Resource
|
|
TEExamStudentService teExamStudentService;
|
|
TEExamStudentService teExamStudentService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ TIeInvigilateWarnInfoService tIeInvigilateWarnInfoService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ TIeInvigilateExceptionInfoService tIeInvigilateExceptionInfoService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ TEExamStudentLogService teExamStudentLogService;
|
|
|
|
+
|
|
@ApiOperation(value = "实时监控台列表接口")
|
|
@ApiOperation(value = "实时监控台列表接口")
|
|
@RequestMapping(value = "/list", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/list", method = RequestMethod.POST)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "监考监控信息", response = InvigilateListBean.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "监考监控信息", response = InvigilateListBean.class)})
|
|
@@ -129,14 +135,60 @@ public class TIeInvigilateController {
|
|
Long examStudentId = Long.parseLong(String.valueOf(objectMap.get("examStudentId")));
|
|
Long examStudentId = Long.parseLong(String.valueOf(objectMap.get("examStudentId")));
|
|
Long examActivityId = Long.parseLong(String.valueOf(objectMap.get("examActivityId")));
|
|
Long examActivityId = Long.parseLong(String.valueOf(objectMap.get("examActivityId")));
|
|
ExamRecordStatusEnum status = (ExamRecordStatusEnum) objectMap.get("status");
|
|
ExamRecordStatusEnum status = (ExamRecordStatusEnum) objectMap.get("status");
|
|
|
|
+ Integer breachStatus = Objects.isNull(objectMap.get("breachStatus")) ? null : Integer.parseInt(String.valueOf(objectMap.get("breachStatus")));
|
|
ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
|
|
ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
|
|
String identity = examStudentCacheBean.getIdentity();
|
|
String identity = examStudentCacheBean.getIdentity();
|
|
String examStudentName = examStudentCacheBean.getName();
|
|
String examStudentName = examStudentCacheBean.getName();
|
|
String courseNameCode = examStudentCacheBean.getCourseName() + "(" + examStudentCacheBean.getCourseCode() + ")";
|
|
String courseNameCode = examStudentCacheBean.getCourseName() + "(" + examStudentCacheBean.getCourseCode() + ")";
|
|
String roomCode = examStudentCacheBean.getRoomCode();
|
|
String roomCode = examStudentCacheBean.getRoomCode();
|
|
- InvigilateListDetailBean invigilateListDetailBean = new InvigilateListDetailBean(examId, examActivityId, examStudentId, examRecordId, identity, examStudentName, courseNameCode, status, roomCode);
|
|
|
|
|
|
+ Long studentId = examStudentCacheBean.getStudentId();
|
|
|
|
+ InvigilateListDetailBean invigilateListDetailBean = new InvigilateListDetailBean(examId, examActivityId, examStudentId, examRecordId, identity, examStudentName, courseNameCode, status, roomCode, breachStatus);
|
|
|
|
|
|
//预警、异常、人脸
|
|
//预警、异常、人脸
|
|
|
|
+ //预警
|
|
|
|
+ QueryWrapper<TIeInvigilateWarnInfo> tIeInvigilateWarnInfoQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ tIeInvigilateWarnInfoQueryWrapper.lambda().eq(TIeInvigilateWarnInfo::getExamRecordId, examRecordId);
|
|
|
|
+ List<TIeInvigilateWarnInfo> tIeInvigilateWarnInfoList = tIeInvigilateWarnInfoService.list(tIeInvigilateWarnInfoQueryWrapper);
|
|
|
|
+ Integer warningCount = 0;
|
|
|
|
+ if (Objects.nonNull(tIeInvigilateWarnInfoList) && tIeInvigilateWarnInfoList.size() > 0) {
|
|
|
|
+ warningCount = tIeInvigilateWarnInfoList.size();
|
|
|
|
+ }
|
|
|
|
+ invigilateListDetailBean.setWarningCount(warningCount);
|
|
|
|
+
|
|
|
|
+ Gson gson = new Gson();
|
|
|
|
+ List<InvigilateListDetailBean.InvigilateWarnInfoBean> invigilateWarnInfoBeanList = gson.fromJson(gson.toJson(tIeInvigilateWarnInfoList), new TypeToken<List<InvigilateListDetailBean.InvigilateWarnInfoBean>>() {
|
|
|
|
+ }.getType());
|
|
|
|
+ invigilateListDetailBean.setWarningInfos(invigilateWarnInfoBeanList);
|
|
|
|
+
|
|
|
|
+ //异常
|
|
|
|
+ QueryWrapper<TIeInvigilateExceptionInfo> tIeInvigilateExceptionInfoQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ tIeInvigilateExceptionInfoQueryWrapper.lambda().eq(TIeInvigilateExceptionInfo::getExamRecordId, examRecordId);
|
|
|
|
+ List<TIeInvigilateExceptionInfo> tIeInvigilateExceptionInfoList = tIeInvigilateExceptionInfoService.list(tIeInvigilateExceptionInfoQueryWrapper);
|
|
|
|
+ Integer exceptionCount = 0;
|
|
|
|
+ if (Objects.nonNull(tIeInvigilateExceptionInfoList) && tIeInvigilateExceptionInfoList.size() > 0) {
|
|
|
|
+ exceptionCount = tIeInvigilateExceptionInfoList.size();
|
|
|
|
+ }
|
|
|
|
+ invigilateListDetailBean.setExceptionCount(exceptionCount);
|
|
|
|
+
|
|
|
|
+ List<InvigilateListDetailBean.InvigilateExceptionInfoBean> invigilateExceptionInfoBeanList = gson.fromJson(gson.toJson(tIeInvigilateExceptionInfoList), new TypeToken<List<InvigilateListDetailBean.InvigilateExceptionInfoBean>>() {
|
|
|
|
+ }.getType());
|
|
|
|
+ invigilateListDetailBean.setExceptionInfos(invigilateExceptionInfoBeanList);
|
|
|
|
+
|
|
|
|
+ //陌生人脸
|
|
|
|
+ tIeInvigilateWarnInfoQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ tIeInvigilateWarnInfoQueryWrapper.lambda().eq(TIeInvigilateWarnInfo::getExamRecordId, examRecordId)
|
|
|
|
+ .eq(TIeInvigilateWarnInfo::getType, VerifyExceptionEnum.FACE_COUNT_ERROR)
|
|
|
|
+ .eq(TIeInvigilateWarnInfo::getLevel, WarningLevelEnum.D8.name());
|
|
|
|
+ int multipleFaceCount = tIeInvigilateWarnInfoService.count(tIeInvigilateWarnInfoQueryWrapper);
|
|
|
|
+ invigilateListDetailBean.setMultipleFaceCount(multipleFaceCount);
|
|
|
|
+
|
|
|
|
+ //考生轨迹
|
|
|
|
+ QueryWrapper<TEExamStudentLog> teExamStudentLogQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ teExamStudentLogQueryWrapper.lambda().and(Wrapper -> Wrapper.eq(TEExamStudentLog::getExamRecordId, examRecordId).or().eq(TEExamStudentLog::getStudentId, studentId)).orderByAsc(TEExamStudentLog::getCreateTime);
|
|
|
|
+ List<TEExamStudentLog> teExamStudentLogList = teExamStudentLogService.list(teExamStudentLogQueryWrapper);
|
|
|
|
+ List<InvigilateListDetailBean.StudentLogBean> studentLogBeanList = gson.fromJson(gson.toJson(teExamStudentLogList), new TypeToken<List<InvigilateListDetailBean.StudentLogBean>>() {
|
|
|
|
+ }.getType());
|
|
|
|
+ invigilateListDetailBean.setStudentLogs(studentLogBeanList);
|
|
return ResultUtil.ok(invigilateListDetailBean);
|
|
return ResultUtil.ok(invigilateListDetailBean);
|
|
}
|
|
}
|
|
|
|
|