Przeglądaj źródła

监考接口修改

wangliang 4 lat temu
rodzic
commit
293ff4e038

+ 0 - 3
themis-backend/src/main/java/com/qmth/themis/backend/api/TBUserController.java

@@ -605,9 +605,6 @@ public class TBUserController {
                         TBUserRole tbUserRole = new TBUserRole(finalTbUser1.getId(), s);
                         tbUserRoleService.save(tbUserRole);
                     });
-                    cacheService.removeAccountCache(tbUser.getId());
-                    TBSession tbSession = (TBSession) ServletUtil.getRequestSession();
-                    redisUtil.deleteUserSession(tbSession.getId());
                 }
                 tbUser.setUpdateId(tbUser.getId());
             }

+ 8 - 13
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamCourseController.java

@@ -1,6 +1,6 @@
 package com.qmth.themis.backend.api;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.themis.business.base.BasePage;
@@ -12,6 +12,7 @@ import com.qmth.themis.business.enums.FieldUniqueEnum;
 import com.qmth.themis.business.service.TEExamCourseService;
 import com.qmth.themis.business.util.JacksonUtil;
 import com.qmth.themis.business.util.ServletUtil;
+import com.qmth.themis.common.contanst.Constants;
 import com.qmth.themis.common.enums.ExceptionResultEnum;
 import com.qmth.themis.common.exception.BusinessException;
 import com.qmth.themis.common.util.Result;
