Bladeren bron

监考端接口

wangliang 4 jaren geleden
bovenliggende
commit
ca1f758329

+ 41 - 4
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeInvigilateController.java

@@ -1,6 +1,5 @@
 package com.qmth.themis.backend.api;
 
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -11,7 +10,6 @@ import com.qmth.themis.business.annotation.ApiJsonProperty;
 import com.qmth.themis.business.base.BasePage;
 import com.qmth.themis.business.bean.backend.*;
 import com.qmth.themis.business.cache.RedisKeyHelper;
-import com.qmth.themis.business.cache.bean.ExamCacheBean;
 import com.qmth.themis.business.cache.bean.ExamStudentCacheBean;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.AuthDto;
@@ -29,11 +27,13 @@ import com.qmth.themis.common.util.ResultUtil;
 import io.swagger.annotations.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
 
 /**
  * @Description: 监考信息 前端控制器
@@ -134,6 +134,43 @@ public class TIeInvigilateController {
         return ResultUtil.ok(basePage);
     }
 
+    @ApiOperation(value = "监考明细管理列表接口")
+    @RequestMapping(value = "/history/list", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "监考明细信息", response = InvigilateListHistoryBean.class)})
+    public Result historyList(@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) String courseCode,
+                              @ApiParam(value = "考生状态", required = false) @RequestParam(required = false) String status,
+                              @ApiParam(value = "违纪状态", required = false) @RequestParam(required = false) Integer breachStatus,
+                              @ApiParam(value = "交卷方式", required = false) @RequestParam(required = false) String finishType,
+                              @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);
+        }
+        TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        AuthDto authDto = (AuthDto) redisUtil.get(SystemConstant.userOauth + "::" + tbUser.getId());
+        //如果有监考员角色,只能查看自己所监考的考场,巡考员和管理员则可以查看全部考场
+        Long userId = null;
+        if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
+            userId = tbUser.getId();
+        }
+        IPage<InvigilateListHistoryBean> invigilateListHistoryBeanIPage = tOeExamRecordService.invigilatePageListHistory(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, courseCode, status, breachStatus, finishType, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource, userId);
+        BasePage basePage = new BasePage(invigilateListHistoryBeanIPage.getRecords(), invigilateListHistoryBeanIPage.getCurrent(), invigilateListHistoryBeanIPage.getSize(), invigilateListHistoryBeanIPage.getTotal());
+        return ResultUtil.ok(basePage);
+    }
+
     @ApiOperation(value = "实时监控台列表明细接口")
     @RequestMapping(value = "/list/detail", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "监考监控信息", response = InvigilateListDetailBean.class)})

+ 199 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/backend/InvigilateListHistoryBean.java

@@ -0,0 +1,199 @@
+package com.qmth.themis.business.bean.backend;
+
+import com.qmth.themis.business.enums.ExamRecordStatusEnum;
+import com.qmth.themis.business.enums.FinishTypeEnum;
+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 InvigilateListHistoryBean 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 identity;
+
+    @ApiModelProperty(name = "虚拟考场代码")
+    private String roomCode;
+
+    @ApiModelProperty(name = "虚拟考场名称")
+    private String roomName;
+
+    @ApiModelProperty(name = "姓名")
+    private String name;
+
+    @ApiModelProperty(name = "考生状态")
+    private String status;
+
+    @ApiModelProperty(name = "考生状态值")
+    private ExamRecordStatusEnum statusCode;
+
+    @ApiModelProperty(name = "交卷原因")
+    private FinishTypeEnum finishType;
+
+    @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;
+
+    public FinishTypeEnum getFinishType() {
+        return finishType;
+    }
+
+    public void setFinishType(FinishTypeEnum finishType) {
+        this.finishType = finishType;
+    }
+
+    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 String getRoomName() {
+        return roomName;
+    }
+
+    public void setRoomName(String roomName) {
+        this.roomName = roomName;
+    }
+
+    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;
+    }
+}

+ 48 - 6
themis-business/src/main/java/com/qmth/themis/business/dao/TOeExamRecordMapper.java

@@ -9,7 +9,6 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.Map;
-import java.util.Set;
 
 /**
  * @Description: 考试记录 Mapper 接口
@@ -69,7 +68,7 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
                                                         @Param("maxWarningCount") Integer maxWarningCount,
                                                         @Param("clientWebsocketStatus") String clientWebsocketStatus,
                                                         @Param("monitorStatusSource") String monitorStatusSource,
-                                                        @Param("userId")Long userId);
+                                                        @Param("userId") Long userId);
 
     /**
      * 查询实时监控台视频列表
@@ -100,7 +99,7 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
                                                                   @Param("maxWarningCount") Integer maxWarningCount,
                                                                   @Param("clientWebsocketStatus") String clientWebsocketStatus,
                                                                   @Param("monitorStatusSource") String monitorStatusSource,
-                                                                  @Param("userId")Long userId);
+                                                                  @Param("userId") Long userId);
 
     /**
      * 查询在线巡考列表
@@ -137,7 +136,7 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
                                                                     @Param("maxWarningCount") Integer maxWarningCount,
                                                                     @Param("clientWebsocketStatus") String clientWebsocketStatus,
                                                                     @Param("monitorStatusSource") String monitorStatusSource,
-                                                                    @Param("userId")Long userId);
+                                                                    @Param("userId") Long userId);
 
     /**
      * 预警提醒列表
@@ -174,7 +173,7 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
                                                                       @Param("maxWarningCount") Integer maxWarningCount,
                                                                       @Param("clientWebsocketStatus") String clientWebsocketStatus,
                                                                       @Param("monitorStatusSource") String monitorStatusSource,
-                                                                      @Param("userId")Long userId);
+                                                                      @Param("userId") Long userId);
 
     /**
      * 进度查询列表
@@ -195,5 +194,48 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
                                                                         @Param("courseCode") String courseCode,
                                                                         @Param("name") String name,
                                                                         @Param("identity") String identity,
-                                                                        @Param("userId")Long userId);
+                                                                        @Param("userId") Long userId);
+
+    /**
+     * 监考明细管理列表
+     *
+     * @param iPage
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param courseCode
+     * @param status
+     * @param breachStatus
+     * @param finishType
+     * @param name
+     * @param identity
+     * @param minMultipleFaceCount
+     * @param maxMultipleFaceCount
+     * @param minExceptionCount
+     * @param maxExceptionCount
+     * @param minWarningCount
+     * @param maxWarningCount
+     * @param clientWebsocketStatus
+     * @param monitorStatusSource
+     * @param userId
+     * @return
+     */
+    public IPage<InvigilateListHistoryBean> invigilatePageListHistory(IPage<Map> iPage, @Param("examId") Long examId,
+                                                                      @Param("examActivityId") Long examActivityId,
+                                                                      @Param("roomCode") String roomCode,
+                                                                      @Param("courseCode") String courseCode,
+                                                                      @Param("status") String status,
+                                                                      @Param("breachStatus") Integer breachStatus,
+                                                                      @Param("finishType") String finishType,
+                                                                      @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("userId") Long userId);
 }

