Răsfoiți Sursa

监考端接口

wangliang 4 ani în urmă
părinte
comite
9604de3fb0

+ 57 - 7
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeInvigilateController.java

@@ -8,10 +8,7 @@ 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;
-import com.qmth.themis.business.bean.backend.InvigilateListBean;
-import com.qmth.themis.business.bean.backend.InvigilateListDetailBean;
-import com.qmth.themis.business.bean.backend.InvigilateListPatrolBean;
-import com.qmth.themis.business.bean.backend.InvigilateListVideoBean;
+import com.qmth.themis.business.bean.backend.*;
 import com.qmth.themis.business.cache.RedisKeyHelper;
 import com.qmth.themis.business.cache.bean.ExamStudentCacheBean;
 import com.qmth.themis.business.constant.SystemConstant;
@@ -232,14 +229,17 @@ public class TIeInvigilateController {
 
     @ApiOperation(value = "在线巡考列表接口")
     @RequestMapping(value = "/patrol/list", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "监考监控信息", response = InvigilateListVideoBean.class)})
+    @ApiResponses({@ApiResponse(code = 200, message = "监考监控信息", response = InvigilateListPatrolBean.class)})
     public Result patrolList(@ApiParam(value = "考试批次id") @RequestParam Long examId,
                              @ApiParam(value = "考试场次id", required = false) @RequestParam(required = false) Long examActivityId,
                              @ApiParam(value = "虚拟考场代码", required = true) @RequestParam Set<String> roomCodes,
-                             @ApiParam(value = "试题下载状态", required = false) @RequestParam(required = false) Integer paperDownload,
                              @ApiParam(value = "考生状态", required = false) @RequestParam(required = false) String status,
                              @ApiParam(value = "姓名", required = false) @RequestParam(required = false) String name,
                              @ApiParam(value = "证件号", required = false) @RequestParam(required = false) String identity,
+                             @ApiParam(value = "陌生人脸min", required = false) @RequestParam(required = false) Integer minMultipleFaceCount,
+                             @ApiParam(value = "陌生人脸max", required = false) @RequestParam(required = false) Integer maxMultipleFaceCount,
+                             @ApiParam(value = "异常处理min", required = false) @RequestParam(required = false) Integer minExceptionCount,
+                             @ApiParam(value = "异常处理max", required = false) @RequestParam(required = false) Integer maxExceptionCount,
                              @ApiParam(value = "预警量min", required = false) @RequestParam(required = false) Integer minWarningCount,
                              @ApiParam(value = "预警量max", required = false) @RequestParam(required = false) Integer maxWarningCount,
                              @ApiParam(value = "客户端网络通信状态", required = false) @RequestParam(required = false) String clientWebsocketStatus,
@@ -252,13 +252,63 @@ public class TIeInvigilateController {
         if (Objects.isNull(roomCodes) || Objects.equals(roomCodes, "")) {
             throw new BusinessException(ExceptionResultEnum.ROOMCODE_IS_NULL);
         }
-        IPage<InvigilateListPatrolBean> invigilateListPatrolBeanIPage = tOeExamRecordService.invigilatePagePatrolList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCodes, paperDownload, status, name, identity, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource);
+        IPage<InvigilateListPatrolBean> invigilateListPatrolBeanIPage = tOeExamRecordService.invigilatePagePatrolList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCodes, status, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource);
         BasePage basePage = new BasePage(invigilateListPatrolBeanIPage.getRecords(), invigilateListPatrolBeanIPage.getCurrent(), invigilateListPatrolBeanIPage.getSize(), invigilateListPatrolBeanIPage.getTotal());
         Map map = new HashMap<>();
         map.put(SystemConstant.RECORDS, basePage);
         return ResultUtil.ok(map);
     }
 