@@ -23,7 +24,6 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 
@@ -52,17 +52,12 @@ public class TEExamCourseController {
         }
         try {
             TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
-            QueryWrapper<TEExamCourse> teExamCourseQueryWrapper = new QueryWrapper<>();
-            teExamCourseQueryWrapper.lambda().eq(TEExamCourse::getExamId, teExamCourse.getExamId()).eq(TEExamCourse::getCourseCode, teExamCourse.getCourseCode());
-            List<TEExamCourse> teExamCourseList = teExamCourseService.list(teExamCourseQueryWrapper);
-            if (Objects.nonNull(teExamCourseList) && teExamCourseList.size() > 0) {
-                teExamCourseList.forEach(s -> {
-                    s.setObjectiveShuffle(teExamCourse.getObjectiveShuffle());
-                    s.setOptionShuffle(teExamCourse.getOptionShuffle());
-                    s.setUpdateId(tbUser.getId());
-                });
-            }
-            teExamCourseService.updateBatchById(teExamCourseList);
+            UpdateWrapper<TEExamCourse> teExamCourseUpdateWrapper = new UpdateWrapper<>();
+            teExamCourseUpdateWrapper.lambda().set(TEExamCourse::getObjectiveShuffle,teExamCourse.getObjectiveShuffle())
+                    .set(TEExamCourse::getOptionShuffle,teExamCourse.getOptionShuffle())
+                    .set(TEExamCourse::getUpdateId,tbUser.getId())
+                    .eq(TEExamCourse::getExamId, teExamCourse.getExamId()).eq(TEExamCourse::getCourseCode, teExamCourse.getCourseCode());
+            teExamCourseService.update(teExamCourseUpdateWrapper);
         } catch (Exception e) {
             e.printStackTrace();
             if (e instanceof DuplicateKeyException) {

+ 6 - 8
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamPaperController.java

@@ -20,7 +20,10 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
-import java.util.*;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
 
 /**
  * @Description: 考试试卷 前端控制器
@@ -80,15 +83,10 @@ public class TEExamPaperController {
         }
         try {
             TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
-            List<TEExamPaper> teExamPaperUpdate = new ArrayList<>();
             teExamPaperList.forEach(s -> {
-                TEExamPaper teExamPaper = teExamPaperService.getById(s.getId());
-                teExamPaper.setWeight(s.getWeight());
-                teExamPaper.setAudioPlayCount(s.getAudioPlayCount());
-                teExamPaper.setUpdateId(tbUser.getId());
-                teExamPaperUpdate.add(teExamPaper);
+                s.setUpdateId(tbUser.getId());
             });
-            teExamPaperService.updateBatchById(teExamPaperUpdate);
+            teExamPaperService.saveOrUpdateBatch(teExamPaperList);
         } catch (Exception e) {
             e.printStackTrace();
             if (e instanceof DuplicateKeyException) {

+ 4 - 0
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamStudentController.java

@@ -121,6 +121,10 @@ public class TEExamStudentController {
         if (Objects.isNull(teExamStudentList) || teExamStudentList.size() == 0) {
             throw new BusinessException(ExceptionResultEnum.EXAM_STUDENT_INFO_IS_NULL);
         }
+        TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        teExamStudentList.forEach(s -> {
+            s.setUpdateId(tbUser.getId());
+        });
         teExamStudentService.saveOrUpdateBatch(teExamStudentList);
         teExamStudentList.forEach(s -> {
             teExamStudentService.updateExamStudentCacheBean(s.getId());

+ 50 - 14
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeInvigilateController.java

@@ -1,9 +1,12 @@
 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.qmth.themis.business.annotation.ApiJsonObject;
 import com.qmth.themis.business.annotation.ApiJsonProperty;
-import com.qmth.themis.business.bean.backend.InvigilateListQueryBean;
+import com.qmth.themis.business.base.BasePage;
+import com.qmth.themis.business.bean.backend.InvigilateListBean;
 import com.qmth.themis.business.cache.RedisKeyHelper;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.MqDto;
@@ -27,16 +30,10 @@ import com.qmth.themis.common.util.ResultUtil;
 import io.swagger.annotations.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
 
 /**
  * @Description: 监考信息 前端控制器
@@ -65,15 +62,54 @@ public class TIeInvigilateController {
 
     @ApiOperation(value = "实时监控台列表接口")
     @RequestMapping(value = "/list", method = RequestMethod.POST)
-    public Result list(@RequestBody InvigilateListQueryBean param) {
-        return ResultUtil.ok(tOeExamRecordService.invigilatePageList(param));
+    @ApiResponses({@ApiResponse(code = 200, message = "监考监控信息", response = InvigilateListBean.class)})
+    public Result list(@ApiParam(value = "考试批次id") @RequestParam Long examId,
+                       @ApiParam(value = "考试场次id", required = false) @RequestParam(required = false) Long examActivityId,
+                       @ApiParam(value = "虚拟考场代码", required = false) @RequestParam(required = false) String roomCode,
+                       @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 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);
+        }
+        IPage<InvigilateListBean> invigilateListBeanIPage = tOeExamRecordService.invigilatePageList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, paperDownload, status, name, identity, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource);
+        BasePage basePage = new BasePage(invigilateListBeanIPage.getRecords(), invigilateListBeanIPage.getCurrent(), invigilateListBeanIPage.getSize(), invigilateListBeanIPage.getTotal());
+        Map map = new HashMap<>();
+        map.put(SystemConstant.RECORDS, basePage);
+        return ResultUtil.ok(map);
     }
 
     @ApiOperation(value = "实时监控台视频列表接口")
     @RequestMapping(value = "/list/video", method = RequestMethod.POST)
-    public Result listVideo() {
-        log.info("invigilate listVideo is come in");
-        return ResultUtil.ok(SystemConstant.SUCCESS);
+    @ApiResponses({@ApiResponse(code = 200, message = "监考监控信息", response = InvigilateListBean.class)})
+    public Result listVideo(@ApiParam(value = "考试批次id") @RequestParam Long examId,
+                            @ApiParam(value = "考试场次id", required = false) @RequestParam(required = false) Long examActivityId,
+                            @ApiParam(value = "虚拟考场代码", required = false) @RequestParam(required = false) String roomCode,
+                            @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 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);
+        }
+        IPage<InvigilateListBean> invigilateListBeanIPage = tOeExamRecordService.invigilatePageList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, paperDownload, status, name, identity, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource);
+        BasePage basePage = new BasePage(invigilateListBeanIPage.getRecords(), invigilateListBeanIPage.getCurrent(), invigilateListBeanIPage.getSize(), invigilateListBeanIPage.getTotal());
+        Map map = new HashMap<>();
+        map.put(SystemConstant.RECORDS, basePage);
+        return ResultUtil.ok(map);
     }
 
     @ApiOperation(value = "强制/手动交卷接口")

+ 185 - 187
themis-business/src/main/java/com/qmth/themis/business/bean/backend/InvigilateListBean.java

@@ -1,213 +1,211 @@
 package com.qmth.themis.business.bean.backend;
 
 import com.qmth.themis.business.enums.ExamRecordStatusEnum;
-
+import com.qmth.themis.business.enums.MonitorVideoSourceEnum;
+import com.qmth.themis.business.enums.WebsocketStatusEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
 @ApiModel("实时监控台返回对象")
 public class InvigilateListBean {
-	@ApiModelProperty(name="考试id")
-	private Long examId;
-
-	@ApiModelProperty(name="场次id")
-	private Long examActivityId;
-	
-	@ApiModelProperty(name="考生id")
-	private Long examStudentId;
-	
-	@ApiModelProperty(name="考试记录id")
-	private Long recordId;
-	
-	@ApiModelProperty(name="证件号")
-	private String identity;
-	
-	@ApiModelProperty(name="虚拟考场代码")
-	private String roomCode;
-	
-	@ApiModelProperty(name="姓名")
-	private String name;
-	
-	@ApiModelProperty(name="科目名称")
-	private String courseName;
-	
-	@ApiModelProperty(name="科目编码")
-	private String courseCode;
-
-	@ApiModelProperty(name="试题下载状态")
-	private Integer paperDownload;
-	
-	@ApiModelProperty(name="考生状态")
-	private String status;
-	
-	@ApiModelProperty(name="考生状态值")
-	private ExamRecordStatusEnum statusCode;
-	
-	@ApiModelProperty(name="答题进度")
-	private Double progress;
-	
-	@ApiModelProperty(name="预警量")
-	private Integer warningCount;
-	
-	@ApiModelProperty(name="客户端网络通信状态")
-	private Integer clientCommunicationStatus;
-
-	@ApiModelProperty(name="微信小程序网络通信状态")
-	private Integer wxappCommunicationStatus;
-
-	@ApiModelProperty(name="ip地址")
-	private String clientCurrentIp;
-
-	@ApiModelProperty(name="是否违纪")
-	private Integer breachStatus;
-
-	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 getRecordId() {
-		return recordId;
-	}
-
-	public void setRecordId(Long recordId) {
-		this.recordId = recordId;
-	}
-
-	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 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 getPaperDownload() {
-		return paperDownload;
-	}
-
-	public void setPaperDownload(Integer paperDownload) {
-		this.paperDownload = paperDownload;
-	}
-
-	public String getStatus() {
-		if(statusCode!=null) {
-			return statusCode.getCode();
-		}
-		return status;
-	}
+    @ApiModelProperty(name = "考试id")
+    private Long examId;
+
+    @ApiModelProperty(name = "场次id")
+    private Long examActivityId;
+
+    @ApiModelProperty(name = "考生id")
+    private Long examStudentId;
+
+    @ApiModelProperty(name = "考试记录id")
+    private Long recordId;
+
+    @ApiModelProperty(name = "证件号")
+    private String identity;
+
+    @ApiModelProperty(name = "虚拟考场代码")
+    private String roomCode;
+
+    @ApiModelProperty(name = "姓名")
+    private String name;
+
+    @ApiModelProperty(name = "科目名称")
+    private String courseName;
+
+    @ApiModelProperty(name = "科目编码")
+    private String courseCode;
+
+    @ApiModelProperty(name = "试题下载状态")
+    private Integer paperDownload;
+
+    @ApiModelProperty(name = "考生状态")
+    private String status;
+
+    @ApiModelProperty(name = "考生状态值")
+    private ExamRecordStatusEnum statusCode;
+
+    @ApiModelProperty(name = "答题进度")
+    private Double progress;
+
+    @ApiModelProperty(name = "预警量")
+    private Integer warningCount;
+
+    @ApiModelProperty(name = "客户端网络通信状态", required = false)
+    private WebsocketStatusEnum clientCommunicationStatus;
+
+    @ApiModelProperty(name = "监控通信状态", required = false)
+    private MonitorVideoSourceEnum monitorStatusSource;
+
+    @ApiModelProperty(name = "ip地址")
+    private String clientCurrentIp;
+
+    @ApiModelProperty(name = "是否违纪")
+    private Integer breachStatus;
+
+    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 void setStatus(String status) {
-		this.status = status;
-	}
+    public Long getRecordId() {
+        return recordId;
+    }
 
-	public ExamRecordStatusEnum getStatusCode() {
-		return statusCode;
-	}
+    public void setRecordId(Long recordId) {
+        this.recordId = recordId;
+    }
 
-	public void setStatusCode(ExamRecordStatusEnum statusCode) {
-		this.statusCode = statusCode;
-	}
+    public String getIdentity() {
+        return identity;
+    }
 
-	public Double getProgress() {
-		return progress;
-	}
+    public void setIdentity(String identity) {
+        this.identity = identity;
+    }
 
-	public void setProgress(Double progress) {
-		this.progress = progress;
-	}
+    public String getRoomCode() {
+        return roomCode;
+    }
 
-	public Integer getWarningCount() {
-		return warningCount;
-	}
+    public void setRoomCode(String roomCode) {
+        this.roomCode = roomCode;
+    }
 
-	public void setWarningCount(Integer warningCount) {
-		this.warningCount = warningCount;
-	}
+    public String getName() {
+        return name;
+    }
 
-	public Integer getClientCommunicationStatus() {
-		return clientCommunicationStatus;
-	}
+    public void setName(String name) {
+        this.name = name;
+    }
 
-	public void setClientCommunicationStatus(Integer clientCommunicationStatus) {
-		this.clientCommunicationStatus = clientCommunicationStatus;
-	}
+    public String getCourseName() {
+        return courseName;
+    }
 
-	public Integer getWxappCommunicationStatus() {
-		return wxappCommunicationStatus;
-	}
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
 
-	public void setWxappCommunicationStatus(Integer wxappCommunicationStatus) {
-		this.wxappCommunicationStatus = wxappCommunicationStatus;
-	}
+    public String getCourseCode() {
+        return courseCode;
+    }
 
-	public String getClientCurrentIp() {
-		return clientCurrentIp;
-	}
+    public void setCourseCode(String courseCode) {
+        this.courseCode = courseCode;
+    }
 
-	public void setClientCurrentIp(String clientCurrentIp) {
-		this.clientCurrentIp = clientCurrentIp;
-	}
+    public Integer getPaperDownload() {
+        return paperDownload;
+    }
 
-	public Integer getBreachStatus() {
-		return breachStatus;
-	}
+    public void setPaperDownload(Integer paperDownload) {
+        this.paperDownload = paperDownload;
+    }
 
-	public void setBreachStatus(Integer breachStatus) {
-		this.breachStatus = breachStatus;
-	}
+    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 Double getProgress() {
+        return progress;
+    }
+
+    public void setProgress(Double progress) {
+        this.progress = progress;
+    }
+
+    public Integer getWarningCount() {
+        return warningCount;
+    }
+
+    public void setWarningCount(Integer warningCount) {
+        this.warningCount = warningCount;
+    }
+
+    public WebsocketStatusEnum getClientCommunicationStatus() {
+        return clientCommunicationStatus;
+    }
+
+    public void setClientCommunicationStatus(WebsocketStatusEnum clientCommunicationStatus) {
+        this.clientCommunicationStatus = clientCommunicationStatus;
+    }
+
+    public MonitorVideoSourceEnum getMonitorStatusSource() {
+        return monitorStatusSource;
+    }
+
+    public void setMonitorStatusSource(MonitorVideoSourceEnum monitorStatusSource) {
+        this.monitorStatusSource = monitorStatusSource;
+    }
+
+    public String getClientCurrentIp() {
+        return clientCurrentIp;
+    }
+
+    public void setClientCurrentIp(String clientCurrentIp) {
+        this.clientCurrentIp = clientCurrentIp;
+    }
+
+    public Integer getBreachStatus() {
+        return breachStatus;
+    }
+
+    public void setBreachStatus(Integer breachStatus) {
+        this.breachStatus = breachStatus;
+    }
 }

+ 0 - 152
themis-business/src/main/java/com/qmth/themis/business/bean/backend/InvigilateListQueryBean.java

@@ -1,152 +0,0 @@
-package com.qmth.themis.business.bean.backend;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-@ApiModel("实时监控台列表参数")
-public class InvigilateListQueryBean {
-	@ApiModelProperty(name="考试id",required = true)
-	private Long examId;
-
-	@ApiModelProperty(name="场次id",required = true)
-	private Long examActivityId;
-	
-	@ApiModelProperty(name="虚拟考场代码",required = true)
-	private String roomCode;
-
-	@ApiModelProperty(name="试题下载状态",required = true)
-	private Integer paperDownload;
-	
-	@ApiModelProperty(name="考生状态",required = false)
-	private String status;
-	
-	@ApiModelProperty(name="姓名",required = false)
-	private String name;
-	
-	@ApiModelProperty(name="证件号",required = false)
-	private String identity;
-	
-	@ApiModelProperty(name="预警量min",required = false)
-	private Integer minWarningCount;
-	
-	@ApiModelProperty(name="预警量max",required = false)
-	private Integer maxWarningCount;
-
-	@ApiModelProperty(name="客户端网络通信状态",required = false)
-	private Integer clientCommunicationStatus;
-
-	@ApiModelProperty(name="微信小程序网络通信状态",required = false)
-	private Integer wxappCommunicationStatus;
-
-	@ApiModelProperty(name="分页序号",required = true)
-	private Integer pageNumber;
-
-	@ApiModelProperty(name="分页数量",required = true)
-	private Integer pageSize;
-
-	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 String getRoomCode() {
-		return roomCode;
-	}
-
-	public void setRoomCode(String roomCode) {
-		this.roomCode = roomCode;
-	}
-
-	public Integer getPaperDownload() {
-		return paperDownload;
-	}
-
-	public void setPaperDownload(Integer paperDownload) {
-		this.paperDownload = paperDownload;
-	}
-
-	public String getStatus() {
-		return status;
-	}
-
-	public void setStatus(String status) {
-		this.status = status;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public String getIdentity() {
-		return identity;
-	}
-
-	public void setIdentity(String identity) {
-		this.identity = identity;
-	}
-
-	public Integer getMinWarningCount() {
-		return minWarningCount;
-	}
-
-	public void setMinWarningCount(Integer minWarningCount) {
-		this.minWarningCount = minWarningCount;
-	}
-
-	public Integer getMaxWarningCount() {
-		return maxWarningCount;
-	}
-
-	public void setMaxWarningCount(Integer maxWarningCount) {
-		this.maxWarningCount = maxWarningCount;
-	}
-
-	public Integer getClientCommunicationStatus() {
-		return clientCommunicationStatus;
-	}
-
-	public void setClientCommunicationStatus(Integer clientCommunicationStatus) {
-		this.clientCommunicationStatus = clientCommunicationStatus;
-	}
-
-	public Integer getWxappCommunicationStatus() {
-		return wxappCommunicationStatus;
-	}
-
-	public void setWxappCommunicationStatus(Integer wxappCommunicationStatus) {
-		this.wxappCommunicationStatus = wxappCommunicationStatus;
-	}
-
-	public Integer getPageNumber() {
-		return pageNumber;
-	}
-
-	public void setPageNumber(Integer pageNumber) {
-		this.pageNumber = pageNumber;
-	}
-
-	public Integer getPageSize() {
-		return pageSize;
-	}
-
-	public void setPageSize(Integer pageSize) {
-		this.pageSize = pageSize;
-	}
-	
-	
-}

+ 35 - 14
themis-business/src/main/java/com/qmth/themis/business/dao/TOeExamRecordMapper.java

@@ -1,16 +1,14 @@
 package com.qmth.themis.business.dao;
 
-import java.util.Map;
-
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.qmth.themis.business.bean.backend.InvigilateListBean;
-import com.qmth.themis.business.bean.backend.InvigilateListQueryBean;
 import com.qmth.themis.business.dto.response.TEExamUnFinishDto;
 import com.qmth.themis.business.entity.TOeExamRecord;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
 
 /**
  * @Description: 考试记录 Mapper 接口
@@ -31,19 +29,42 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @return
      */
     public TEExamUnFinishDto getUnFinishExam(@Param("studentId") Long studentId, @Param("examId") Long examId, @Param("orgId") Long orgId);
-    
-    /**数据更新
+
+    /**
+     * 数据更新
+     *
      * @param recordId
      * @param colName
      * @param colValue
      */
     public void dataUpdate(@Param("recordId") Long recordId, @Param("colName") String colName, @Param("colValue") Object colValue);
 
-    /**实时监控台列表
-     * @param recordId
-     * @param colName
-     * @param colValue
+    /**
+     * 查询实时监控台列表
+     *
+     * @param iPage
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param paperDownload
+     * @param status
+     * @param name
+     * @param identity
+     * @param minWarningCount
+     * @param maxWarningCount
+     * @param clientWebsocketStatus
+     * @param monitorStatusSource
+     * @return
      */
-    public IPage<InvigilateListBean> invigilatePageQuery(IPage<InvigilateListBean> iPage,@Param("param") InvigilateListQueryBean param);
-    
+    public IPage<InvigilateListBean> invigilatePageQuery(IPage<Map> iPage, @Param("examId") Long examId,
+                                                         @Param("examActivityId") Long examActivityId,
+                                                         @Param("roomCode") String roomCode,
+                                                         @Param("paperDownload") Integer paperDownload,
+                                                         @Param("status") String status,
+                                                         @Param("name") String name,
+                                                         @Param("identity") String identity,
+                                                         @Param("minWarningCount") Integer minWarningCount,
+                                                         @Param("maxWarningCount") Integer maxWarningCount,
+                                                         @Param("clientWebsocketStatus") String clientWebsocketStatus,
+                                                         @Param("monitorStatusSource") String monitorStatusSource);
 }

+ 78 - 40
themis-business/src/main/java/com/qmth/themis/business/service/TOeExamRecordService.java

@@ -1,8 +1,8 @@
 package com.qmth.themis.business.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.qmth.themis.business.base.BasePage;
-import com.qmth.themis.business.bean.backend.InvigilateListQueryBean;
+import com.qmth.themis.business.bean.backend.InvigilateListBean;
 import com.qmth.themis.business.entity.TOeExamRecord;
 import com.qmth.themis.business.enums.ExamTypeEnum;
 import com.qmth.themis.business.enums.LivenessTypeEnum;
@@ -37,50 +37,88 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      * @param param
      */
     void calculateObjectiveScore(Map<String, Object> param);
-    
-	/**考试记录数据持久化
-	 * @param recordId
-	 */
-	public void saveDataByCache(Long recordId);
 
-	void saveFaceVerify(ExamTypeEnum type, Long recordId, Long entryAuthenticationId,
-			VerifyExceptionEnum entryAuthenticationResult);
+    /**
+     * 考试记录数据持久化
+     *
+     * @param recordId
+     */
+    public void saveDataByCache(Long recordId);
 
-	void saveLivenessVerify(LivenessTypeEnum type, Long recordId, Long entryAuthenticationId,
-			VerifyExceptionEnum entryAuthenticationResult);
+    void saveFaceVerify(ExamTypeEnum type, Long recordId, Long entryAuthenticationId,
+                        VerifyExceptionEnum entryAuthenticationResult);
 
-	/**考试记录字段同步消息发送
-	 * @param recordId
-	 * @param colName
-	 * @param colValue
-	 */
-	void dataUpdateMq(Long recordId, String colName, Object colValue);
-	
-	/**考试记录字段同步
-	 * @param recordId
-	 * @param colName
-	 * @param colValue
-	 */
-	void dataUpdate(Long recordId, String colName, Object colValue,Integer isDate);
+    void saveLivenessVerify(LivenessTypeEnum type, Long recordId, Long entryAuthenticationId,
+                            VerifyExceptionEnum entryAuthenticationResult);
 
-	/**考试记录初始化消息发送
-	 * @param param
-	 */
-	void dataInitMq(Map<String, Object> param);
+    /**
+     * 考试记录字段同步消息发送
+     *
+     * @param recordId
+     * @param colName
+     * @param colValue
+     */
+    void dataUpdateMq(Long recordId, String colName, Object colValue);
 
-	/**考试记录初始化
-	 * @param param
-	 */
-	void dataInit(Map<String, Object> param);
+    /**
+     * 考试记录字段同步
+     *
+     * @param recordId
+     * @param colName
+     * @param colValue
+     */
+    void dataUpdate(Long recordId, String colName, Object colValue, Integer isDate);
+
+    /**
+     * 考试记录初始化消息发送
+     *
+     * @param param
+     */
+    void dataInitMq(Map<String, Object> param);
 
-	/**考试记录字段同步消息发送
-	 * @param recordId
-	 * @param colName
-	 * @param colValue
-	 * @param isDate
-	 */
-	void dataUpdateMq(Long recordId, String colName, Object colValue, Integer isDate);
+    /**
+     * 考试记录初始化
+     *
+     * @param param
+     */
+    void dataInit(Map<String, Object> param);
 
-	BasePage invigilatePageList(InvigilateListQueryBean param);
+    /**
+     * 考试记录字段同步消息发送
+     *
+     * @param recordId
+     * @param colName
+     * @param colValue
+     * @param isDate
+     */
+    void dataUpdateMq(Long recordId, String colName, Object colValue, Integer isDate);
 
+    /**
+     * 查询实时监控台列表
+     *
+     * @param iPage
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param paperDownload
+     * @param status
+     * @param name
+     * @param identity
+     * @param minWarningCount
+     * @param maxWarningCount
+     * @param clientWebsocketStatus
+     * @param monitorStatusSource
+     * @return
+     */
+    public IPage<InvigilateListBean> invigilatePageList(IPage<Map> iPage, Long examId,
+                                                        Long examActivityId,
+                                                        String roomCode,
+                                                        Integer paperDownload,
+                                                        String status,
+                                                        String name,
+                                                        String identity,
+                                                        Integer minWarningCount,
+                                                        Integer maxWarningCount,
+                                                        String clientWebsocketStatus,
+                                                        String monitorStatusSource);
 }