+ 43 - 1
themis-business/src/main/java/com/qmth/themis/business/service/TOeExamRecordService.java

@@ -9,7 +9,6 @@ import com.qmth.themis.business.enums.LivenessTypeEnum;
 import com.qmth.themis.business.enums.VerifyExceptionEnum;
 
 import java.util.Map;
-import java.util.Set;
 
 /**
  * @Description: 考试记录 服务类
@@ -250,4 +249,47 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
                                                                         String name,
                                                                         String identity,
                                                                         Long userId);
+
+    /**
+     * 监考明细管理列表
+     *
+     * @param iPage
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param courseCode
+     * @param status
+     * @param breachStatus
+     * @param finishType
+     * @param name
+     * @param identity
+     * @param minMultipleFaceCount
+     * @param maxMultipleFaceCount
+     * @param minExceptionCount
+     * @param maxExceptionCount
+     * @param minWarningCount
+     * @param maxWarningCount
+     * @param clientWebsocketStatus
+     * @param monitorStatusSource
+     * @param userId
+     * @return
+     */
+    public IPage<InvigilateListHistoryBean> invigilatePageListHistory(IPage<Map> iPage, Long examId,
+                                                                      Long examActivityId,
+                                                                      String roomCode,
+                                                                      String courseCode,
+                                                                      String status,
+                                                                      Integer breachStatus,
+                                                                      String finishType,
+                                                                      String name,
+                                                                      String identity,
+                                                                      Integer minMultipleFaceCount,
+                                                                      Integer maxMultipleFaceCount,
+                                                                      Integer minExceptionCount,
+                                                                      Integer maxExceptionCount,
+                                                                      Integer minWarningCount,
+                                                                      Integer maxWarningCount,
+                                                                      String clientWebsocketStatus,
+                                                                      String monitorStatusSource,
+                                                                      Long userId);
 }