+    @ApiOperation(value = "预警提醒接口")
+    @RequestMapping(value = "/warn/notify", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "{\"count\":1}", response = Result.class)})
+    public Result warnNotify(@ApiParam(value = "考试批次id") @RequestParam Long examId,
+                             @ApiParam(value = "考试场次id", required = false) @RequestParam(required = false) Long examActivityId,
+                             @ApiParam(value = "虚拟考场代码", required = true) @RequestParam Set<String> roomCodes) {
+        if (Objects.isNull(examId) || Objects.equals(examId, "")) {
+            throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
+        }
+        if (Objects.isNull(roomCodes) || Objects.equals(roomCodes, "")) {
+            throw new BusinessException(ExceptionResultEnum.ROOMCODE_IS_NULL);
+        }
+        Integer count = tIeInvigilateWarnInfoService.warningCount(examId, examActivityId, roomCodes);
+        Map map = new HashMap<>();
+        map.put(SystemConstant.COUNT, count);
+        return ResultUtil.ok(map);
+    }
+
+    @ApiOperation(value = "预警提醒列表接口")
+    @RequestMapping(value = "/warn/list", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "监考预警信息", response = InvigilateListWarningBean.class)})
+    public Result warnList(@ApiParam(value = "考试批次id") @RequestParam Long examId,
+                           @ApiParam(value = "考试场次id", required = false) @RequestParam(required = false) Long examActivityId,
+                           @ApiParam(value = "虚拟考场代码", required = true) @RequestParam Set<String> roomCodes,
+                           @ApiParam(value = "审阅状态", required = false) @RequestParam(required = false) Integer approveStatus,
+                           @ApiParam(value = "姓名", required = false) @RequestParam(required = false) String name,
+                           @ApiParam(value = "证件号", required = false) @RequestParam(required = false) String identity,
+                           @ApiParam(value = "陌生人脸min", required = false) @RequestParam(required = false) Integer minMultipleFaceCount,
+                           @ApiParam(value = "陌生人脸max", required = false) @RequestParam(required = false) Integer maxMultipleFaceCount,
+                           @ApiParam(value = "异常处理min", required = false) @RequestParam(required = false) Integer minExceptionCount,
+                           @ApiParam(value = "异常处理max", required = false) @RequestParam(required = false) Integer maxExceptionCount,
+                           @ApiParam(value = "预警量min", required = false) @RequestParam(required = false) Integer minWarningCount,
+                           @ApiParam(value = "预警量max", required = false) @RequestParam(required = false) Integer maxWarningCount,
+                           @ApiParam(value = "客户端网络通信状态", required = false) @RequestParam(required = false) String clientWebsocketStatus,
+                           @ApiParam(value = "监控设备通信状态", required = false) @RequestParam(required = false) String monitorStatusSource,
+                           @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
+                           @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+        if (Objects.isNull(examId) || Objects.equals(examId, "")) {
+            throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
+        }
+        if (Objects.isNull(roomCodes) || Objects.equals(roomCodes, "")) {
+            throw new BusinessException(ExceptionResultEnum.ROOMCODE_IS_NULL);
+        }
+        IPage<InvigilateListWarningBean> invigilateListWarningBeanIPage = tOeExamRecordService.invigilatePageWarningList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCodes, approveStatus, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource);
+        BasePage basePage = new BasePage(invigilateListWarningBeanIPage.getRecords(), invigilateListWarningBeanIPage.getCurrent(), invigilateListWarningBeanIPage.getSize(), invigilateListWarningBeanIPage.getTotal());
+        Map map = new HashMap<>();
+        map.put(SystemConstant.RECORDS, basePage);
+        return ResultUtil.ok(map);
+    }
+
     @ApiOperation(value = "违纪处理接口")
     @RequestMapping(value = "/breach", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})

+ 231 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/backend/InvigilateListWarningBean.java

