Selaa lähdekoodia

监考端接口

wangliang 4 vuotta sitten
vanhempi
commit
14b719fc1b

+ 60 - 8
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeInvigilateController.java

@@ -3,6 +3,8 @@ package com.qmth.themis.backend.api;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 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.ApiJsonProperty;
 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.constant.SystemConstant;
 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.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.RedisUtil;
 import com.qmth.themis.business.util.ServletUtil;
@@ -64,6 +61,15 @@ public class TIeInvigilateController {
     @Resource
     TEExamStudentService teExamStudentService;
 
+    @Resource
+    TIeInvigilateWarnInfoService tIeInvigilateWarnInfoService;
+
+    @Resource
+    TIeInvigilateExceptionInfoService tIeInvigilateExceptionInfoService;
+
+    @Resource
+    TEExamStudentLogService teExamStudentLogService;
+
     @ApiOperation(value = "实时监控台列表接口")
     @RequestMapping(value = "/list", method = RequestMethod.POST)
     @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 examActivityId = Long.parseLong(String.valueOf(objectMap.get("examActivityId")));
         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);
         String identity = examStudentCacheBean.getIdentity();
         String examStudentName = examStudentCacheBean.getName();
         String courseNameCode = examStudentCacheBean.getCourseName() + "(" + examStudentCacheBean.getCourseCode() + ")";
         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);
     }
 

+ 234 - 1
themis-business/src/main/java/com/qmth/themis/business/bean/backend/InvigilateListDetailBean.java