+ 29 - 0
themis-business/src/main/java/com/qmth/themis/business/service/impl/TOeExamRecordServiceImpl.java

@@ -533,4 +533,33 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
     public IPage<InvigilateListProgressBean> invigilatePageProgressList(IPage<Map> iPage, Long examId, Long examActivityId, String roomCode, String courseCode, String name, String identity, Long userId) {
         return tOeExamRecordMapper.invigilatePageProgressList(iPage, examId, examActivityId, roomCode, courseCode, name, identity, userId);
     }
+
+    /**
+     * 监考明细管理列表
+     *
+     * @param iPage
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param courseCode
+     * @param status
+     * @param breachStatus
+     * @param finishType
+     * @param name
+     * @param identity
+     * @param minMultipleFaceCount
+     * @param maxMultipleFaceCount
+     * @param minExceptionCount
+     * @param maxExceptionCount
+     * @param minWarningCount
+     * @param maxWarningCount
+     * @param clientWebsocketStatus
+     * @param monitorStatusSource
+     * @param userId
+     * @return
+     */
+    @Override
+    public IPage<InvigilateListHistoryBean> invigilatePageListHistory(IPage<Map> iPage, Long examId, Long examActivityId, String roomCode, String courseCode, String status, Integer breachStatus, String finishType, String name, String identity, Integer minMultipleFaceCount, Integer maxMultipleFaceCount, Integer minExceptionCount, Integer maxExceptionCount, Integer minWarningCount, Integer maxWarningCount, String clientWebsocketStatus, String monitorStatusSource, Long userId) {
+        return tOeExamRecordMapper.invigilatePageListHistory(iPage, examId, examActivityId, roomCode, courseCode, status, breachStatus, finishType, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource, userId);
+    }
 }

+ 20 - 1
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -153,6 +153,7 @@
         <include refid="invigilatePageHead" />
         <include refid="invigilatePageMiddle" />
         <include refid="invigilatePageFoot" />
+            and t.status = 'ANSWERING'
         <if test="paperDownload != null and paperDownload != ''">
             and t.paper_download = #{paperDownload}
         </if>
@@ -164,6 +165,7 @@
         ,t.monitor_live_url as monitorLiveUrl
         <include refid="invigilatePageMiddle" />
         <include refid="invigilatePageFoot" />
+            and t.status = 'ANSWERING'
         <if test="paperDownload != null and paperDownload != ''">
             and t.paper_download = #{paperDownload}
         </if>
@@ -176,7 +178,8 @@
         ,(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
+        <include refid="invigilatePageFoot" />
+            and t.status = 'ANSWERING' ) t
         <where>
             <if test="minMultipleFaceCount != null and minMultipleFaceCount != ''">
                 and t.multipleFaceCount &lt;= #{minMultipleFaceCount}
@@ -329,4 +332,20 @@
         </where>
             order by tees.room_code
     </select>
+
+    <select id="invigilatePageListHistory" resultType="com.qmth.themis.business.bean.backend.InvigilateListHistoryBean">
+        <include refid="invigilatePageHead" />
+        <include refid="invigilatePageMiddle" />
+        <include refid="invigilatePageFoot" />
+        <if test="breachStatus != null and breachStatus != '' or breachStatus == 0">
+            and t.breach_status = #{breachStatus}
+        </if>
+        <if test="finishType != null and finishType != ''">
+            and t.finish_type = #{finishType}
+        </if>
+        <if test="courseCode != null and courseCode != ''">
+            and tees.course_code like CONCAT(#{courseCode},'%')
+        </if>
+        order by s.room_code
+    </select>
 </mapper>