+ 159 - 157
themis-business/src/main/java/com/qmth/themis/business/service/impl/TOeExamRecordServiceImpl.java

@@ -1,36 +1,12 @@
 package com.qmth.themis.business.service.impl;
 
-import java.io.File;
-import java.math.BigDecimal;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
-import java.util.UUID;
-
-import javax.annotation.Resource;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.BeanUtils;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
 import com.alibaba.fastjson.JSONArray;
-import com.baomidou.mybatisplus.core.metadata.OrderItem;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.qmth.themis.business.base.BasePage;
 import com.qmth.themis.business.bean.backend.InvigilateListBean;
-import com.qmth.themis.business.bean.backend.InvigilateListQueryBean;
 import com.qmth.themis.business.cache.ExamRecordCacheUtil;
 import com.qmth.themis.business.cache.RedisKeyHelper;
-import com.qmth.themis.business.cache.bean.ExamCacheBean;
-import com.qmth.themis.business.cache.bean.ExamStudentAnswerCacheBean;
-import com.qmth.themis.business.cache.bean.ExamStudentCacheBean;
-import com.qmth.themis.business.cache.bean.ExamStudentPaperStructCacheBean;
-import com.qmth.themis.business.cache.bean.ObjectiveAnswerCacheBean;
+import com.qmth.themis.business.cache.bean.*;
 import com.qmth.themis.business.config.SystemConfig;
 import com.qmth.themis.business.constant.SpringContextHolder;
 import com.qmth.themis.business.constant.SystemConstant;
