wangliang 4 jaren geleden
bovenliggende
commit
5dcce85531

+ 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 = "进度查询列表接口")

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

@@ -131,7 +131,7 @@ public class TIeReportController {
     @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));
+        return ResultUtil.ok(reportService.examBreachListDetail(examStudentId, 0));
     }
 
     @ApiOperation(value = "撤销违纪名单")
@@ -152,7 +152,7 @@ public class TIeReportController {
     @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));
+        return ResultUtil.ok(reportService.examRevokeBreachListDetail(examStudentId, 1));
     }
 
     @ApiOperation(value = "考生日志")
@@ -189,21 +189,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 List<ExamBreachDetailListBean> getExamBreachDetailList(@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,

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

@@ -27,12 +27,12 @@ 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 List<ExamBreachDetailListBean> examBreachListDetail(Long examStudentId,Integer status);
 
     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 List<ExamBreachDetailListBean> examRevokeBreachListDetail(Long examStudentId,Integer status);
 
     public IPage examStudentLogList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                     String identity, int pageNumber, int pageSize);

+ 6 - 5
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;
@@ -286,8 +287,8 @@ public class TIeReportServiceImpl implements TIeReportService {
     }
 
     @Override
-    public List<ExamBreachDetailListBean> examBreachListDetail(Long examStudentId) {
-        List<ExamBreachDetailListBean> ret = examBreachLogMapper.getExamBreachDetailList(examStudentId);
+    public List<ExamBreachDetailListBean> examBreachListDetail(Long examStudentId, Integer status) {
+        List<ExamBreachDetailListBean> ret = examBreachLogMapper.getExamBreachDetailList(examStudentId, status);
         if (ret != null && ret.size() > 0) {
             for (ExamBreachDetailListBean b : ret) {
                 if (StringUtils.isNotBlank(b.getType())) {
@@ -317,12 +318,12 @@ public class TIeReportServiceImpl implements TIeReportService {
     }
 
     @Override
-    public List<ExamBreachDetailListBean> examRevokeBreachListDetail(Long examStudentId) {
-        List<ExamBreachDetailListBean> ret = examBreachLogMapper.getExamBreachDetailList(examStudentId);
+    public List<ExamBreachDetailListBean> examRevokeBreachListDetail(Long examStudentId, Integer status) {
+        List<ExamBreachDetailListBean> ret = examBreachLogMapper.getExamBreachDetailList(examStudentId, status);
         if (ret != null && ret.size() > 0) {
             for (ExamBreachDetailListBean b : ret) {
                 if (StringUtils.isNotBlank(b.getType())) {
-                    b.setType(BreachTypeEnum.valueOf(b.getType()).getCode());
+                    b.setType(BreachCancelTypeEnum.valueOf(b.getType()).getCode());
                 }
             }
         }

+ 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>

+ 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);