@@ -0,0 +1,231 @@
+package com.qmth.themis.business.bean.backend;
+
+import com.qmth.themis.business.enums.ExamRecordStatusEnum;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Description: 预警提醒返回对象
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/8/22
+ */
+@ApiModel("预警提醒返回对象")
+public class InvigilateListWarningBean implements Serializable {
+
+    @ApiModelProperty(name = "考试id")
+    private Long examId;
+
+    @ApiModelProperty(name = "场次id")
+    private Long examActivityId;
+
+    @ApiModelProperty(name = "考生id")
+    private Long examStudentId;
+
+    @ApiModelProperty(name = "考试记录id")
+    private Long examRecordId;
+
+    @ApiModelProperty(name = "考试批次")
+    private String examName;
+
+    @ApiModelProperty(name = "考试场次")
+    private String examActivityCode;
+
+    @ApiModelProperty(name = "证件号")
+    private String identity;
+
+    @ApiModelProperty(name = "虚拟考场代码")
+    private String roomCode;
+
+    @ApiModelProperty(name = "姓名")
+    private String name;
+
+    @ApiModelProperty(name = "考生状态")
+    private String status;
+
+    @ApiModelProperty(name = "考生状态值")
+    private ExamRecordStatusEnum statusCode;
+
+    @ApiModelProperty(name = "预警量")
+    private Integer warningCount;
+
+    @ApiModelProperty(name = "陌生人脸")
+    private Integer multipleFaceCount;
+
+    @ApiModelProperty(name = "异常处理")
+    private Integer exceptionCount;
+
+    @ApiModelProperty(name = "是否违纪")
+    private Integer breachStatus;
+
+    @ApiModelProperty(name = "更新时间")
+    private Date updateTime;
+
+    @ApiModelProperty(name = "科目名称")
+    private String courseName;
+
+    @ApiModelProperty(name = "科目编码")
+    private String courseCode;
+
+    @ApiModelProperty(value = "审阅状态,0:未阅,1:已阅")
+    private Integer approveStatus;
+
+    public String getExamName() {
+        return examName;
+    }
+
+    public void setExamName(String examName) {
+        this.examName = examName;
+    }
+
+    public String getExamActivityCode() {
+        return examActivityCode;
+    }
+
+    public void setExamActivityCode(String examActivityCode) {
+        this.examActivityCode = examActivityCode;
+    }
+
+    public String getCourseName() {
+        return courseName;
+    }
+
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
+
+    public String getCourseCode() {
+        return courseCode;
+    }
+
+    public void setCourseCode(String courseCode) {
+        this.courseCode = courseCode;
+    }
+
+    public Integer getApproveStatus() {
+        return approveStatus;
+    }
+
+    public void setApproveStatus(Integer approveStatus) {
+        this.approveStatus = approveStatus;
+    }
+
+    public Integer getMultipleFaceCount() {
+        return multipleFaceCount;
+    }
+
+    public void setMultipleFaceCount(Integer multipleFaceCount) {
+        this.multipleFaceCount = multipleFaceCount;
+    }
+
+    public Integer getExceptionCount() {
+        return exceptionCount;
+    }
+
+    public void setExceptionCount(Integer exceptionCount) {
+        this.exceptionCount = exceptionCount;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Long getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
+
+    public Long getExamActivityId() {
+        return examActivityId;
+    }
+
+    public void setExamActivityId(Long examActivityId) {
+        this.examActivityId = examActivityId;
+    }
+
+    public Long getExamStudentId() {
+        return examStudentId;
+    }
+
+    public void setExamStudentId(Long examStudentId) {
+        this.examStudentId = examStudentId;
+    }
+
+    public Long getExamRecordId() {
+        return examRecordId;
+    }
+
+    public void setExamRecordId(Long examRecordId) {
+        this.examRecordId = examRecordId;
+    }
+
+    public String getIdentity() {
+        return identity;
+    }
+
+    public void setIdentity(String identity) {
+        this.identity = identity;
+    }
+
+    public String getRoomCode() {
+        return roomCode;
+    }
+
+    public void setRoomCode(String roomCode) {
+        this.roomCode = roomCode;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getStatus() {
+        if (statusCode != null) {
+            return statusCode.getCode();
+        }
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public ExamRecordStatusEnum getStatusCode() {
+        return statusCode;
+    }
+
+    public void setStatusCode(ExamRecordStatusEnum statusCode) {
+        this.statusCode = statusCode;
+    }
+
+    public Integer getWarningCount() {
+        return warningCount;
+    }
+
+    public void setWarningCount(Integer warningCount) {
+        this.warningCount = warningCount;
+    }
+
+    public Integer getBreachStatus() {
+        return breachStatus;
+    }
+
+    public void setBreachStatus(Integer breachStatus) {
+        this.breachStatus = breachStatus;
+    }
+}

+ 14 - 0
themis-business/src/main/java/com/qmth/themis/business/dao/TIeInvigilateWarnInfoMapper.java

@@ -3,6 +3,9 @@ package com.qmth.themis.business.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.qmth.themis.business.entity.TIeInvigilateWarnInfo;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Set;
 
 /**
  * @Description: 监考预警信息 Mapper 接口
@@ -14,4 +17,15 @@ import org.apache.ibatis.annotations.Mapper;
 @Mapper
 public interface TIeInvigilateWarnInfoMapper extends BaseMapper<TIeInvigilateWarnInfo> {
 
+    /**
+     * 预警提醒
+     *
+     * @param examId
+     * @param examActivityId
+     * @param roomCodes
+     * @return
+     */
+    public Integer warningCount(@Param("examId") Long examId,
+                                @Param("examActivityId") Long examActivityId,
+                                @Param("roomCodes") Set<String> roomCodes);
 }

+ 44 - 2
themis-business/src/main/java/com/qmth/themis/business/dao/TOeExamRecordMapper.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.qmth.themis.business.bean.backend.InvigilateListBean;
 import com.qmth.themis.business.bean.backend.InvigilateListPatrolBean;
 import com.qmth.themis.business.bean.backend.InvigilateListVideoBean;
+import com.qmth.themis.business.bean.backend.InvigilateListWarningBean;
 import com.qmth.themis.business.dto.response.TEExamUnFinishDto;
 import com.qmth.themis.business.entity.TOeExamRecord;
 import org.apache.ibatis.annotations.Mapper;
@@ -107,10 +108,13 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param examId
      * @param examActivityId
      * @param roomCodes
-     * @param paperDownload
      * @param status
      * @param name
      * @param identity
+     * @param minMultipleFaceCount
+     * @param maxMultipleFaceCount
+     * @param minExceptionCount
+     * @param maxExceptionCount
      * @param minWarningCount
      * @param maxWarningCount
      * @param clientWebsocketStatus
@@ -120,12 +124,50 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
     public IPage<InvigilateListPatrolBean> invigilatePagePatrolList(IPage<Map> iPage, @Param("examId") Long examId,
                                                                     @Param("examActivityId") Long examActivityId,
                                                                     @Param("roomCodes") Set<String> roomCodes,
-                                                                    @Param("paperDownload") Integer paperDownload,
                                                                     @Param("status") String status,
                                                                     @Param("name") String name,
                                                                     @Param("identity") String identity,
+                                                                    @Param("minMultipleFaceCount") Integer minMultipleFaceCount,
+                                                                    @Param("maxMultipleFaceCount") Integer maxMultipleFaceCount,
+                                                                    @Param("minExceptionCount") Integer minExceptionCount,
+                                                                    @Param("maxExceptionCount") Integer maxExceptionCount,
                                                                     @Param("minWarningCount") Integer minWarningCount,
                                                                     @Param("maxWarningCount") Integer maxWarningCount,
                                                                     @Param("clientWebsocketStatus") String clientWebsocketStatus,
                                                                     @Param("monitorStatusSource") String monitorStatusSource);
+
+    /**
+     * 预警提醒列表
+     *
+     * @param iPage
+     * @param examId
+     * @param examActivityId
+     * @param roomCodes
+     * @param approveStatus
+     * @param name
+     * @param identity
+     * @param minMultipleFaceCount
+     * @param maxMultipleFaceCount
+     * @param minExceptionCount
+     * @param maxExceptionCount
+     * @param minWarningCount
+     * @param maxWarningCount
+     * @param clientWebsocketStatus
+     * @param monitorStatusSource
+     * @return
+     */
+    public IPage<InvigilateListWarningBean> invigilatePageWarningList(IPage<Map> iPage, @Param("examId") Long examId,
+                                                                           @Param("examActivityId") Long examActivityId,
+                                                                           @Param("roomCodes") Set<String> roomCodes,
+                                                                           @Param("approveStatus") Integer approveStatus,
+                                                                           @Param("name") String name,
+                                                                           @Param("identity") String identity,
+                                                                           @Param("minMultipleFaceCount") Integer minMultipleFaceCount,
+                                                                           @Param("maxMultipleFaceCount") Integer maxMultipleFaceCount,
+                                                                           @Param("minExceptionCount") Integer minExceptionCount,
+                                                                           @Param("maxExceptionCount") Integer maxExceptionCount,
+                                                                           @Param("minWarningCount") Integer minWarningCount,
+                                                                           @Param("maxWarningCount") Integer maxWarningCount,
+                                                                           @Param("clientWebsocketStatus") String clientWebsocketStatus,
+                                                                           @Param("monitorStatusSource") String monitorStatusSource);
 }

+ 14 - 0
themis-business/src/main/java/com/qmth/themis/business/service/TIeInvigilateWarnInfoService.java

@@ -2,6 +2,9 @@ package com.qmth.themis.business.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.themis.business.entity.TIeInvigilateWarnInfo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Set;
 
 /**
  * @Description: 监考预警信息 服务类
@@ -12,4 +15,15 @@ import com.qmth.themis.business.entity.TIeInvigilateWarnInfo;
  */
 public interface TIeInvigilateWarnInfoService extends IService<TIeInvigilateWarnInfo> {
 
+    /**
+     * 预警提醒
+     *
+     * @param examId
+     * @param examActivityId
+     * @param roomCodes
+     * @return
+     */
+    public Integer warningCount(Long examId,
+                                Long examActivityId,
+                                Set<String> roomCodes);
 }

+ 44 - 2
themis-business/src/main/java/com/qmth/themis/business/service/TOeExamRecordService.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.themis.business.bean.backend.InvigilateListBean;
 import com.qmth.themis.business.bean.backend.InvigilateListPatrolBean;
 import com.qmth.themis.business.bean.backend.InvigilateListVideoBean;
+import com.qmth.themis.business.bean.backend.InvigilateListWarningBean;
 import com.qmth.themis.business.entity.TOeExamRecord;
 import com.qmth.themis.business.enums.ExamTypeEnum;
 import com.qmth.themis.business.enums.LivenessTypeEnum;
@@ -161,10 +162,13 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      * @param examId
      * @param examActivityId
      * @param roomCodes
-     * @param paperDownload
      * @param status
      * @param name
      * @param identity
+     * @param minMultipleFaceCount
+     * @param maxMultipleFaceCount
+     * @param minExceptionCount
+     * @param maxExceptionCount
      * @param minWarningCount
      * @param maxWarningCount
      * @param clientWebsocketStatus
@@ -174,12 +178,50 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
     public IPage<InvigilateListPatrolBean> invigilatePagePatrolList(IPage<Map> iPage, Long examId,
                                                                     Long examActivityId,
                                                                     Set<String> roomCodes,
-                                                                    Integer paperDownload,
                                                                     String status,
                                                                     String name,
                                                                     String identity,
+                                                                    Integer minMultipleFaceCount,
+                                                                    Integer maxMultipleFaceCount,
+                                                                    Integer minExceptionCount,
+                                                                    Integer maxExceptionCount,
                                                                     Integer minWarningCount,
                                                                     Integer maxWarningCount,
                                                                     String clientWebsocketStatus,
                                                                     String monitorStatusSource);
+
+    /**
+     * 预警提醒列表
+     *
+     * @param iPage
+     * @param examId
+     * @param examActivityId
+     * @param roomCodes
+     * @param approveStatus
+     * @param name
+     * @param identity
+     * @param minMultipleFaceCount
+     * @param maxMultipleFaceCount
+     * @param minExceptionCount
+     * @param maxExceptionCount
+     * @param minWarningCount
+     * @param maxWarningCount
+     * @param clientWebsocketStatus
+     * @param monitorStatusSource
+     * @return
+     */
+    public IPage<InvigilateListWarningBean> invigilatePageWarningList(IPage<Map> iPage, Long examId,
+                                                                      Long examActivityId,
+                                                                      Set<String> roomCodes,
+                                                                      Integer approveStatus,
+                                                                      String name,
+                                                                      String identity,
+                                                                      Integer minMultipleFaceCount,
+                                                                      Integer maxMultipleFaceCount,
+                                                                      Integer minExceptionCount,
+                                                                      Integer maxExceptionCount,
+                                                                      Integer minWarningCount,
+                                                                      Integer maxWarningCount,
+                                                                      String clientWebsocketStatus,
+                                                                      String monitorStatusSource);
 }

