فهرست منبع

获取实时监控台列表接口

xiatian 4 سال پیش
والد
کامیت
a95009fd74

+ 1 - 2
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeInvigilateController.java

@@ -66,8 +66,7 @@ public class TIeInvigilateController {
     @ApiOperation(value = "实时监控台列表接口")
     @RequestMapping(value = "/list", method = RequestMethod.POST)
     public Result list(@RequestBody InvigilateListQueryBean param) {
-        log.info("invigilate list is come in");
-        return ResultUtil.ok(SystemConstant.SUCCESS);
+        return ResultUtil.ok(tOeExamRecordService.invigilatePageList(param));
     }
 
     @ApiOperation(value = "实时监控台视频列表接口")

+ 213 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/backend/InvigilateListBean.java

@@ -0,0 +1,213 @@
+package com.qmth.themis.business.bean.backend;
+
+import com.qmth.themis.business.enums.ExamRecordStatusEnum;
+
+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;
+	}
+
+	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 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 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;
+	}
+
+
+	
+}

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

@@ -16,4 +16,137 @@ public class InvigilateListQueryBean {
 
 	@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;
+	}
+	
+	
 }

+ 16 - 5
themis-business/src/main/java/com/qmth/themis/business/dao/TOeExamRecordMapper.java

@@ -1,13 +1,16 @@
 package com.qmth.themis.business.dao;
 
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.qmth.themis.business.dto.response.TEExamUnFinishDto;
-import com.qmth.themis.business.entity.TOeExamRecord;
+import java.util.Map;
+
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
-import java.util.List;
-import java.util.Map;
+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;
 
 /**
  * @Description: 考试记录 Mapper 接口
@@ -35,4 +38,12 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param colValue
      */
     public void dataUpdate(@Param("recordId") Long recordId, @Param("colName") String colName, @Param("colValue") Object colValue);
+
+    /**实时监控台列表
+     * @param recordId
+     * @param colName
+     * @param colValue
+     */
+    public IPage<InvigilateListBean> invigilatePageQuery(IPage<InvigilateListBean> iPage,@Param("param") InvigilateListQueryBean param);
+    
 }

+ 4 - 0
themis-business/src/main/java/com/qmth/themis/business/service/TOeExamRecordService.java

@@ -1,6 +1,8 @@
 package com.qmth.themis.business.service;
 
 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.entity.TOeExamRecord;
 import com.qmth.themis.business.enums.ExamTypeEnum;
 import com.qmth.themis.business.enums.LivenessTypeEnum;
@@ -79,4 +81,6 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
 	 */
 	void dataUpdateMq(Long recordId, String colName, Object colValue, Integer isDate);
 
+	BasePage invigilatePageList(InvigilateListQueryBean param);
+
 }

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

@@ -18,7 +18,12 @@ 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.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;
@@ -428,4 +433,12 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
 		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;
+	}
 }

+ 114 - 64
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -1,69 +1,119 @@
 <?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">
+<mapper
+	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">
-		update t_oe_exam_record t set t.${colName}=#{colValue} where t.id=#{recordId}
+	<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>
 </mapper>