Sfoglia il codice sorgente

Merge branch 'dev'
1

wangliang 4 anni fa
parent
commit
180440d4b3

+ 33 - 19
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeInvigilateController.java

@@ -126,26 +126,28 @@ public class TIeInvigilateController {
             if (Objects.nonNull(examCacheBean.getMonitorVideoSource()) && !Objects.equals(examCacheBean.getMonitorVideoSource().toString().trim().replaceAll(" ", ""), "")) {
                 monitorVideoSourceList = Arrays.asList(examCacheBean.getMonitorVideoSource().trim().toUpperCase().replaceAll(" ", "").split(","));
             }
-            if (Objects.nonNull(monitorVideoSourceList) && monitorVideoSourceList.size() > 0 && Objects.nonNull(invigilateListVideoBeanList) && invigilateListVideoBeanList.size() > 0) {
+            if (Objects.nonNull(invigilateListVideoBeanList) && invigilateListVideoBeanList.size() > 0) {
                 List<String> finalMonitorVideoSourceList = monitorVideoSourceList;
                 invigilateListVideoBeanList.forEach(s -> {
-                    finalMonitorVideoSourceList.forEach(l -> {
-                        MonitorVideoSourceEnum source = MonitorVideoSourceEnum.valueOf(l);
-                        switch (source.ordinal()) {
-                            case 0:
-                                s.setScreenMonitorStatusSource(ExamRecordCacheUtil.getMonitorStatus(s.getExamRecordId(), source.name()));
-                                break;
-                            case 1:
-                                s.setCameraMonitorStatusSource(ExamRecordCacheUtil.getMonitorStatus(s.getExamRecordId(), source.name()));
-                                break;
-                            case 2:
-                                s.setMobileFirstMonitorStatusSource(ExamRecordCacheUtil.getMonitorStatus(s.getExamRecordId(), source.name()));
-                                break;
-                            default:
-                                s.setMobileSecondMonitorStatusSource(ExamRecordCacheUtil.getMonitorStatus(s.getExamRecordId(), source.name()));
-                                break;
-                        }
-                    });
+                    if (Objects.nonNull(finalMonitorVideoSourceList) && finalMonitorVideoSourceList.size() > 0) {
+                        finalMonitorVideoSourceList.forEach(l -> {
+                            MonitorVideoSourceEnum source = MonitorVideoSourceEnum.valueOf(l);
+                            switch (source.ordinal()) {
+                                case 0:
+                                    s.setScreenMonitorStatusSource(ExamRecordCacheUtil.getMonitorStatus(s.getExamRecordId(), source.name()));
+                                    break;
+                                case 1:
+                                    s.setCameraMonitorStatusSource(ExamRecordCacheUtil.getMonitorStatus(s.getExamRecordId(), source.name()));
+                                    break;
+                                case 2:
+                                    s.setMobileFirstMonitorStatusSource(ExamRecordCacheUtil.getMonitorStatus(s.getExamRecordId(), source.name()));
+                                    break;
+                                default:
+                                    s.setMobileSecondMonitorStatusSource(ExamRecordCacheUtil.getMonitorStatus(s.getExamRecordId(), source.name()));
+                                    break;
+                            }
+                        });
+                    }
                     MonitorVideoSourceEnum source = MonitorVideoSourceEnum.CLIENT_CAMERA;
                     if (Objects.nonNull(monitorVideoSource)) {
                         source = MonitorVideoSourceEnum.valueOf(monitorVideoSource);
@@ -371,7 +373,19 @@ public class TIeInvigilateController {
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
             userId = tbUser.getId();
         }
-        return ResultUtil.ok(tOeExamRecordService.invigilatePagePatrolList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, status, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, clientWebsocketStatus, userId));
+        IPage<InvigilateListPatrolBean> invigilateListPatrolBeanIPage = tOeExamRecordService.invigilatePagePatrolList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, status, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, clientWebsocketStatus, userId);
+        if (Objects.nonNull(invigilateListPatrolBeanIPage)) {
+            List<InvigilateListPatrolBean> invigilateListPatrolBeanList = invigilateListPatrolBeanIPage.getRecords();
+            if (Objects.nonNull(invigilateListPatrolBeanList) && invigilateListPatrolBeanList.size() > 0) {
+                invigilateListPatrolBeanList.forEach(s -> {
+                    WebsocketStatusEnum websocketStatusEnum = ExamRecordCacheUtil.getClientWebsocketStatus(s.getExamRecordId());
+                    if (Objects.nonNull(websocketStatusEnum)) {
+                        s.setClientWebsocketStatus(websocketStatusEnum);
+                    }
+                });
+            }
+        }
+        return ResultUtil.ok(invigilateListPatrolBeanIPage);
     }
 
     @ApiOperation(value = "进度查询列表接口")

+ 21 - 24
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeReportController.java

@@ -1,23 +1,17 @@
 package com.qmth.themis.backend.api;
 
-import javax.annotation.Resource;
-
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
 import com.qmth.themis.business.bean.backend.InvigilateListPatrolReportBean;
 import com.qmth.themis.business.service.TIeReportService;
 import com.qmth.themis.business.util.RedisUtil;
 import com.qmth.themis.common.util.Result;
 import com.qmth.themis.common.util.ResultUtil;
+import io.swagger.annotations.*;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
+import javax.annotation.Resource;
 
 /**
  * 监考报表
@@ -63,7 +57,6 @@ public class TIeReportController {
         return ResultUtil.ok(reportService.examViewCount(examId, examActivityId, roomCode, courseCode, name, identity, pageNumber, pageSize));
     }
 
-
     @ApiOperation(value = "缺考名单")
     @RequestMapping(value = "/exam_deficiency_list", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
@@ -95,8 +88,9 @@ public class TIeReportController {
     @ApiOperation(value = "异常处理明细")
     @RequestMapping(value = "/exam_exception_list_detail", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
-    public Result examExceptionListDetail(@ApiParam(value = "考生id", required = true) @RequestParam Long examStudentId) {
-        return ResultUtil.ok(reportService.examExceptionDetailList(examStudentId));
+    public Result examExceptionListDetail(@ApiParam(value = "考生id", required = true) @RequestParam Long examStudentId, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
+                                          @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+        return ResultUtil.ok(reportService.examExceptionDetailList(examStudentId, pageNumber, pageSize));
     }
 
     @ApiOperation(value = "重考处理")
@@ -130,8 +124,9 @@ public class TIeReportController {
     @ApiOperation(value = "违纪名单明细")
     @RequestMapping(value = "/exam_breach_list_detail", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
-    public Result examBreachListDetail(@ApiParam(value = "考生id", required = true) @RequestParam Long examStudentId) {
-        return ResultUtil.ok(reportService.examBreachListDetail(examStudentId));
+    public Result examBreachListDetail(@ApiParam(value = "考生id", required = true) @RequestParam Long examStudentId, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
+                                       @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+        return ResultUtil.ok(reportService.examBreachListDetail(examStudentId, 0, pageNumber, pageSize));
     }
 
     @ApiOperation(value = "撤销违纪名单")
@@ -151,8 +146,9 @@ public class TIeReportController {
     @ApiOperation(value = "撤销违纪名单明细")
     @RequestMapping(value = "/exam_revoke_breach_list_detail", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
-    public Result examRevokeBreachListDetail(@ApiParam(value = "考生id", required = true) @RequestParam Long examStudentId) {
-        return ResultUtil.ok(reportService.examRevokeBreachListDetail(examStudentId));
+    public Result examRevokeBreachListDetail(@ApiParam(value = "考生id", required = true) @RequestParam Long examStudentId, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
+                                             @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+        return ResultUtil.ok(reportService.examRevokeBreachListDetail(examStudentId, 1, pageNumber, pageSize));
     }
 
     @ApiOperation(value = "考生日志")
@@ -172,8 +168,9 @@ public class TIeReportController {
     @ApiOperation(value = "考生日志明细")
     @RequestMapping(value = "/exam_student_log_list_detail", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
-    public Result examStudentLogListDetail(@ApiParam(value = "考生id", required = true) @RequestParam Long examStudentId) {
-        return ResultUtil.ok(reportService.examStudentLogListDetail(examStudentId));
+    public Result examStudentLogListDetail(@ApiParam(value = "考生id", required = true) @RequestParam Long examStudentId, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
+                                           @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+        return ResultUtil.ok(reportService.examStudentLogListDetail(examStudentId, pageNumber, pageSize));
     }
 
     @ApiOperation(value = "在线巡考报表接口")
@@ -189,21 +186,21 @@ public class TIeReportController {
     public Result examinationMonitorCount() {
         return ResultUtil.ok(reportService.examinationMonitorCount());
     }
-    
+
     @ApiOperation(value = "考情监控-预警分布")
     @RequestMapping(value = "/examination_monitor/warn_distribution", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
     public Result warnDistribution() {
         return ResultUtil.ok(reportService.warnDistribution());
     }
-    
+
     @ApiOperation(value = "考情监控-预警时间趋势")
     @RequestMapping(value = "/examination_monitor/warn_trend", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
     public Result warnTrend() {
         return ResultUtil.ok(reportService.warnTrend());
     }
-    
+
     @ApiOperation(value = "考情监控-预警消息")
     @RequestMapping(value = "/examination_monitor/warn_msg", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})

+ 6 - 9
themis-business/src/main/java/com/qmth/themis/business/bean/backend/ExamBreachDetailListBean.java

@@ -19,8 +19,8 @@ public class ExamBreachDetailListBean {
     @ApiModelProperty(name = "类型原因")
     private String type;
 
-    @ApiModelProperty(name = "备注")
-    private String remark;
+    @ApiModelProperty(name = "描述")
+    private String description;
 
 	public String getStatus() {
 		return status;
@@ -54,14 +54,11 @@ public class ExamBreachDetailListBean {
 		this.type = type;
 	}
 
-	public String getRemark() {
-		return remark;
+	public String getDescription() {
+		return description;
 	}
 
-	public void setRemark(String remark) {
-		this.remark = remark;
+	public void setDescription(String description) {
+		this.description = description;
 	}
-
-    
-    
 }

+ 12 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/backend/InvigilateListPatrolBean.java

@@ -3,6 +3,7 @@ package com.qmth.themis.business.bean.backend;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.qmth.themis.business.enums.ExamRecordStatusEnum;
+import com.qmth.themis.business.enums.WebsocketStatusEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -89,6 +90,17 @@ public class InvigilateListPatrolBean implements Serializable {
     @ApiModelProperty(name = "剩余时间")
     private String remainTime;
 
+    @ApiModelProperty(name = "客户端网络通信状态")
+    private WebsocketStatusEnum clientWebsocketStatus;
+
+    public WebsocketStatusEnum getClientWebsocketStatus() {
+        return clientWebsocketStatus;
+    }
+
+    public void setClientWebsocketStatus(WebsocketStatusEnum clientWebsocketStatus) {
+        this.clientWebsocketStatus = clientWebsocketStatus;
+    }
+
     public Double getProgress() {
         return progress;
     }

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/dao/TEExamBreachLogMapper.java

@@ -24,7 +24,7 @@ public interface TEExamBreachLogMapper extends BaseMapper<TEExamBreachLog> {
 			@Param("activityId") Long activityId, @Param("roomCode") String roomCode,
 			@Param("courseCode") String courseCode, @Param("name") String name, @Param("identity") String identity);
 	
-	public List<ExamBreachDetailListBean> getExamBreachDetailList(@Param("examStudentId") Long examStudentId);
+	public IPage<ExamBreachDetailListBean> getExamBreachDetailList(IPage<ExamBreachDetailListBean> iPage,@Param("examStudentId") Long examStudentId,@Param("status") Integer status);
 
 	public IPage<ExamBreachListBean> getExamRevokeBreachPage(IPage<ExamBreachListBean> iPage, @Param("examId") Long examId,
 			@Param("activityId") Long activityId, @Param("roomCode") String roomCode,

+ 3 - 1
themis-business/src/main/java/com/qmth/themis/business/dao/TEExamStudentLogMapper.java

@@ -2,6 +2,8 @@ package com.qmth.themis.business.dao;
 
 import java.util.List;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.qmth.themis.business.bean.backend.ExamBreachDetailListBean;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -18,5 +20,5 @@ import com.qmth.themis.business.entity.TEExamStudentLog;
  */
 @Mapper
 public interface TEExamStudentLogMapper extends BaseMapper<TEExamStudentLog> {
-	public List<ExamStudentLogDetailListBean> getExamStudentLogList(@Param("examStudentId") Long examStudentId);
+	public IPage<ExamStudentLogDetailListBean> getExamStudentLogList(IPage<ExamStudentLogDetailListBean> iPage, @Param("examStudentId") Long examStudentId);
 }

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/dao/TIeInvigilateExceptionInfoMapper.java

@@ -24,5 +24,5 @@ public interface TIeInvigilateExceptionInfoMapper extends BaseMapper<TIeInvigila
 			@Param("activityId") Long activityId, @Param("roomCode") String roomCode,
 			@Param("courseCode") String courseCode, @Param("name") String name, @Param("identity") String identity);
 	
-	public List<ExamExceptionDetailListBean> getExamExceptionDetailList(@Param("examStudentId") Long examStudentId);
+	public IPage<ExamExceptionDetailListBean> getExamExceptionDetailList(IPage<ExamExceptionDetailListBean> iPage, @Param("examStudentId") Long examStudentId);
 }

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

@@ -19,7 +19,7 @@ public interface TIeReportService {
     public IPage examExceptionList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                    String identity, int pageNumber, int pageSize);
 
-    public List<ExamExceptionDetailListBean> examExceptionDetailList(Long examStudentId);
+    public IPage<ExamExceptionDetailListBean> examExceptionDetailList(Long examStudentId, int pageNumber, int pageSize);
 
     public IPage examReexamList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                 String identity, int pageNumber, int pageSize);