+ 18 - 0
themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeInvigilateWarnInfoServiceImpl.java

@@ -6,6 +6,9 @@ import com.qmth.themis.business.entity.TIeInvigilateWarnInfo;
 import com.qmth.themis.business.service.TIeInvigilateWarnInfoService;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+import java.util.Set;
+
 /**
  * @Description: 监考预警信息 服务实现类
  * @Param:
@@ -16,4 +19,19 @@ import org.springframework.stereotype.Service;
 @Service
 public class TIeInvigilateWarnInfoServiceImpl extends ServiceImpl<TIeInvigilateWarnInfoMapper, TIeInvigilateWarnInfo> implements TIeInvigilateWarnInfoService {
 
+    @Resource
+    TIeInvigilateWarnInfoMapper tIeInvigilateWarnInfoMapper;
+
+    /**
+     * 预警提醒
+     *
+     * @param examId
+     * @param examActivityId
+     * @param roomCodes
+     * @return
+     */
+    @Override
+    public Integer warningCount(Long examId, Long examActivityId, Set<String> roomCodes) {
+        return tIeInvigilateWarnInfoMapper.warningCount(examId, examActivityId, roomCodes);
+    }
 }

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

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.themis.business.bean.backend.InvigilateListBean;
 import com.qmth.themis.business.bean.backend.InvigilateListPatrolBean;
 import com.qmth.themis.business.bean.backend.InvigilateListVideoBean;