@@ -1,10 +1,16 @@
 package com.qmth.themis.business.bean.backend;
 
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.qmth.themis.business.enums.ExamRecordStatusEnum;
+import com.qmth.themis.business.enums.ExceptionEnum;
+import com.qmth.themis.business.enums.VerifyExceptionEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
 
 /**
  * @Description: 实时监控台明细
@@ -55,11 +61,23 @@ public class InvigilateListDetailBean implements Serializable {
     @ApiModelProperty(name = "异常处理")
     private Integer exceptionCount;
 
+    @ApiModelProperty(name = "是否违纪,0:是,1:不是")
+    private Integer breachStatus;
+
+    @ApiModelProperty(name = "预警信息")
+    private List<InvigilateWarnInfoBean> warningInfos;
+
+    @ApiModelProperty(name = "预警信息")
+    private List<InvigilateExceptionInfoBean> exceptionInfos;
+
+    @ApiModelProperty(name = "预警信息")
+    private List<StudentLogBean> studentLogs;
+
     public InvigilateListDetailBean() {
 
     }
 
-    public InvigilateListDetailBean(Long examId, Long examActivityId, Long examStudentId, Long examRecordId, String identity, String examStudentName, String courseNameCode, ExamRecordStatusEnum statusCode, String roomCode) {
+    public InvigilateListDetailBean(Long examId, Long examActivityId, Long examStudentId, Long examRecordId, String identity, String examStudentName, String courseNameCode, ExamRecordStatusEnum statusCode, String roomCode, Integer breachStatus) {
         this.examId = examId;
         this.examActivityId = examActivityId;
         this.examStudentId = examStudentId;
@@ -69,6 +87,39 @@ public class InvigilateListDetailBean implements Serializable {
         this.courseNameCode = courseNameCode;
         this.statusCode = statusCode;
         this.roomCode = roomCode;
+        this.breachStatus = breachStatus;
+    }
+
+    public List<StudentLogBean> getStudentLogs() {
+        return studentLogs;
+    }
+
+    public void setStudentLogs(List<StudentLogBean> studentLogs) {
+        this.studentLogs = studentLogs;
+    }
+
+    public List<InvigilateWarnInfoBean> getWarningInfos() {
+        return warningInfos;
+    }
+
+    public void setWarningInfos(List<InvigilateWarnInfoBean> warningInfos) {
+        this.warningInfos = warningInfos;
+    }
+
+    public List<InvigilateExceptionInfoBean> getExceptionInfos() {
+        return exceptionInfos;
+    }
+
+    public void setExceptionInfos(List<InvigilateExceptionInfoBean> exceptionInfos) {
+        this.exceptionInfos = exceptionInfos;
+    }
+
+    public Integer getBreachStatus() {
+        return breachStatus;
+    }
+
+    public void setBreachStatus(Integer breachStatus) {
+        this.breachStatus = breachStatus;
     }
 
     public Integer getWarningCount() {
@@ -177,4 +228,186 @@ public class InvigilateListDetailBean implements Serializable {
     public void setStatusCode(ExamRecordStatusEnum statusCode) {
         this.statusCode = statusCode;
     }
+
+    /**
+    * @Description: 预警bean
+    * @Param:
+    * @return:
+    * @Author: wangliang
+    * @Date: 2020/8/24
+    */
+    public class InvigilateWarnInfoBean implements Serializable{
+
+        @ApiModelProperty(value = "预警信息")
+        private String info;
+
+        @ApiModelProperty(value = "预警级别")
+        private String level;
+
+        @ApiModelProperty(value = "类别")
+        private VerifyExceptionEnum type;
+
+        @ApiModelProperty(value = "备注")
+        private String remark;
+
+        @ApiModelProperty(value = "审阅状态,0:未阅,1:已阅")
+        private Integer approveStatus;
+
+        @ApiModelProperty(value = "创建时间")
+        private Date createTime;
+
+        public String getInfo() {
+            return info;
+        }
+
+        public void setInfo(String info) {
+            this.info = info;
+        }
+
+        public String getLevel() {
+            return level;
+        }
+
+        public void setLevel(String level) {
+            this.level = level;
+        }
+
+        public VerifyExceptionEnum getType() {
+            return type;
+        }
+
+        public void setType(VerifyExceptionEnum type) {
+            this.type = type;
+        }
+
+        public String getRemark() {
+            return remark;
+        }
+
+        public void setRemark(String remark) {
+            this.remark = remark;
+        }
+
+        public Integer getApproveStatus() {
+            return approveStatus;
+        }
+
+        public void setApproveStatus(Integer approveStatus) {
+            this.approveStatus = approveStatus;
+        }
+
+        public Date getCreateTime() {
+            return createTime;
+        }
+
+        public void setCreateTime(Date createTime) {
+            this.createTime = createTime;
+        }
+    }
+
+    /**
+    * @Description: 异常bean
+    * @Param:
+    * @return:
+    * @Author: wangliang
+    * @Date: 2020/8/24
+    */
+    public class InvigilateExceptionInfoBean implements Serializable {
+        @ApiModelProperty(value = "异常信息")
+        private String info;
+
+        @ApiModelProperty(value = "类别")
+        private ExceptionEnum type;
+
+        @ApiModelProperty(value = "备注")
+        private String remark;
+
+        @ApiModelProperty(value = "创建时间")
+        private Date createTime;
+
+        public String getInfo() {
+            return info;
+        }
+
+        public void setInfo(String info) {
+            this.info = info;
+        }
+
+        public ExceptionEnum getType() {
+            return type;
+        }
+
+        public void setType(ExceptionEnum type) {
+            this.type = type;
+        }
+
+        public String getRemark() {
+            return remark;
+        }
+
+        public void setRemark(String remark) {
+            this.remark = remark;
+        }
+
+        public Date getCreateTime() {
+            return createTime;
+        }
+
+        public void setCreateTime(Date createTime) {
+            this.createTime = createTime;
+        }
+    }
+
+    /**
+     * @Description: 异常bean
+     * @Param:
+     * @return:
+     * @Author: wangliang
+     * @Date: 2020/8/24
+     */
+    public class StudentLogBean implements Serializable {
+        @ApiModelProperty(value = "信息")
+        private String info;
+
+        @ApiModelProperty(value = "类别")
+        private ExceptionEnum type;
+
+        @ApiModelProperty(value = "备注")
+        private String remark;
+
+        @ApiModelProperty(value = "创建时间")
+        private Date createTime;
+
+        public String getInfo() {
+            return info;
+        }
+
+        public void setInfo(String info) {
+            this.info = info;
+        }
+
+        public ExceptionEnum getType() {
+            return type;
+        }
+
+        public void setType(ExceptionEnum type) {
+            this.type = type;
+        }
+
+        public String getRemark() {
+            return remark;
+        }
+
+        public void setRemark(String remark) {
+            this.remark = remark;
+        }
+
+        public Date getCreateTime() {
+            return createTime;
+        }
+
+        public void setCreateTime(Date createTime) {
+            this.createTime = createTime;
+        }
+    }
 }