@@ -40,24 +16,24 @@ import com.qmth.themis.business.dto.response.TEExamUnFinishDto;
 import com.qmth.themis.business.entity.TEExamStudent;
 import com.qmth.themis.business.entity.TOeExamAnswer;
 import com.qmth.themis.business.entity.TOeExamRecord;
-import com.qmth.themis.business.enums.ExamRecordStatusEnum;
-import com.qmth.themis.business.enums.ExamTypeEnum;
-import com.qmth.themis.business.enums.LivenessTypeEnum;
-import com.qmth.themis.business.enums.MqTagEnum;
-import com.qmth.themis.business.enums.MqTopicEnum;
-import com.qmth.themis.business.enums.ObjectiveScorePolicyEnum;
-import com.qmth.themis.business.enums.VerifyExceptionEnum;
-import com.qmth.themis.business.service.MqDtoService;
-import com.qmth.themis.business.service.TEExamPaperService;
-import com.qmth.themis.business.service.TEExamService;
-import com.qmth.themis.business.service.TEExamStudentService;
-import com.qmth.themis.business.service.TOeExamAnswerService;
-import com.qmth.themis.business.service.TOeExamRecordService;
+import com.qmth.themis.business.enums.*;
+import com.qmth.themis.business.service.*;
 import com.qmth.themis.business.util.OssUtil;
 import com.qmth.themis.business.util.RedisUtil;
 import com.qmth.themis.common.contanst.Constants;
 import com.qmth.themis.common.util.FileUtil;
 import com.qmth.themis.common.util.SimpleBeanUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 /**
  * @Description: 考试记录 服务实现类
@@ -68,13 +44,13 @@ import com.qmth.themis.common.util.SimpleBeanUtil;
  */
 @Service
 public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, TOeExamRecord> implements TOeExamRecordService {
-	private final static Logger log = LoggerFactory.getLogger(TOeExamRecordServiceImpl.class);
-	
-	private SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
-	
+    private final static Logger log = LoggerFactory.getLogger(TOeExamRecordServiceImpl.class);
+
+    private SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
+
     @Resource
     MqDtoService mqDtoService;
-	
+
     @Resource
     TOeExamRecordMapper tOeExamRecordMapper;
 
@@ -89,13 +65,13 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
 
     @Resource
     TEExamService teExamService;
-    
+
     @Resource
     SystemConfig systemConfig;
-    
+
     @Resource
     TOeExamAnswerService examAnswerService;
-    
+
     @Resource
     TEExamStudentService examStudentService;
 
@@ -162,7 +138,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
         er.setFirstPrepareTime(new Date());
         er.setStatus(ExamRecordStatusEnum.FIRST_PREPARE);
         er.setObjectiveScore(0.0);
-        Map<String, Object> map=SimpleBeanUtil.objectToMap(er);
+        Map<String, Object> map = SimpleBeanUtil.objectToMap(er);
         redisUtil.setForHash(RedisKeyHelper.examRecordCacheKey(er.getId()), map);
         dataInitMq(map);
         return er.getId();
@@ -271,10 +247,11 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
     }
 
     private boolean checkSingleChoice(String answerArray, JSONArray ar) {
-    	JSONArray an=JSONArray.parseArray(answerArray);
+        JSONArray an = JSONArray.parseArray(answerArray);
         int a = an.getIntValue(0);
         return checkSingleChoice(a, ar);
     }