+import com.qmth.themis.business.bean.backend.InvigilateListWarningBean;
 import com.qmth.themis.business.cache.ExamRecordCacheUtil;
 import com.qmth.themis.business.cache.RedisKeyHelper;
 import com.qmth.themis.business.cache.bean.*;
@@ -470,10 +471,38 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      * @param examId
      * @param examActivityId
      * @param roomCodes
-     * @param paperDownload
      * @param status
      * @param name
      * @param identity
+     * @param minMultipleFaceCount
+     * @param maxMultipleFaceCount
+     * @param minExceptionCount
+     * @param maxExceptionCount
+     * @param minWarningCount
+     * @param maxWarningCount
+     * @param clientWebsocketStatus
+     * @param monitorStatusSource
+     * @return
+     */
+    @Override
+    public IPage<InvigilateListPatrolBean> invigilatePagePatrolList(IPage<Map> iPage, Long examId, Long examActivityId, Set<String> roomCodes, String status, String name, String identity, Integer minMultipleFaceCount, Integer maxMultipleFaceCount, Integer minExceptionCount, Integer maxExceptionCount, Integer minWarningCount, Integer maxWarningCount, String clientWebsocketStatus, String monitorStatusSource) {
+        return tOeExamRecordMapper.invigilatePagePatrolList(iPage, examId, examActivityId, roomCodes, status, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource);
+    }
+
+    /**
+     * 预警提醒列表
+     *
+     * @param iPage
+     * @param examId
+     * @param examActivityId
+     * @param roomCodes
+     * @param approveStatus
+     * @param name
+     * @param identity
+     * @param minMultipleFaceCount
+     * @param maxMultipleFaceCount
+     * @param minExceptionCount
+     * @param maxExceptionCount
      * @param minWarningCount
      * @param maxWarningCount
      * @param clientWebsocketStatus
@@ -481,7 +510,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      * @return
      */
     @Override