+ 11 - 1
themis-business/src/main/java/com/qmth/themis/business/dto/WarningDto.java

@@ -17,16 +17,26 @@ public class WarningDto implements Serializable {
     private Integer faceCount;//人脸数量,0:没有人脸,大于1:多张人脸
     private Double realness;//真实性结果,-1:没有,0:异常,1:正常
     private Long recordId;//考试记录id
+    private String photoUrl;//照片url
 
     public WarningDto() {
 
     }
 
-    public WarningDto(VerifyExceptionEnum warningEnum, Integer faceCount, Double realness, Long recordId) {
+    public WarningDto(VerifyExceptionEnum warningEnum, Integer faceCount, Double realness, Long recordId, String photoUrl) {
         this.warningEnum = warningEnum;
         this.faceCount = faceCount;
         this.realness = realness;
         this.recordId = recordId;
+        this.photoUrl = photoUrl;
+    }
+
+    public String getPhotoUrl() {
+        return photoUrl;
+    }
+
+    public void setPhotoUrl(String photoUrl) {
+        this.photoUrl = photoUrl;
     }
 
     public VerifyExceptionEnum getWarningEnum() {

+ 10 - 10
themis-business/src/main/java/com/qmth/themis/business/entity/TEExamStudentLog.java

@@ -43,8 +43,8 @@ public class TEExamStudentLog implements Serializable {
     private String type;
 
     @ApiModelProperty(value = "描述")
-    @TableField(value = "description")
-    private String description;
+    @TableField(value = "info")
+    private String info;
 
     @ApiModelProperty(value = "备注")
     @TableField(value = "remark")
@@ -58,18 +58,18 @@ public class TEExamStudentLog implements Serializable {
 
     }
 
-    public TEExamStudentLog(String type, String description, String remark, Long studentId) {
+    public TEExamStudentLog(String type, String info, String remark, Long studentId) {
         this.id = Constants.idGen.next();
         this.type = type;
-        this.description = description;
+        this.info = info;
         this.remark = remark;
         this.studentId = studentId;
     }
 
-    public TEExamStudentLog(String type, String description, String remark, Long studentId, Long examStudentId, Long examRecordId) {
+    public TEExamStudentLog(String type, String info, String remark, Long studentId, Long examStudentId, Long examRecordId) {
         this.id = Constants.idGen.next();
         this.type = type;
-        this.description = description;
+        this.info = info;
         this.remark = remark;
         this.studentId = studentId;
         this.examStudentId = examStudentId;
@@ -112,12 +112,12 @@ public class TEExamStudentLog implements Serializable {
         this.type = type;
     }
 
-    public String getDescription() {
-        return description;
+    public String getInfo() {
+        return info;
     }
 
-    public void setDescription(String description) {
-        this.description = description;
+    public void setInfo(String info) {
+        this.info = info;
     }
 
     public String getRemark() {

+ 8 - 8
themis-business/src/main/java/com/qmth/themis/business/entity/TEUserLog.java

@@ -35,8 +35,8 @@ public class TEUserLog implements Serializable {
     private String type;
 
     @ApiModelProperty(value = "描述")
-    @TableField(value = "description")
-    private String description;
+    @TableField(value = "info")
+    private String info;
 
     @ApiModelProperty(value = "备注")
     @TableField(value = "remark")
@@ -50,10 +50,10 @@ public class TEUserLog implements Serializable {
 
     }
 
-    public TEUserLog(String type, String description, String remark, Long userId) {
+    public TEUserLog(String type, String info, String remark, Long userId) {
         this.id = Constants.idGen.next();
         this.type = type;
-        this.description = description;
+        this.info = info;
         this.remark = remark;
         this.userId = userId;
     }
@@ -86,12 +86,12 @@ public class TEUserLog implements Serializable {
         this.type = type;
     }
 
-    public String getDescription() {
-        return description;
+    public String getInfo() {
+        return info;
     }
 
-    public void setDescription(String description) {
-        this.description = description;
+    public void setInfo(String info) {
+        this.info = info;
     }
 
     public String getRemark() {

+ 13 - 0
themis-business/src/main/java/com/qmth/themis/business/entity/TIeInvigilateWarnInfo.java

@@ -87,6 +87,19 @@ public class TIeInvigilateWarnInfo implements Serializable {
         this.approveStatus = 0;
     }
 
+    public TIeInvigilateWarnInfo(Long examId, Long examActivityId, Long examRecordId, Long examStudentId, String level, String info, VerifyExceptionEnum type, String remark) {
+        this.id = Constants.idGen.next();
+        this.examId = examId;
+        this.examActivityId = examActivityId;
+        this.examRecordId = examRecordId;
+        this.examStudentId = examStudentId;
+        this.level = level;
+        this.info = info;
+        this.type = type;
+        this.approveStatus = 0;
+        this.remark = remark;
+    }
+
     public static long getSerialVersionUID() {
         return serialVersionUID;
     }

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

@@ -46,10 +46,9 @@ public class TBSessionServiceImpl extends ServiceImpl<TBSessionMapper, TBSession
                 tbSessionDb.setDeviceId(tbSession.getDeviceId());
                 tbSessionDb.setAccessToken(tbSession.getAccessToken());
                 tbSessionDb.setLastAccessIp(tbSession.getLastAccessIp());
+                tbSessionDb.setLastAccessTime(tbSession.getLastAccessTime());
                 tbSessionDb.setExpireTime(tbSession.getExpireTime());
                 this.saveOrUpdate(tbSessionDb);
-            } else {
-                log.info("mq时间小于db时间,不予更新");
             }
         }
         return true;

+ 6 - 4
themis-business/src/main/java/com/qmth/themis/business/service/impl/WarningServiceImpl.java

@@ -56,6 +56,7 @@ public class WarningServiceImpl implements WarningService {
         Long recordId = warningDto.getRecordId();
         Integer faceCount = warningDto.getFaceCount();
         VerifyExceptionEnum warningEnum = warningDto.getWarningEnum();
+        String photoUrl = warningDto.getPhotoUrl();
         TEConfig teConfig = teConfigService.getGlobalConfig();
         Map<String, Object> objectMap = redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(recordId));
         Long examId = Long.parseLong(String.valueOf(objectMap.get("examId")));
@@ -65,14 +66,14 @@ public class WarningServiceImpl implements WarningService {
             Integer count = faceVerifyHistoryService.faceCountError(recordId, warningDto.getWarningEnum().name(), faceCount, true);
             count = Objects.isNull(count) ? 0 : count;
             if (count >= teConfig.getMultipleFaceCountError()) {
-                TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, warningEnum.getLevel().get(1), WarningLevelEnum.valueOf(warningEnum.getLevel().get(1)).getDesc(), warningEnum);
+                TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, warningEnum.getLevel().get(1), WarningLevelEnum.valueOf(warningEnum.getLevel().get(1)).getDesc(), warningEnum, photoUrl);
                 tIeInvigilateWarnInfoService.saveOrUpdate(tIeInvigilateWarnInfo);
             }
         } else if (faceCount <= 0) {//未检测到人脸
             Integer count = faceVerifyHistoryService.faceCountError(recordId, warningDto.getWarningEnum().name(), faceCount, false);
             count = Objects.isNull(count) ? 0 : count;
             if (count >= teConfig.getNoFaceCountError()) {
-                TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, warningEnum.getLevel().get(0), WarningLevelEnum.valueOf(warningEnum.getLevel().get(0)).getDesc(), warningEnum);
+                TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, warningEnum.getLevel().get(0), WarningLevelEnum.valueOf(warningEnum.getLevel().get(0)).getDesc(), warningEnum, photoUrl);
                 tIeInvigilateWarnInfoService.saveOrUpdate(tIeInvigilateWarnInfo);
             }
         }
@@ -88,6 +89,7 @@ public class WarningServiceImpl implements WarningService {
     public void faceCompareError(WarningDto warningDto) {
         Long recordId = warningDto.getRecordId();
         VerifyExceptionEnum warningEnum = warningDto.getWarningEnum();
+        String photoUrl = warningDto.getPhotoUrl();
         TEConfig teConfig = teConfigService.getGlobalConfig();
         Map<String, Object> objectMap = redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(recordId));
         Long examId = Long.parseLong(String.valueOf(objectMap.get("examId")));
@@ -96,11 +98,11 @@ public class WarningServiceImpl implements WarningService {
         Integer count = faceVerifyHistoryService.faceCompareError(recordId, warningDto.getWarningEnum().name());
         count = Objects.isNull(count) ? 0 : count;
         if (count >= teConfig.getMatchFaceCompareErrorCount()) {
-            TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, warningEnum.getLevel().get(0), WarningLevelEnum.valueOf(warningEnum.getLevel().get(0)).getDesc(), warningEnum);
+            TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, warningEnum.getLevel().get(0), WarningLevelEnum.valueOf(warningEnum.getLevel().get(0)).getDesc(), warningEnum, photoUrl);
             tIeInvigilateWarnInfoService.saveOrUpdate(tIeInvigilateWarnInfo);
         }
         if (count >= teConfig.getTotalFaceCompareErrorCount()) {
-            TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, warningEnum.getLevel().get(1), WarningLevelEnum.valueOf(warningEnum.getLevel().get(1)).getDesc(), warningEnum);
+            TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, warningEnum.getLevel().get(1), WarningLevelEnum.valueOf(warningEnum.getLevel().get(1)).getDesc(), warningEnum, photoUrl);
             tIeInvigilateWarnInfoService.saveOrUpdate(tIeInvigilateWarnInfo);
         }
     }

+ 4 - 2
themis-business/src/main/resources/db/init.sql

@@ -476,6 +476,7 @@ INSERT INTO `t_b_privilege` VALUES (102, '移动端监控观看地址更新', '/
 INSERT INTO `t_b_privilege` VALUES (103, '移动端监控状态更新', '/api/mobile/monitor/status', 'LINK', 60, 29, NULL, '2020-08-01 12:08:31');
 INSERT INTO `t_b_privilege` VALUES (104, '移动端发送通话申请', '/api/mobile/monitor/call/apply', 'LINK', 60, 30, NULL, '2020-08-01 12:08:31');
 INSERT INTO `t_b_privilege` VALUES (105, '移动端撤销通话申请', '/api/mobile/monitor/call/cancel', 'LINK', 60, 31, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (106, '实时监控台列表明细', '/api/admin/invigilate/list/detail', 'LINK', 60, 32, NULL, '2020-08-01 12:08:31');
 COMMIT;
 
 -- ----------------------------
@@ -614,6 +615,7 @@ INSERT INTO `t_b_role_privilege` VALUES (95, 'STUDENT', 102);
 INSERT INTO `t_b_role_privilege` VALUES (96, 'STUDENT', 103);
 INSERT INTO `t_b_role_privilege` VALUES (97, 'STUDENT', 104);
 INSERT INTO `t_b_role_privilege` VALUES (98, 'STUDENT', 105);
+INSERT INTO `t_b_role_privilege` VALUES (99, 'INVIGILATE', 106);
 COMMIT;
 
 -- ----------------------------
@@ -1028,7 +1030,7 @@ CREATE TABLE `t_e_exam_student_log` (
   `exam_record_id` bigint DEFAULT NULL COMMENT '考试记录ID',
   `exam_student_id` bigint DEFAULT NULL COMMENT '考生id',
   `type` varchar(30) DEFAULT NULL COMMENT '类型',
-  `description` varchar(1000) DEFAULT NULL COMMENT '描述',
+  `info` varchar(1000) DEFAULT NULL COMMENT '描述',
   `remark` mediumtext COMMENT '备注',
   `create_time` datetime DEFAULT NULL COMMENT '创建时间',
   PRIMARY KEY (`id`)
@@ -1094,7 +1096,7 @@ CREATE TABLE `t_e_user_log` (
   `id` bigint NOT NULL COMMENT '主键',
   `user_id` bigint NOT NULL COMMENT '用户id',
   `type` varchar(30) NOT NULL COMMENT '类型',
-  `description` varchar(1000) DEFAULT NULL COMMENT '描述',
+  `info` varchar(1000) DEFAULT NULL COMMENT '描述',
   `remark` mediumtext COMMENT '备注',
   `create_time` datetime DEFAULT NULL COMMENT '创建时间',
   PRIMARY KEY (`id`)

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

@@ -288,7 +288,7 @@ public class MqLogicServiceImpl implements MqLogicService {
         String exception = (String) param.get("exception");
         faceVerifyHistoryService.save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception);
         VerifyExceptionEnum warningEnum = VerifyExceptionEnum.valueOf(exception);
-        WarningDto warningDto = new WarningDto(warningEnum, faceCount, realness, recordId);
+        WarningDto warningDto = new WarningDto(warningEnum, faceCount, realness, recordId, photoUrl);
         if (Objects.equals(VerifyExceptionEnum.FACE_COUNT_ERROR, warningEnum)) {//人脸数量异常
             warningService.faceCountError(warningDto);
         } else if (Objects.equals(VerifyExceptionEnum.FACE_COMPARE_ERROR, warningEnum)) {//人脸比对异常
@@ -326,11 +326,11 @@ public class MqLogicServiceImpl implements MqLogicService {
         String exception = (String) param.get("exception");
         livenessVerifyHistoryService.save(id, recordId, type, actions, retry, startTime, finishTime, exception);
         VerifyExceptionEnum warningEnum = VerifyExceptionEnum.valueOf(exception);
+        JSONObject jsonObject = JSONObject.parseObject(actions);
         if (Objects.equals(VerifyExceptionEnum.FACE_COUNT_ERROR, warningEnum)) {//人脸数量异常
-            JSONObject jsonObject = JSONObject.parseObject(actions);
-            warningService.faceCountError(new WarningDto(warningEnum, Integer.parseInt(String.valueOf(jsonObject.get("faceCount"))), null, recordId));
+            warningService.faceCountError(new WarningDto(warningEnum, Integer.parseInt(String.valueOf(jsonObject.get("faceCount"))), null, recordId, String.valueOf(jsonObject.get("photoUrl"))));
         } else if (Objects.equals(VerifyExceptionEnum.FACE_COMPARE_ERROR, warningEnum)) {//人脸比对异常
-            warningService.faceCompareError(new WarningDto(warningEnum, null, null, recordId));
+            warningService.faceCompareError(new WarningDto(warningEnum, null, null, recordId, String.valueOf(jsonObject.get("photoUrl"))));
         }
         mqDto.setAck(SystemConstant.STANDARD_ACK_TYPE);
         TMRocketMessage tmRocketMessage = gson.fromJson(gson.toJson(mqDto), TMRocketMessage.class);