Prechádzať zdrojové kódy

断点续考type去除,默认为断点续考

wangliang 1 rok pred
rodič
commit
e93726fbdd

+ 11 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/mobile/MobileAuthorizationMonitorBean.java

@@ -31,6 +31,17 @@ public class MobileAuthorizationMonitorBean extends MobileAuthorizationBean {
     @ApiModelProperty("转录id")
     private String monitorRecordId;
 
+    @ApiModelProperty(value = "是否允许考生发起语音通话,0:否,1:是")
+    private Integer examStudentCallEnable = 1;
+
+    public Integer getExamStudentCallEnable() {
+        return examStudentCallEnable;
+    }
+
+    public void setExamStudentCallEnable(Integer examStudentCallEnable) {
+        this.examStudentCallEnable = examStudentCallEnable;
+    }
+
     public String getMonitorRecordId() {
         return monitorRecordId;
     }

+ 0 - 1
themis-business/src/main/java/com/qmth/themis/business/cache/ExamBreakCacheUtil.java

@@ -4,7 +4,6 @@ import com.qmth.themis.business.constant.SpringContextHolder;
 import com.qmth.themis.business.enums.ExamBreakHistoryFieldEnum;
 import com.qmth.themis.business.enums.ExceptionEnum;
 import com.qmth.themis.business.enums.VerifyExceptionEnum;
-import com.qmth.themis.business.service.TOeExamBreakHistoryService;
 import com.qmth.themis.business.util.RedisUtil;
 
 import java.util.Objects;

+ 10 - 10
themis-business/src/main/java/com/qmth/themis/business/cache/ExamRecordCacheUtil.java

@@ -534,16 +534,16 @@ public class ExamRecordCacheUtil {
     public static void setClientCurrentIp(Long recordId, String ip) {
         if (Objects.nonNull(getId(recordId)) && (Objects.nonNull(ip) && !Objects.equals(ip.trim(), "") && !Objects.equals(ip.trim(), "0:0:0:0:0:0:0:1") && !Objects.equals(ip.trim(), "127.0.0.1")
                 && !Objects.equals(ip.trim(), "localhost"))) {
-            String historyIp = getClientCurrentIp(recordId);
-            if (Objects.nonNull(historyIp) && !Objects.equals(historyIp.trim(), "") && !Objects.equals(historyIp.trim(), ip.trim())) {
-                Long examId = getExamId(recordId);
-                Long examActivityId = getExamActivityId(recordId);
-                Long examStudentId = getExamStudentId(recordId);
-                TIeInvigilateWarnInfoService tIeInvigilateWarnInfoService = SpringContextHolder.getBean(TIeInvigilateWarnInfoService.class);
-                //ip不同则发生预警
-                TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, VerifyExceptionEnum.IP_CHANGE_ERROR.getLevel().get(0), VerifyExceptionEnum.IP_CHANGE_ERROR.getTitle(), VerifyExceptionEnum.IP_CHANGE_ERROR, 1);
-                tIeInvigilateWarnInfoService.saveOrUpdate(tIeInvigilateWarnInfo);
-            }
+//            String historyIp = getClientCurrentIp(recordId);
+//            if (Objects.nonNull(historyIp) && !Objects.equals(historyIp.trim(), "") && !Objects.equals(historyIp.trim(), ip.trim())) {
+//                Long examId = getExamId(recordId);
+//                Long examActivityId = getExamActivityId(recordId);
+//                Long examStudentId = getExamStudentId(recordId);
+//                TIeInvigilateWarnInfoService tIeInvigilateWarnInfoService = SpringContextHolder.getBean(TIeInvigilateWarnInfoService.class);
+//                //ip不同则发生预警
+//                TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, VerifyExceptionEnum.IP_CHANGE_ERROR.getLevel().get(0), VerifyExceptionEnum.IP_CHANGE_ERROR.getTitle(), VerifyExceptionEnum.IP_CHANGE_ERROR, 1);
+//                tIeInvigilateWarnInfoService.saveOrUpdate(tIeInvigilateWarnInfo);
+//            }
             redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.client_current_ip.getCode(),
                     ip.trim());
         }

+ 25 - 23
themis-business/src/main/java/com/qmth/themis/business/enums/ExceptionEnum.java

@@ -13,15 +13,17 @@ public enum ExceptionEnum {
 
     NET_TIME_OUT("网络超时", "异常处理"),
 
-    MACHING_STOP("机器硬件故障、死机", "异常处理"),
-
-    NET_TIME_BREAK("网络断开", "异常处理"),
-
-    SOFTWARE_STOP("软件故障", "异常处理"),
-
-    POWER_CUT("停电", "异常处理"),
-
-    OTHER("其它", "异常处理");
+//    MACHING_STOP("机器硬件故障、死机", "异常处理"),
+//
+//    NET_TIME_BREAK("网络断开", "异常处理"),
+//
+//    SOFTWARE_STOP("软件故障", "异常处理"),
+//
+//    POWER_CUT("停电", "异常处理"),
+//
+//    OTHER("其它", "异常处理");
+
+    EXAM_BREAK("断点续考", "断点续考");
 
     private String code;
 
@@ -40,18 +42,18 @@ public enum ExceptionEnum {
         return title;
     }
 
-    /**
-     * 状态转换 toName
-     *
-     * @param code
-     * @return
-     */
-    public static String convertToName(String code) {
-        for (ExceptionEnum e : ExceptionEnum.values()) {
-            if (Objects.equals(e.getCode(), code)) {
-                return e.name();
-            }
-        }
-        return OTHER.name();
-    }
+//    /**
+//     * 状态转换 toName
+//     *
+//     * @param code
+//     * @return
+//     */
+//    public static String convertToName(String code) {
+//        for (ExceptionEnum e : ExceptionEnum.values()) {
+//            if (Objects.equals(e.getCode(), code)) {
+//                return e.name();
+//            }
+//        }
+//        return OTHER.name();
+//    }
 }

+ 2 - 2
themis-business/src/main/java/com/qmth/themis/business/enums/VerifyExceptionEnum.java

@@ -22,9 +22,9 @@ public enum VerifyExceptionEnum {
 
     NONE("无异常", Arrays.asList("-1"), "违纪预警"),
 
-    REALNESS("真实性检测异常", Arrays.asList("D15"), "违纪预警"),
+    REALNESS("真实性检测异常", Arrays.asList("D15"), "违纪预警");
 
-    IP_CHANGE_ERROR("IP变动预警", Arrays.asList("D17"), "违纪预警");
+//    IP_CHANGE_ERROR("IP变动预警", Arrays.asList("D17"), "违纪预警");
 
     private String code;
 

+ 15 - 4
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEMobileServiceImpl.java

@@ -134,7 +134,7 @@ public class TEMobileServiceImpl implements TEMobileService {
         ret.setMonitorAppId(tencentYunUtil.getAppId());
         ret.setMonitorKey(ExamRecordCacheUtil.getMonitorKey(recordId));
         ret.setMonitorVideoSource(monitorVideoSource);
-        ret.setMonitorAudioEnable(getMonitorAudioEnable(recordId, monitorVideoSource));
+        ret = getMonitorAudioEnable(recordId, monitorVideoSource, ret);
         SysConfig sysConfig = themisCacheService.addSysConfigCache(SystemConstant.MONITOR_CONFIG_PREFIX);
         Optional.ofNullable(sysConfig).orElseThrow(() -> new BusinessException("未配置监控前缀"));
         ret.setMonitorStreamId(SystemConstant.setStreamId(sysConfig.getConfigValue(), recordId, monitorVideoSource));
@@ -228,16 +228,27 @@ public class TEMobileServiceImpl implements TEMobileService {
         return ret;
     }
 
-    private Boolean getMonitorAudioEnable(Long recordId, MonitorVideoSourceEnum videoSource) {
+    /**
+     * 设置是否允许考生端开启语音
+     *
+     * @param recordId
+     * @param videoSource
+     * @param ret
+     * @return
+     */
+    private MobileAuthorizationMonitorBean getMonitorAudioEnable(Long recordId, MonitorVideoSourceEnum videoSource, MobileAuthorizationMonitorBean ret) {
         Long examId = ExamRecordCacheUtil.getExamId(recordId);
         ExamCacheBean exam = examService.getExamCacheBean(examId);
+        ret.setExamStudentCallEnable(exam.getExamStudentCallEnable());
         String monitorVideoSource = exam.getMonitorVideoSource();
         if (!monitorVideoSource.toUpperCase().contains(MonitorVideoSourceEnum.CLIENT_SCREEN.name())
                 && !monitorVideoSource.toUpperCase().contains(MonitorVideoSourceEnum.CLIENT_CAMERA.name())
                 && MonitorVideoSourceEnum.MOBILE_FIRST.equals(videoSource)) {
-            return true;
+            ret.setMonitorAudioEnable(true);
         } else {
-            return false;
+            ret.setMonitorAudioEnable(false);
         }
+        return ret;
     }
+
 }

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

@@ -197,10 +197,10 @@ public class TEExamController {
                 Long breakId = ExamRecordCacheUtil.getLastBreakId(param.getRecordId());
                 if (Objects.nonNull(breakId)) {
                     JSONObject jsonObject = JSONObject.parseObject(param.getReason());
-                    ExceptionEnum exceptionEnum = ExceptionEnum
-                            .valueOf(ExceptionEnum.convertToName(String.valueOf(jsonObject.get(SystemConstant.TYPE))));
+//                    ExceptionEnum exceptionEnum = ExceptionEnum
+//                            .valueOf(ExceptionEnum.convertToName(String.valueOf(jsonObject.get(SystemConstant.TYPE))));
                     String reason = String.valueOf(jsonObject.get("reason"));
-                    ExamBreakCacheUtil.setBreakReason(breakId, exceptionEnum);
+                    ExamBreakCacheUtil.setBreakReason(breakId, ExceptionEnum.EXAM_BREAK);
                     ExamBreakCacheUtil.setResumeReason(breakId, reason);
                     tOeExamBreakHistoryService.sendExamRecordBreakHistoryDataMq(breakId);
                     //考试断点异常原因 发送mq start

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

@@ -764,8 +764,8 @@ public class MqLogicServiceImpl implements MqLogicService {
             tIeExamInvigilateCallLogService.saveOrUpdate(tIeExamInvigilateCallLog);
         } else if (Objects.equals(MqTagEnum.EXCEPTION_LOG.name(), tag)) {//考试断点异常日志
             JSONObject jsonObject = JSONObject.parseObject(String.valueOf(mqDto.getBody()));
-            ExceptionEnum exceptionEnum = ExceptionEnum.valueOf(
-                    ExceptionEnum.convertToName(String.valueOf(jsonObject.getJSONObject("reason").get(SystemConstant.TYPE))));
+//            ExceptionEnum exceptionEnum = ExceptionEnum.valueOf(
+//                    ExceptionEnum.convertToName(String.valueOf(jsonObject.getJSONObject("reason").get(SystemConstant.TYPE))));
             Long recordId = Long.parseLong(mqDto.getObjId());
             Long lastPrepareTime = ExamRecordCacheUtil.getLastPrepareTime(recordId);
             Long breakId = ExamRecordCacheUtil.getLastBreakId(recordId);
@@ -782,7 +782,7 @@ public class MqLogicServiceImpl implements MqLogicService {
                 String reason = "【异常处理】" + String.valueOf(jsonObject.getJSONObject("reason").get("reason"));
                 UpdateWrapper<TIeInvigilateExceptionInfo> tIeInvigilateExceptionInfoUpdateWrapper = new UpdateWrapper<>();
                 tIeInvigilateExceptionInfoUpdateWrapper.lambda().set(TIeInvigilateExceptionInfo::getInfo, reason)
-                        .set(TIeInvigilateExceptionInfo::getType, exceptionEnum)
+                        .set(TIeInvigilateExceptionInfo::getType, ExceptionEnum.EXAM_BREAK.getTitle())
                         .set(TIeInvigilateExceptionInfo::getDifference, diff)
                         .set(TIeInvigilateExceptionInfo::getUpdateTime, lastPrepareTime)
                         .eq(TIeInvigilateExceptionInfo::getObjId, breakId);
@@ -790,8 +790,8 @@ public class MqLogicServiceImpl implements MqLogicService {
 
                 //修改考生轨迹
                 UpdateWrapper<TEExamStudentLog> teExamStudentLogUpdateWrapper = new UpdateWrapper<>();
-                teExamStudentLogUpdateWrapper.lambda().set(TEExamStudentLog::getType, exceptionEnum.name())
-                        .set(TEExamStudentLog::getInfo, exceptionEnum.getCode())
+                teExamStudentLogUpdateWrapper.lambda().set(TEExamStudentLog::getType, ExceptionEnum.EXAM_BREAK.name())
+                        .set(TEExamStudentLog::getInfo, ExceptionEnum.EXAM_BREAK.getCode())
                         .set(TEExamStudentLog::getRemark, reason)
                         .set(TEExamStudentLog::getUpdateTime, lastPrepareTime)
                         .eq(TEExamStudentLog::getObjId, breakId);