-    public IPage<InvigilateListPatrolBean> invigilatePagePatrolList(IPage<Map> iPage, Long examId, Long examActivityId, Set<String> roomCodes, Integer paperDownload, String status, String name, String identity, Integer minWarningCount, Integer maxWarningCount, String clientWebsocketStatus, String monitorStatusSource) {
-        return tOeExamRecordMapper.invigilatePagePatrolList(iPage, examId, examActivityId, roomCodes, paperDownload, status, name, identity, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource);
+    public IPage<InvigilateListWarningBean> invigilatePageWarningList(IPage<Map> iPage, Long examId, Long examActivityId, Set<String> roomCodes, Integer approveStatus, String name, String identity, Integer minMultipleFaceCount, Integer maxMultipleFaceCount, Integer minExceptionCount, Integer maxExceptionCount, Integer minWarningCount, Integer maxWarningCount, String clientWebsocketStatus, String monitorStatusSource) {
+        return tOeExamRecordMapper.invigilatePageWarningList(iPage, examId, examActivityId, roomCodes, approveStatus, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource);
     }
 }

+ 17 - 0
themis-business/src/main/resources/mapper/TIeInvigilateWarnInfoMapper.xml

@@ -2,4 +2,21 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.qmth.themis.business.dao.TIeInvigilateWarnInfoMapper">
 