+
     private boolean checkSingleChoice(int answer, JSONArray ar) {
         for (int i = 0; i < ar.size(); i++) {
             if (answer == ar.getIntValue(i)) {
@@ -292,8 +269,8 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
     private int checkMultipleChoice(String answer, JSONArray ar) {
         int yes = 0;
         int no = 0;
-        JSONArray an=JSONArray.parseArray(answer);
-        for(int i=0;i<an.size();i++) {
+        JSONArray an = JSONArray.parseArray(answer);
+        for (int i = 0; i < an.size(); i++) {
             if (checkSingleChoice(an.getIntValue(i), ar)) {
                 yes++;
                 continue;
@@ -310,135 +287,160 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
         return -1;
     }
 
-	/**
-	 *考试记录数据持久化
-	 */
+    /**
+     * 考试记录数据持久化
+     */
     @SuppressWarnings("unchecked")
     @Transactional
-	@Override
-	public void saveDataByCache(Long recordId) {
+    @Override
+    public void saveDataByCache(Long recordId) {
         String tempDir = SystemConstant.TEMP_FILES_DIR;
         String dir = tempDir + "/" + uuid() + "/";
         File dfile = new File(dir);
         try {
             dfile.mkdirs();
             String structFilePath = sdf.format(new Date()) + "/" + uuid() + ".json";
-	        
-        	//保存考试记录
-        	Map<String,Object> record=redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(recordId));
-        	TOeExamRecord er=SimpleBeanUtil.mapToObject(record, TOeExamRecord.class);
-        	er.setStatus(ExamRecordStatusEnum.PERSISTED);
-        	er.setPaperStructPath(structFilePath);
-        	er.setPaperStructUpload(1);
-        	saveOrUpdate(er);
-        	//保存作答
-        	Map<String,ExamStudentAnswerCacheBean> answerMap=redisUtil.getHashEntries(RedisKeyHelper.examAnswerKey(recordId));
-        	for(ExamStudentAnswerCacheBean answerCache:answerMap.values()) {
-        		TOeExamAnswer answer=new TOeExamAnswer();
-        		BeanUtils.copyProperties(answerCache, answer);
-        		answer.setId(Constants.idGen.next());
-        		answer.setExamRecordId(recordId);
-        		examAnswerService.saveOrUpdate(answer);
-        	}
-        	//更新考生信息
-        	ExamStudentCacheBean examStudentCache = examStudentService.getExamStudentCacheBean(er.getExamStudentId());
-        	TEExamStudent examStudent=new TEExamStudent();
-    		BeanUtils.copyProperties(examStudentCache, examStudent);
-    		examStudentService.saveOrUpdate(examStudent);
-        	//上传个人试卷结构
-            ExamStudentPaperStructCacheBean struct=(ExamStudentPaperStructCacheBean)redisUtil.get(RedisKeyHelper.studentPaperStructKey(recordId));
-            File structFile = new File(dir+"struct.json");
+
+            //保存考试记录
+            Map<String, Object> record = redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(recordId));
+            TOeExamRecord er = SimpleBeanUtil.mapToObject(record, TOeExamRecord.class);
+            er.setStatus(ExamRecordStatusEnum.PERSISTED);
+            er.setPaperStructPath(structFilePath);
+            er.setPaperStructUpload(1);
+            saveOrUpdate(er);
+            //保存作答
+            Map<String, ExamStudentAnswerCacheBean> answerMap = redisUtil.getHashEntries(RedisKeyHelper.examAnswerKey(recordId));
+            for (ExamStudentAnswerCacheBean answerCache : answerMap.values()) {
+                TOeExamAnswer answer = new TOeExamAnswer();
+                BeanUtils.copyProperties(answerCache, answer);
+                answer.setId(Constants.idGen.next());
+                answer.setExamRecordId(recordId);
+                examAnswerService.saveOrUpdate(answer);
+            }
+            //更新考生信息
+            ExamStudentCacheBean examStudentCache = examStudentService.getExamStudentCacheBean(er.getExamStudentId());
+            TEExamStudent examStudent = new TEExamStudent();
+            BeanUtils.copyProperties(examStudentCache, examStudent);
+            examStudentService.saveOrUpdate(examStudent);
+            //上传个人试卷结构
+            ExamStudentPaperStructCacheBean struct = (ExamStudentPaperStructCacheBean) redisUtil.get(RedisKeyHelper.studentPaperStructKey(recordId));
+            File structFile = new File(dir + "struct.json");
             FileUtil.saveAsFile(structFile.getAbsolutePath(), struct.getContent());
             SystemConfig systemConfig = SpringContextHolder.getBean(SystemConfig.class);
             OssUtil.ossUpload(systemConfig.getOssEnv(3), structFilePath, structFile);
         } finally {
             FileUtil.deleteFolder(dir);
         }
-	}
-	private String uuid() {
+    }
+
+    private String uuid() {
         return UUID.randomUUID().toString().replaceAll("-", "");
     }
-	
-	
-	@Override
-	public void saveFaceVerify(ExamTypeEnum type,Long recordId, Long entryAuthenticationId, VerifyExceptionEnum entryAuthenticationResult) {
-		if(ExamTypeEnum.FIRST_START.equals(type)) {
-			ExamRecordCacheUtil.setEntryAuthenticationId(recordId, entryAuthenticationId);
-			ExamRecordCacheUtil.setEntryAuthenticationResult(recordId, entryAuthenticationResult);
-		}else if(ExamTypeEnum.IN_PROCESS.equals(type)) {
-			
-		}
-	}
-	
-	@Override
-	public void saveLivenessVerify(LivenessTypeEnum type,Long recordId, Long entryAuthenticationId, VerifyExceptionEnum entryAuthenticationResult) {
-		if(LivenessTypeEnum.FIRST_START.equals(type)) {
-			ExamRecordCacheUtil.setEntryAuthenticationId(recordId, entryAuthenticationId);
-			ExamRecordCacheUtil.setEntryAuthenticationResult(recordId, entryAuthenticationResult);
-		}else if(LivenessTypeEnum.IN_PROCESS.equals(type)) {
-			Integer count=ExamRecordCacheUtil.getInProcessLivenessVerifyCount(recordId);
-			ExamRecordCacheUtil.setInProcessLivenessVerifyCount(recordId, (count==null?0:count+1));
-		}
-	}
-	
-	@Override
-	public void dataUpdateMq(Long recordId,String colName,Object colValue) {
-		dataUpdateMq(recordId, colName, colValue, 0);
-	}
-	@Override
-	public void dataUpdateMq(Long recordId,String colName,Object colValue,Integer isDate) {
-		Map<String, Object> transMap = new HashMap<String, Object>();
-		transMap.put("recordId", recordId);
+
+
+    @Override
+    public void saveFaceVerify(ExamTypeEnum type, Long recordId, Long entryAuthenticationId, VerifyExceptionEnum entryAuthenticationResult) {
+        if (ExamTypeEnum.FIRST_START.equals(type)) {
+            ExamRecordCacheUtil.setEntryAuthenticationId(recordId, entryAuthenticationId);
+            ExamRecordCacheUtil.setEntryAuthenticationResult(recordId, entryAuthenticationResult);
+        } else if (ExamTypeEnum.IN_PROCESS.equals(type)) {
+
+        }
+    }
+
+    @Override
+    public void saveLivenessVerify(LivenessTypeEnum type, Long recordId, Long entryAuthenticationId, VerifyExceptionEnum entryAuthenticationResult) {
+        if (LivenessTypeEnum.FIRST_START.equals(type)) {
+            ExamRecordCacheUtil.setEntryAuthenticationId(recordId, entryAuthenticationId);
+            ExamRecordCacheUtil.setEntryAuthenticationResult(recordId, entryAuthenticationResult);
+        } else if (LivenessTypeEnum.IN_PROCESS.equals(type)) {
+            Integer count = ExamRecordCacheUtil.getInProcessLivenessVerifyCount(recordId);
+            ExamRecordCacheUtil.setInProcessLivenessVerifyCount(recordId, (count == null ? 0 : count + 1));
+        }
+    }
+
+    @Override
+    public void dataUpdateMq(Long recordId, String colName, Object colValue) {
+        dataUpdateMq(recordId, colName, colValue, 0);
+    }
+
+    @Override
+    public void dataUpdateMq(Long recordId, String colName, Object colValue, Integer isDate) {
+        Map<String, Object> transMap = new HashMap<String, Object>();
+        transMap.put("recordId", recordId);
         transMap.put("colName", colName);
         transMap.put("colValue", colValue);
         transMap.put("isDate", isDate);
         //mq发送消息start
         MqDto mqDto = new MqDto(MqTopicEnum.themisTopic.getCode(), MqTagEnum.EXAM_RECORD_UPDATE.name(), transMap, MqTagEnum.EXAM_RECORD_UPDATE, recordId.toString(), colName);
         mqDtoService.assembleSendOneWayMsg(mqDto);
-	}
-
-	@Transactional
-	@Override
-	public void dataUpdate(Long recordId, String colName, Object colValue,Integer isDate) {
-		if(isDate!=null&&isDate.intValue()==1) {
-			Long l=(Long)colValue;
-			Date d=new Date(l);
-			tOeExamRecordMapper.dataUpdate(recordId, colName, d);
-		}else {
-			tOeExamRecordMapper.dataUpdate(recordId, colName, colValue);
-		}
-	}
-	
-	@Override
-	public void dataInitMq(Map<String, Object> param) {
-		Long id=(Long)param.get("id");
+    }
+
+    @Transactional
+    @Override
+    public void dataUpdate(Long recordId, String colName, Object colValue, Integer isDate) {
+        if (isDate != null && isDate.intValue() == 1) {
+            Long l = (Long) colValue;
+            Date d = new Date(l);
+            tOeExamRecordMapper.dataUpdate(recordId, colName, d);
+        } else {
+            tOeExamRecordMapper.dataUpdate(recordId, colName, colValue);
+        }
+    }
+
+    @Override
+    public void dataInitMq(Map<String, Object> param) {
+        Long id = (Long) param.get("id");
         //mq发送消息start
         MqDto mqDto = new MqDto(MqTopicEnum.themisTopic.getCode(), MqTagEnum.EXAM_RECORD_INIT.name(), param, MqTagEnum.EXAM_RECORD_INIT, id.toString(), id.toString());
         mqDtoService.assembleSendOneWayMsg(mqDto);
-	}
-
-	@Transactional
-	@Override
-	public void dataInit(Map<String, Object> param) {
-		TOeExamRecord tr=new TOeExamRecord();
-		tr.setId((Long)param.get("id"));
-		tr.setExamId((Long)param.get("examId"));
-		tr.setExamActivityId((Long)param.get("examActivityId"));
-		tr.setExamStudentId((Long)param.get("examStudentId"));
-		tr.setPaperId((Long)param.get("paperId"));
-		tr.setSerialNumber((Integer)param.get("serialNumber"));
-		tr.setFirstPrepareTime(new Date((Long)param.get("firstPrepareTime")));
-		tr.setStatus(ExamRecordStatusEnum.valueOf((String)param.get("status")));
-		tr.setObjectiveScore(0.0);
-		saveOrUpdate(tr);
-	}
-	
-	@Override
-	public BasePage invigilatePageList(InvigilateListQueryBean param) {
-		Page<InvigilateListBean> ipage=new Page<>(param.getPageNumber(), param.getPageSize());
-		ipage.addOrder(OrderItem.asc("t.id"));
-		tOeExamRecordMapper.invigilatePageQuery(ipage, param);
-        BasePage page = new BasePage(ipage.getRecords(), ipage.getCurrent(), ipage.getSize(), ipage.getTotal());
-        return page;
-	}
+    }
+
+    @Transactional
+    @Override
+    public void dataInit(Map<String, Object> param) {
+        TOeExamRecord tr = new TOeExamRecord();
+        tr.setId((Long) param.get("id"));
+        tr.setExamId((Long) param.get("examId"));
+        tr.setExamActivityId((Long) param.get("examActivityId"));
+        tr.setExamStudentId((Long) param.get("examStudentId"));
+        tr.setPaperId((Long) param.get("paperId"));
+        tr.setSerialNumber((Integer) param.get("serialNumber"));
+        tr.setFirstPrepareTime(new Date((Long) param.get("firstPrepareTime")));
+        tr.setStatus(ExamRecordStatusEnum.valueOf((String) param.get("status")));
+        tr.setObjectiveScore(0.0);
+        saveOrUpdate(tr);
+    }
+
+    /**
+     * 查询实时监控台列表
+     *
+     * @param iPage
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param paperDownload
+     * @param status
+     * @param name
+     * @param identity
+     * @param minWarningCount
+     * @param maxWarningCount
+     * @param clientWebsocketStatus
+     * @param monitorStatusSource
+     * @return
+     */
+    @Override
+    public IPage<InvigilateListBean> invigilatePageList(IPage<Map> iPage, Long examId,
+                                                        Long examActivityId,
+                                                        String roomCode,
+                                                        Integer paperDownload,
+                                                        String status,
+                                                        String name,
+                                                        String identity,
+                                                        Integer minWarningCount,
+                                                        Integer maxWarningCount,
+                                                        String clientWebsocketStatus,
+                                                        String monitorStatusSource) {
+        return tOeExamRecordMapper.invigilatePageQuery(iPage, examId, examActivityId, roomCode, paperDownload, status, name, identity, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource);
+    }
 }

+ 127 - 111
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -1,119 +1,135 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!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.TOeExamRecordMapper">
+        namespace="com.qmth.themis.business.dao.TOeExamRecordMapper">
 
-	<select id="getUnFinishExam"
-		resultType="com.qmth.themis.business.dto.response.TEExamUnFinishDto">
-		select
-		tee.id,
-		teea.id as examActivityId,
-		toer.id as recordId,
-		tees.id as
-		examStudentId,
-		tee.name,
-		tee.mode,
-		tee.pre_notice as preNotice,
-		tee.pre_notice_stay_seconds as preNoticeStaySeconds,
-		tee.post_notice as
-		postNotice,
-		tee.code as examCode,
-		teea.code as examActivityCode,
-		tee.start_time as examStartTime,
-		tee.end_time as examEndTime,
-		teea.start_time as examActivityStartTime,
-		teea.finish_time as
-		examActivityFinishTime,
-		tees.course_code as courseCode,
-		teec.course_name as courseName,
-		tee.prepare_seconds as prepareSeconds,
-		tee.min_duration_seconds as minDurationSeconds,
-		tee.max_duration_seconds as maxDurationSeconds,
-		tee.exam_count as
-		examCount,
-		tee.force_finish as fouceFinish,
-		tee.entry_authentication_policy as entryAuthenticationPolicy,
-		tee.in_process_face_verify as inProcessFaceVerify,
-		tee.in_process_face_stranger_ignore as inProcessFaceStrangerIgnore,
-		tee.in_process_liveness_verify as inProcessLivenessVerify,
-		tee.in_process_liveness_fixed_range as inProcessLivenessFixedRange,
-		tee.in_process_liveness_judge_policy as inProcessLivenessJudgePolicy,
-		tee.camera_photo_upload as cameraPhotoUpload,
-		tee.mobile_photo_upload
-		as mobilePhotoUpload,
-		tee.break_expire_seconds as breakExpireSeconds,
-		tee.break_resume_count as breakResumeCount,
-		toer.duration_seconds as
-		durationSeconds,
-		toer.client_last_sync_time as clientLastSyncTime
-		from
-		t_oe_exam_record toer
-		left join t_e_exam_student tees on
-		tees.id =
-		toer.exam_student_id
-		left join t_e_exam_course teec on
-		teec.course_code
-		= tees.course_code
-		left join t_e_exam tee on
-		tee.id = tees.exam_id
-		left
-		join t_e_exam_activity teea on
-		teea.id = tees.exam_activity_id
-		<where>
-			<if test="studentId != null and studentId != ''">
-				and tees.student_id = #{studentId}
-			</if>
-			and tee.enable = 1
-			and teea.enable = 1
-			and tees.enable = 1
-			<if test="orgId != null and orgId != ''">
-				and tee.org_id = #{orgId}
-			</if>
-			<if test="examId != null and examId != ''">
-				and tee.id = #{examId}
-			</if>
-		</where>
-	</select>
-	<update id="dataUpdate">
+    <select id="getUnFinishExam"
+            resultType="com.qmth.themis.business.dto.response.TEExamUnFinishDto">
+        select
+        tee.id,
+        teea.id as examActivityId,
+        toer.id as recordId,
+        tees.id as
+        examStudentId,
+        tee.name,
+        tee.mode,
+        tee.pre_notice as preNotice,
+        tee.pre_notice_stay_seconds as preNoticeStaySeconds,
+        tee.post_notice as
+        postNotice,
+        tee.code as examCode,
+        teea.code as examActivityCode,
+        tee.start_time as examStartTime,
+        tee.end_time as examEndTime,
+        teea.start_time as examActivityStartTime,
+        teea.finish_time as
+        examActivityFinishTime,
+        tees.course_code as courseCode,
+        teec.course_name as courseName,
+        tee.prepare_seconds as prepareSeconds,
+        tee.min_duration_seconds as minDurationSeconds,
+        tee.max_duration_seconds as maxDurationSeconds,
+        tee.exam_count as
+        examCount,
+        tee.force_finish as fouceFinish,
+        tee.entry_authentication_policy as entryAuthenticationPolicy,
+        tee.in_process_face_verify as inProcessFaceVerify,
+        tee.in_process_face_stranger_ignore as inProcessFaceStrangerIgnore,
+        tee.in_process_liveness_verify as inProcessLivenessVerify,
+        tee.in_process_liveness_fixed_range as inProcessLivenessFixedRange,
+        tee.in_process_liveness_judge_policy as inProcessLivenessJudgePolicy,
+        tee.camera_photo_upload as cameraPhotoUpload,
+        tee.mobile_photo_upload
+        as mobilePhotoUpload,
+        tee.break_expire_seconds as breakExpireSeconds,
+        tee.break_resume_count as breakResumeCount,
+        toer.duration_seconds as
+        durationSeconds,
+        toer.client_last_sync_time as clientLastSyncTime
+        from
+        t_oe_exam_record toer
+        left join t_e_exam_student tees on
+        tees.id =
+        toer.exam_student_id
+        left join t_e_exam_course teec on
+        teec.course_code
+        = tees.course_code
+        left join t_e_exam tee on
+        tee.id = tees.exam_id
+        left
+        join t_e_exam_activity teea on
+        teea.id = tees.exam_activity_id
+        <where>
+            <if test="studentId != null and studentId != ''">
+                and tees.student_id = #{studentId}
+            </if>
+            and tee.enable = 1
+            and teea.enable = 1
+            and tees.enable = 1
+            <if test="orgId != null and orgId != ''">
+                and tee.org_id = #{orgId}
+            </if>
+            <if test="examId != null and examId != ''">
+                and tee.id = #{examId}
+            </if>
+        </where>
+    </select>
+
+    <update id="dataUpdate">
 		update t_oe_exam_record t set
 		t.${colName}=#{colValue} where t.id=#{recordId}
 	</update>
-	<select id="invigilatePageQuery"
-		resultType="com.qmth.themis.business.bean.backend.InvigilateListBean">
-		select t.exam_id examId,t.exam_activity_id
-		examActivityId,t.exam_student_id
-		examStudentId,
-		t.id recordId,s.identity
-		identity,s.room_code roomCode,s.name
-		name,s.course_name
-		courseName,s.course_code courseCode,
-		t.paper_download
-		paperDownload,t.status statusCode,t.answer_progress
-		progress,t.client_current_ip clientCurrentIp,
-		t.warning_count
-		warningCount,t.breach_status breachStatus
-		from t_oe_exam_record t
-		left
-		join t_e_exam_student s on t.exam_student_id=s.id
-		where t.exam_id=#{param.examId} and
-		t.exam_activity_id=#{param.examActivityId} and s.room_code=#{param.roomCode}
-		<if test="param.paperDownload != null">
-			and t.paper_download=#{param.paperDownload}
-		</if>
-		<if test="param.status != null and param.status != ''">
-			and t.status=#{param.status}
-		</if>
-		<if test="param.name != null and param.name !=''">
-			and s.name like CONCAT(#{param.name},'%')
-		</if>
-		<if test="param.identity != null and param.identity !=''">
-			and s.identity like CONCAT(#{param.identity},'%')
-		</if>
-		<if test="param.maxWarningCount != null">
-			and t.warning_count&lt;=#{param.maxWarningCount}
-		</if>
-		<if test="param.minWarningCount != null">
-			and t.warning_count&gt;=#{param.minWarningCount}
-		</if>
-	</select>
+
+    <select id="invigilatePageQuery" resultType="com.qmth.themis.business.bean.backend.InvigilateListBean">
+        select t.exam_id examId,t.exam_activity_id
+        examActivityId,t.exam_student_id
+        examStudentId,
+        t.id recordId,s.identity
+        identity,s.room_code roomCode,s.name
+        name,s.course_name
+        courseName,s.course_code courseCode,
+        t.paper_download
+        paperDownload,t.status statusCode,t.answer_progress
+        progress,t.client_current_ip clientCurrentIp,
+        t.warning_count
+        warningCount,t.breach_status breachStatus
+        from t_oe_exam_record t
+        left
+        join t_e_exam_student s on t.exam_student_id=s.id
+        <where>
+            <if test="examId != null and examId != ''">
+                and t.exam_id = #{examId}
+            </if>
+            <if test="examActivityId != null and examActivityId != ''">
+                and t.exam_activity_id = #{examActivityId}
+            </if>
+            <if test="roomCode != null and roomCode != ''">
+                and t.room_code = #{param.roomCode}
+            </if>
+            <if test="paperDownload != null and paperDownload != ''">
+                and t.paper_download = #{paperDownload}
+            </if>
+            <if test="status != null and param.status != ''">
+                and t.status = #{status}
+            </if>
+            <if test="name != null and name !=''">
+                and s.name like CONCAT(#{name},'%')
+            </if>
+            <if test="identity != null and identity !=''">
+                and s.identity like CONCAT(#{identity},'%')
+            </if>
+            <if test="maxWarningCount != null and maxWarningCount != ''">
+                and t.warning_count &lt;= #{maxWarningCount}
+            </if>
+            <if test="minWarningCount != null and minWarningCount != ''">
+                and t.warning_count &gt;= #{minWarningCount}
+            </if>
+            <if test="clientWebsocketStatus != null and clientWebsocketStatus != ''">
+                and t.client_websocket_status = #{clientWebsocketStatus}
+            </if>
+            <if test="monitorStatusSource != null and monitorStatusSource != ''">
+                and t.monitor_status_source = #{monitorStatusSource}
+            </if>
+        </where>
+    </select>
 </mapper>