|
@@ -15,9 +15,7 @@ import com.qmth.themis.business.dto.response.TEExamDto;
|
|
import com.qmth.themis.business.dto.response.TEExamQueryDto;
|
|
import com.qmth.themis.business.dto.response.TEExamQueryDto;
|
|
import com.qmth.themis.business.entity.TEExam;
|
|
import com.qmth.themis.business.entity.TEExam;
|
|
import com.qmth.themis.business.entity.TOeExamRecord;
|
|
import com.qmth.themis.business.entity.TOeExamRecord;
|
|
-import com.qmth.themis.business.enums.ExamRecordStatusEnum;
|
|
|
|
-import com.qmth.themis.business.enums.FinishExamResultEnum;
|
|
|
|
-import com.qmth.themis.business.enums.FinishTypeEnum;
|
|
|
|
|
|
+import com.qmth.themis.business.enums.*;
|
|
import com.qmth.themis.business.service.*;
|
|
import com.qmth.themis.business.service.*;
|
|
import com.qmth.themis.business.util.OssUtil;
|
|
import com.qmth.themis.business.util.OssUtil;
|
|
import com.qmth.themis.business.util.RedisUtil;
|
|
import com.qmth.themis.business.util.RedisUtil;
|
|
@@ -64,9 +62,6 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
@Resource
|
|
@Resource
|
|
TOeExamRecordService toeExamRecordService;
|
|
TOeExamRecordService toeExamRecordService;
|
|
|
|
|
|
- @Resource
|
|
|
|
- TEExamStudentService examStudentService;
|
|
|
|
-
|
|
|
|
@Resource
|
|
@Resource
|
|
RedisUtil redisUtil;
|
|
RedisUtil redisUtil;
|
|
|
|
|
|
@@ -105,11 +100,11 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
List<TEExamActivityDto> teExamActivityList = teExamActivityService.getWaitingExam(studentId, s.getId(), s.getExamActivityId());
|
|
List<TEExamActivityDto> teExamActivityList = teExamActivityService.getWaitingExam(studentId, s.getId(), s.getExamActivityId());
|
|
teExamActivityList.forEach(v -> {
|
|
teExamActivityList.forEach(v -> {
|
|
if (Objects.nonNull(v.getInProcessLivenessFixedRangeStr())) {
|
|
if (Objects.nonNull(v.getInProcessLivenessFixedRangeStr())) {
|
|
- String[] longs = v.getInProcessLivenessFixedRangeStr().trim().split(",");
|
|
|
|
|
|
+ String[] longs = v.getInProcessLivenessFixedRangeStr().trim().replaceAll(" ", "").split(",");
|
|
List inProcessLivenessFixedRange = new ArrayList();
|
|
List inProcessLivenessFixedRange = new ArrayList();
|
|
for (int i = 0; i < longs.length; i++) {
|
|
for (int i = 0; i < longs.length; i++) {
|
|
- Long l = Long.valueOf(longs[i].trim());
|
|
|
|
- inProcessLivenessFixedRange.add(l);
|
|
|
|
|
|
+ Integer integer = Integer.valueOf(longs[i].trim());
|
|
|
|
+ inProcessLivenessFixedRange.add(integer);
|
|
}
|
|
}
|
|
if (Objects.equals(inProcessLivenessFixedRange.toString().trim().replaceAll(" ", ""), "")) {
|
|
if (Objects.equals(inProcessLivenessFixedRange.toString().trim().replaceAll(" ", ""), "")) {
|
|
v.setInProcessLivenessFixedRange(null);
|
|
v.setInProcessLivenessFixedRange(null);
|
|
@@ -118,10 +113,30 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (Objects.nonNull(v.getMonitorVideoSourceStr()) && !Objects.equals(v.getMonitorVideoSourceStr().toString().trim().replaceAll(" ", ""), "")) {
|
|
if (Objects.nonNull(v.getMonitorVideoSourceStr()) && !Objects.equals(v.getMonitorVideoSourceStr().toString().trim().replaceAll(" ", ""), "")) {
|
|
- v.setMonitorVideoSource(Arrays.asList(v.getMonitorVideoSourceStr().trim().split(",")));
|
|
|
|
|
|
+ v.setMonitorVideoSource(Arrays.asList(v.getMonitorVideoSourceStr().trim().toUpperCase().replaceAll(" ", "").split(",")));
|
|
|
|
+ //加入monitorAudioEnable逻辑
|
|
|
|
+ if (v.getMonitorVideoSourceStr().toUpperCase().contains(MonitorVideoSourceEnum.CLIENT_SCREEN.name()) && v.getMonitorVideoSourceStr().toUpperCase().contains(MonitorVideoSourceEnum.CLIENT_CAMERA.name())) {
|
|
|
|
+ v.setMonitorAudioEnable(true);
|
|
|
|
+ }
|
|
|
|
+ //加入hardwareTest逻辑
|
|
|
|
+ if (v.getMonitorVideoSourceStr().toUpperCase().contains(MonitorVideoSourceEnum.CLIENT_CAMERA.name()) || (Objects.nonNull(v.getEntryAuthenticationPolicy()) && (Objects.equals(v.getEntryAuthenticationPolicy(), EntryAuthenticationPolicyEnum.LIVENESS.name()) || Objects.equals(v.getEntryAuthenticationPolicy(), EntryAuthenticationPolicyEnum.FACE_VERIFY_FORCE.name()))) || (Objects.nonNull(v.getCameraPhotoUpload()) && v.getCameraPhotoUpload() == 1)) {
|
|
|
|
+ List<String> hardwareTest = v.getHardwareTest();
|
|
|
|
+ if (Objects.isNull(hardwareTest)) {
|
|
|
|
+ hardwareTest = new ArrayList<>();
|
|
|
|
+ }
|
|
|
|
+ hardwareTest.add(HardwareTestEnum.CAMERA.name());
|
|
|
|
+ //取course缓存
|
|
|
|
+ ExamCourseCacheBean examCourseCacheBean = teExamCourseService.getExamCourseCacheBean(v.getExamId(), v.getCourseCode());
|
|
|
|
+ if (Objects.nonNull(examCourseCacheBean) && Objects.nonNull(examCourseCacheBean.getHasAudio()) && examCourseCacheBean.getHasAudio() == 1) {
|
|
|
|
+ hardwareTest.add(HardwareTestEnum.AUDIOPLAY.name());
|
|
|
|
+ }
|
|
|
|
+ v.setHardwareTest(hardwareTest);
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
v.setMonitorVideoSource(null);
|
|
v.setMonitorVideoSource(null);
|
|
}
|
|
}
|
|
|
|
+ ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudnetCacheBean(v.getExamStudentId());
|
|
|
|
+ v.setLeftExamCount(examStudentCacheBean.getLeftExamCount());
|
|
});
|
|
});
|
|
s.setActivities(teExamActivityList);
|
|
s.setActivities(teExamActivityList);
|
|
});
|
|
});
|
|
@@ -155,11 +170,11 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
}
|
|
}
|
|
TEStudentCacheDto teStudentCacheDto = (TEStudentCacheDto) redisUtil.getStudent(es.getStudentId());
|
|
TEStudentCacheDto teStudentCacheDto = (TEStudentCacheDto) redisUtil.getStudent(es.getStudentId());
|
|
if (teStudentCacheDto.getUnFinishedRecordId() != null) {
|
|
if (teStudentCacheDto.getUnFinishedRecordId() != null) {
|
|
- Long recordId=teStudentCacheDto.getUnFinishedRecordId();
|
|
|
|
-
|
|
|
|
- ExamPaperCacheBean ep = teExamPaperService.getExamPaperCacheBean(ExamRecordCacheUtil.getPaperId(recordId));
|
|
|
|
- ExamCourseCacheBean ec = teExamCourseService.getExamCourseCacheBean(es.getExamId(), es.getCourseCode());
|
|
|
|
- ExamPrepareBean prepare = new ExamPrepareBean();
|
|
|
|
|
|
+ Long recordId = teStudentCacheDto.getUnFinishedRecordId();
|
|
|
|
+
|
|
|
|
+ ExamPaperCacheBean ep = teExamPaperService.getExamPaperCacheBean(ExamRecordCacheUtil.getPaperId(recordId));
|
|
|
|
+ ExamCourseCacheBean ec = teExamCourseService.getExamCourseCacheBean(es.getExamId(), es.getCourseCode());
|
|
|
|
+ ExamPrepareBean prepare = new ExamPrepareBean();
|
|
prepare.setRecordId(recordId);
|
|
prepare.setRecordId(recordId);
|
|
prepare.setAudioPlayCount(ep.getAudioPlayCount());
|
|
prepare.setAudioPlayCount(ep.getAudioPlayCount());
|
|
prepare.setHasAudio((ep.getHasAudio() == null || ep.getHasAudio().intValue() == 0 ? false : true));
|
|
prepare.setHasAudio((ep.getHasAudio() == null || ep.getHasAudio().intValue() == 0 ? false : true));
|