+    <select id="warningCount" resultType="java.lang.Integer">
+        select count(1) as count
+        from t_ie_invigilate_warn_info tiiwi
+        left join t_e_exam_student tees on tiiwi.exam_id = tees.exam_id
+        <where>
+            tees.room_code in
+            <foreach collection="roomCodes" item="roomCode" index="index" open="(" close=")" separator=",">
+                #{roomCode}
+            </foreach>
+            <if test="examId != null and examId != ''">
+                and tiiwi.exam_id = #{examId}
+            </if>
+            <if test="examActivityId != null and examActivityId != ''">
+                and tiiwi.exam_activity_id = #{examActivityId}
+            </if>
+        </where>
+    </select>
 </mapper>

+ 106 - 8
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -118,10 +118,7 @@
             <if test="examActivityId != null and examActivityId != ''">
                 and t.exam_activity_id = #{examActivityId}
             </if>
-            <if test="paperDownload != null and paperDownload != ''">
-                and t.paper_download = #{paperDownload}
-            </if>
-            <if test="status != null and param.status != ''">
+            <if test="status != null and status != ''">
                 and t.status = #{status}
             </if>
             <if test="name != null and name !=''">
@@ -149,6 +146,10 @@
         <include refid="invigilatePageHead" />
         <include refid="invigilatePageMiddle" />
         <include refid="invigilatePageFoot" />
+        <if test="paperDownload != null and paperDownload != ''">
+            and t.paper_download = #{paperDownload}
+        </if>
+        order by s.room_code
     </select>
 
     <select id="invigilatePageListVideo" resultType="com.qmth.themis.business.bean.backend.InvigilateListVideoBean">
@@ -156,13 +157,110 @@
         ,t.monitor_live_url as monitorLiveUrl
         <include refid="invigilatePageMiddle" />
         <include refid="invigilatePageFoot" />
+        <if test="paperDownload != null and paperDownload != ''">
+            and t.paper_download = #{paperDownload}
+        </if>
+        order by s.room_code
     </select>
 
     <select id="invigilatePagePatrolList" resultType="com.qmth.themis.business.bean.backend.InvigilateListPatrolBean">