@@ -27,17 +27,17 @@ public interface TIeReportService {
     public IPage examBreachList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                 String identity, int pageNumber, int pageSize);
 
-    public List<ExamBreachDetailListBean> examBreachListDetail(Long examStudentId);
+    public IPage<ExamBreachDetailListBean> examBreachListDetail(Long examStudentId, Integer status, int pageNumber, int pageSize);
 
     public IPage examRevokeBreachList(Long examId, Long examActivityId, String roomCode, String courseCode,
                                       String name, String identity, int pageNumber, int pageSize);
 
-    public List<ExamBreachDetailListBean> examRevokeBreachListDetail(Long examStudentId);
+    public IPage<ExamBreachDetailListBean> examRevokeBreachListDetail(Long examStudentId, Integer status, int pageNumber, int pageSize);
 
     public IPage examStudentLogList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                     String identity, int pageNumber, int pageSize);
 
-    public List<ExamStudentLogDetailListBean> examStudentLogListDetail(Long examStudentId);
+    public IPage<ExamStudentLogDetailListBean> examStudentLogListDetail(Long examStudentId, int pageNumber, int pageSize);
 
     /**
      * 在线巡考报表接口

+ 32 - 25
themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeReportServiceImpl.java

@@ -10,6 +10,7 @@ import com.qmth.themis.business.cache.bean.ExamCacheBean;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dao.*;
 import com.qmth.themis.business.entity.TEExamActivity;
+import com.qmth.themis.business.enums.BreachCancelTypeEnum;
 import com.qmth.themis.business.enums.BreachTypeEnum;
 import com.qmth.themis.business.enums.ExceptionEnum;
 import com.qmth.themis.business.enums.VerifyExceptionEnum;
@@ -239,14 +240,16 @@ public class TIeReportServiceImpl implements TIeReportService {
     }
 
     @Override
-    public List<ExamExceptionDetailListBean> examExceptionDetailList(Long examStudentId) {
-        List<ExamExceptionDetailListBean> ret = invigilateExceptionInfoMapper.getExamExceptionDetailList(examStudentId);
-        if (ret != null && ret.size() > 0) {
-            for (ExamExceptionDetailListBean b : ret) {
-                b.setReason(ExceptionEnum.valueOf(b.getReason()).getCode());
-            }
+    public IPage<ExamExceptionDetailListBean> examExceptionDetailList(Long examStudentId, int pageNumber, int pageSize) {
+        IPage<ExamExceptionDetailListBean> total = invigilateExceptionInfoMapper.getExamExceptionDetailList(new Page<>(pageNumber, pageSize), examStudentId);
+        List<ExamExceptionDetailListBean> data = total.getRecords();
+        if (data == null || data.size() == 0) {
+            return total;
         }
-        return ret;
+        for (ExamExceptionDetailListBean b : data) {
+            b.setReason(ExceptionEnum.valueOf(b.getReason()).getCode());
+        }
+        return total;
     }
 
     @Override
@@ -286,16 +289,18 @@ public class TIeReportServiceImpl implements TIeReportService {
     }
 
     @Override
-    public List<ExamBreachDetailListBean> examBreachListDetail(Long examStudentId) {
-        List<ExamBreachDetailListBean> ret = examBreachLogMapper.getExamBreachDetailList(examStudentId);
-        if (ret != null && ret.size() > 0) {
-            for (ExamBreachDetailListBean b : ret) {
-                if (StringUtils.isNotBlank(b.getType())) {
-                    b.setType(BreachTypeEnum.valueOf(b.getType()).getCode());
-                }
+    public IPage<ExamBreachDetailListBean> examBreachListDetail(Long examStudentId, Integer status, int pageNumber, int pageSize) {
+        IPage<ExamBreachDetailListBean> total = examBreachLogMapper.getExamBreachDetailList(new Page<>(pageNumber, pageSize), examStudentId, status);
+        List<ExamBreachDetailListBean> data = total.getRecords();
+        if (data == null || data.size() == 0) {
+            return total;
+        }
+        for (ExamBreachDetailListBean b : data) {
+            if (StringUtils.isNotBlank(b.getType())) {
+                b.setType(BreachTypeEnum.valueOf(b.getType()).getCode());
             }
         }
-        return ret;
+        return total;
     }
 
     @Override
@@ -317,16 +322,18 @@ public class TIeReportServiceImpl implements TIeReportService {
     }
 
     @Override
-    public List<ExamBreachDetailListBean> examRevokeBreachListDetail(Long examStudentId) {
-        List<ExamBreachDetailListBean> ret = examBreachLogMapper.getExamBreachDetailList(examStudentId);
-        if (ret != null && ret.size() > 0) {
-            for (ExamBreachDetailListBean b : ret) {
-                if (StringUtils.isNotBlank(b.getType())) {
-                    b.setType(BreachTypeEnum.valueOf(b.getType()).getCode());
-                }
+    public IPage<ExamBreachDetailListBean> examRevokeBreachListDetail(Long examStudentId, Integer status, int pageNumber, int pageSize) {
+        IPage<ExamBreachDetailListBean> total = examBreachLogMapper.getExamBreachDetailList(new Page<>(pageNumber, pageSize), examStudentId, status);
+        List<ExamBreachDetailListBean> data = total.getRecords();
+        if (data == null || data.size() == 0) {
+            return total;
+        }
+        for (ExamBreachDetailListBean b : data) {
+            if (StringUtils.isNotBlank(b.getType())) {
+                b.setType(BreachCancelTypeEnum.valueOf(b.getType()).getCode());
             }
         }
-        return ret;
+        return total;
     }
 
     @Override
@@ -348,8 +355,8 @@ public class TIeReportServiceImpl implements TIeReportService {
     }
 
     @Override
-    public List<ExamStudentLogDetailListBean> examStudentLogListDetail(Long examStudentId) {
-        return examStudentLogMapper.getExamStudentLogList(examStudentId);
+    public IPage<ExamStudentLogDetailListBean> examStudentLogListDetail(Long examStudentId, int pageNumber, int pageSize) {
+        return examStudentLogMapper.getExamStudentLogList(new Page<>(pageNumber, pageSize), examStudentId);
     }
 
     /**

+ 5 - 3
themis-business/src/main/resources/mapper/TEExamBreachLogMapper.xml

@@ -1,7 +1,7 @@
 <?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.TEExamBreachLogMapper">
+<mapper namespace="com.qmth.themis.business.dao.TEExamBreachLogMapper">
+
 	<select id="getExamBreachPage"
 		resultType="com.qmth.themis.business.bean.backend.ExamBreachListBean">
 		SELECT
@@ -38,6 +38,7 @@
 			and t.name like concat(#{name},'%')
 		</if>
 	</select>
+
 	<select id="getExamRevokeBreachPage"
 		resultType="com.qmth.themis.business.bean.backend.ExamBreachListBean">
 		SELECT
@@ -84,13 +85,14 @@
 		f.update_time
 		endTime,
 		f.type type,
-		f.remark remark
+		f.description description
 		FROM
 		t_e_exam_breach_log f
 		left join
 		t_b_user t on f.create_id=t.id
 		where f.exam_student_id
 		=#{examStudentId}
+		and f.status = #{status}
 		order by f.create_time
 	</select>
 </mapper>

+ 3 - 11
themis-business/src/main/resources/mapper/TIeInvigilateExceptionInfoMapper.xml

@@ -1,6 +1,7 @@
 <?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.TIeInvigilateExceptionInfoMapper">
+
 <select id="getExamExceptionPage"
 		resultType="com.qmth.themis.business.bean.backend.ExamExceptionListBean">
 		SELECT
@@ -14,13 +15,7 @@
 		t.identity,
 		t.room_name roomName,
 		count(f.exam_student_id) exceptionCount,
-		sum(
-		timestampdiff(
-		MINUTE,
-		f.create_time,
-		f.update_time
-		)
-		) exceptionTotalTime
+		sum(f.difference) exceptionTotalTime
 		FROM
 		t_ie_invigilate_exception_info f
 		LEFT JOIN t_e_exam_student t ON f.exam_student_id = t.id
@@ -49,10 +44,7 @@
 		f.create_time startTime,
 		f.update_time endTime,
 		f.type reason,
-		timestampdiff(
-		MINUTE,
-		f.create_time,
-		f.update_time) totalTime
+		f.difference totalTime
 		FROM
 		t_ie_invigilate_exception_info f
 		where f.exam_student_id =#{examStudentId}

+ 7 - 9
themis-exam/src/main/java/com/qmth/themis/exam/api/TEExamController.java

@@ -11,12 +11,10 @@ import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.MqDto;
 import com.qmth.themis.business.dto.cache.TEStudentCacheDto;
 import com.qmth.themis.business.dto.response.TEExamDto;
-import com.qmth.themis.business.dto.response.TEExamResultDto;
 import com.qmth.themis.business.entity.TEExam;
 import com.qmth.themis.business.enums.*;
 import com.qmth.themis.business.service.MqDtoService;
 import com.qmth.themis.business.service.TEExamService;
-import com.qmth.themis.business.service.TEExamStudentService;
 import com.qmth.themis.business.util.JacksonUtil;
 import com.qmth.themis.business.util.RedisUtil;
 import com.qmth.themis.business.util.ServletUtil;
@@ -46,14 +44,11 @@ public class TEExamController {
     @Resource
     MqDtoService mqDtoService;
 
-    @Resource
-    TEExamStudentService teExamStudentService;
-
     @ApiOperation(value = "验证考试口令接口")
     @RequestMapping(value = "/short_code", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "考试信息", response = TEExam.class)})
     public Result shortCode(@ApiJsonObject(name = "shortCode", value = {
-            @ApiJsonProperty(key = "shortCode", description = "考试口令"),
+            @ApiJsonProperty(key = "shortCode", description = "考试口令")
     }) @ApiParam(value = "考试口令", required = true) @RequestBody Map<String, Object> mapParameter) {
         if (Objects.isNull(mapParameter.get("shortCode")) || Objects.equals(mapParameter.get("shortCode"), "")) {
             throw new BusinessException(ExceptionResultEnum.SHORT_CODE_IS_NULL);
@@ -73,10 +68,13 @@ public class TEExamController {
 
     @ApiOperation(value = "获取待考列表接口")
     @RequestMapping(value = "/waiting", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "考试信息", response = TEExamResultDto.class)})
-    public Result waiting() {
+    @ApiResponses({@ApiResponse(code = 200, message = "考试列表", response = TEExamDto.class)})
+    public Result waiting(@ApiJsonObject(name = "examWaiting", value = {
+            @ApiJsonProperty(key = "examId", type = "long", example = "1", description = "批次id")
+    }) @ApiParam(value = "考试口令", required = true) @RequestBody Map<String, Object> mapParameter) {
+        Long examId = Objects.nonNull(mapParameter.get("examId")) ? Long.parseLong(String.valueOf(mapParameter.get("examId"))) : null;
         TEStudentCacheDto teStudent = (TEStudentCacheDto) ServletUtil.getRequestStudentAccount();
-        List<TEExamDto> list = teExamService.getWaitingExam(teStudent.getId(), null, teStudent.getOrgId());
+        List<TEExamDto> list = teExamService.getWaitingExam(teStudent.getId(), examId, teStudent.getOrgId());
         Map<String, Object> map = new HashMap<>();
         if (Objects.nonNull(list) && list.size() > 0) {
             map.put("waiting", list);

+ 2 - 1
themis-exam/src/main/java/com/qmth/themis/exam/api/TEStudentController.java

@@ -101,7 +101,8 @@ public class TEStudentController {
     public Result login(@ApiJsonObject(name = "loginStudent", value = {
             @ApiJsonProperty(key = "identity", description = "证件号"),
             @ApiJsonProperty(key = "password", description = "密码"),
-            @ApiJsonProperty(key = "orgId", type = "long", example = "1", description = "机构id")
+            @ApiJsonProperty(key = "orgId", type = "long", example = "1", description = "机构id"),
+            @ApiJsonProperty(key = "examId", type = "long", example = "1", description = "批次id")
     }) @ApiParam(value = "学生信息", required = true) @RequestBody Map<String, Object> mapParameter) throws NoSuchAlgorithmException {
         if (Objects.isNull(mapParameter)) {
             throw new BusinessException(ExceptionResultEnum.STUDENT_IS_NULL);

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

@@ -38,10 +38,7 @@ import org.springframework.transaction.annotation.Transactional;
 import javax.annotation.Resource;
 import java.io.IOException;
 import java.lang.reflect.Method;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.UUID;
+import java.util.*;
 
 /**
  * @Description: mq执行逻辑 impl
@@ -749,6 +746,12 @@ public class MqLogicServiceImpl implements MqLogicService {
         ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
         //增加异常日志
         TIeInvigilateExceptionInfo tIeInvigilateExceptionInfo = new TIeInvigilateExceptionInfo(examId, examActivityId, recordId, examStudentId, ExceptionEnum.NET_TIME_OUT.getCode(), ExceptionEnum.NET_TIME_OUT, diff, ExamRecordCacheUtil.getLastBreakId(recordId));
+        if (Objects.nonNull(diff)) {
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTimeInMillis(tIeInvigilateExceptionInfo.getCreateTime());
+            calendar.add(Calendar.SECOND, diff);
+            tIeInvigilateExceptionInfo.setUpdateTime(calendar.getTime().getTime());
+        }
         tIeInvigilateExceptionInfoService.saveOrUpdate(tIeInvigilateExceptionInfo);
         TEExamStudentLog teExamStudentLog = new TEExamStudentLog(SystemOperationEnum.BREAK_OFF.name(), SystemOperationEnum.BREAK_OFF.getCode(), SystemOperationEnum.BREAK_OFF.getCode(), examStudentCacheBean.getStudentId(), examStudentId, recordId, ExamRecordCacheUtil.getLastBreakId(recordId));
         teExamStudentLogService.save(teExamStudentLog);