-        <include refid="invigilatePageHead" />
+        select * from(<include refid="invigilatePageHead"/>
         ,(select count(1) from t_ie_invigilate_exception_info tiiei where tiiei.exam_record_id = t.id) as exceptionCount
-        ,(select count(1) from t_ie_invigilate_warn_info tiiwi where tiiwi.exam_record_id = t.id and tiiwi.`type` = 'FACE_COUNT_ERROR' and tiiwi.`level` = 'D8') as multipleFaceCount
-        <include refid="invigilatePageMiddle" />
-        <include refid="invigilatePageFoot" />
+        ,(select count(1) from t_ie_invigilate_warn_info tiiwi where tiiwi.exam_record_id = t.id and tiiwi.`type` =
+        'FACE_COUNT_ERROR' and tiiwi.`level` = 'D8') as multipleFaceCount
+        <include refid="invigilatePageMiddle"/>
+        <include refid="invigilatePageFoot" /> ) t
+        <where>
+            <if test="minMultipleFaceCount != null and minMultipleFaceCount != ''">
+                and t.multipleFaceCount &lt;= #{minMultipleFaceCount}
+            </if>
+            <if test="maxMultipleFaceCount != null and maxMultipleFaceCount != ''">
+                and t.multipleFaceCount &gt;= #{maxMultipleFaceCount}
+            </if>
+            <if test="minExceptionCount != null and minExceptionCount != ''">
+                and t.exceptionCount &lt;= #{minExceptionCount}
+            </if>
+            <if test="maxExceptionCount != null and maxExceptionCount != ''">
+                and t.exceptionCount &gt;= #{maxExceptionCount}
+            </if>
+        </where>
+        order by t.roomCode
+    </select>
+
+    <select id="invigilatePageWarningList" resultType="com.qmth.themis.business.bean.backend.InvigilateListWarningBean">
+        select * from(select
+           tee.id as examId,
+           tee.name as examName,
+           teea.id as examActivityId,
+           tees.id as examStudentId,
+           teea.code as examActivityCode,
+           tees.room_code as roomCode,
+           tees.room_name as roomName,
+           toer.id as examRecordId,
+           tees.`identity`,
+           tees.name,
+           tees.course_code as courseCode,
+           tees.course_name as courseName,
+           toer.status as statusCode,
+           toer.warning_count as warningCount,
+           toer.breach_status as breachStatus,
+           tiiwi.approve_status as approveStatus
+           ,(select count(1) from t_ie_invigilate_warn_info tiiwi where tiiwi.exam_record_id = toer.id and tiiwi.`type` =
+            'FACE_COUNT_ERROR' and tiiwi.`level` = 'D8') as multipleFaceCount
+           ,(select count(1) from t_ie_invigilate_exception_info tiiei where tiiei.exam_record_id = toer.id) as exceptionCount
+         from t_ie_invigilate_warn_info tiiwi
+        left join t_e_exam tee on tee.id = tiiwi.exam_id
+        left join t_e_exam_activity teea on teea.id = tiiwi.exam_activity_id
+        left join t_e_exam_student tees on tees.exam_id = tiiwi.exam_id
+        left join t_oe_exam_record toer on toer.exam_student_id = tees.id
+            <where>
+                tees.room_code in
+                <foreach collection="roomCodes" item="roomCode" index="index" open="(" close=")" separator=",">
+                    #{roomCode}
+                </foreach>
+                <if test="examId != null and examId != ''">
+                    and tiiwi.exam_id = #{examId}
+                </if>
+                <if test="examActivityId != null and examActivityId != ''">
+                    and tiiwi.exam_activity_id = #{examActivityId}
+                </if>
+                <if test="approveStatus != null and approveStatus != ''">
+                    and tiiwi.approve_status = #{approveStatus}
+                </if>
+                <if test="name != null and name !=''">
+                    and tees.name like CONCAT(#{name},'%')
+                </if>
+                <if test="identity != null and identity !=''">
+                    and tees.identity like CONCAT(#{identity},'%')
+                </if>
+                <if test="maxWarningCount != null and maxWarningCount != ''">
+                    and toer.warning_count &lt;= #{maxWarningCount}
+                </if>
+                <if test="minWarningCount != null and minWarningCount != ''">
+                    and toer.warning_count &gt;= #{minWarningCount}
+                </if>
+                <if test="clientWebsocketStatus != null and clientWebsocketStatus != ''">
+                    and toer.client_websocket_status = #{clientWebsocketStatus}
+                </if>
+                <if test="monitorStatusSource != null and monitorStatusSource != ''">
+                    and toer.monitor_status_source = #{monitorStatusSource}
+                </if>
+            </where>
+        ) t
+        <where>
+            <if test="minMultipleFaceCount != null and minMultipleFaceCount != ''">
+                and t.multipleFaceCount &lt;= #{minMultipleFaceCount}
+            </if>
+            <if test="maxMultipleFaceCount != null and maxMultipleFaceCount != ''">
+                and t.multipleFaceCount &gt;= #{maxMultipleFaceCount}
+            </if>
+            <if test="minExceptionCount != null and minExceptionCount != ''">
+                and t.exceptionCount &lt;= #{minExceptionCount}
+            </if>
+            <if test="maxExceptionCount != null and maxExceptionCount != ''">
+                and t.exceptionCount &gt;= #{maxExceptionCount}
+            </if>
+        </where>
+        order by t.roomCode
     </select>
 </mapper>