|
@@ -15,7 +15,11 @@ 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.*;
|
|
|
|
|
|
+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.InvigilateVerifyEnum;
|
|
|
|
+import com.qmth.themis.business.enums.ReviewResultEnum;
|
|
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;
|
|
@@ -62,6 +66,9 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
@Resource
|
|
@Resource
|
|
TOeExamRecordService toeExamRecordService;
|
|
TOeExamRecordService toeExamRecordService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ TEExamStudentService examStudentService;
|
|
|
|
+
|
|
@Resource
|
|
@Resource
|
|
RedisUtil redisUtil;
|
|
RedisUtil redisUtil;
|
|
|
|
|
|
@@ -100,11 +107,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().replaceAll(" ", "").split(",");
|
|
|
|
|
|
+ String[] longs = v.getInProcessLivenessFixedRangeStr().trim().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++) {
|
|
- Integer integer = Integer.valueOf(longs[i].trim());
|
|
|
|
- inProcessLivenessFixedRange.add(integer);
|
|
|
|
|
|
+ Long l = Long.valueOf(longs[i].trim());
|
|
|
|
+ inProcessLivenessFixedRange.add(l);
|
|
}
|
|
}
|
|
if (Objects.equals(inProcessLivenessFixedRange.toString().trim().replaceAll(" ", ""), "")) {
|
|
if (Objects.equals(inProcessLivenessFixedRange.toString().trim().replaceAll(" ", ""), "")) {
|
|
v.setInProcessLivenessFixedRange(null);
|
|
v.setInProcessLivenessFixedRange(null);
|
|
@@ -113,30 +120,10 @@ 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().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);
|
|
|
|
- }
|
|
|
|
|
|
+ v.setMonitorVideoSource(Arrays.asList(v.getMonitorVideoSourceStr().trim().split(",")));
|
|
} else {
|
|
} else {
|
|
v.setMonitorVideoSource(null);
|
|
v.setMonitorVideoSource(null);
|
|
}
|
|
}
|
|
- ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudnetCacheBean(v.getExamStudentId());
|
|
|
|
- v.setLeftExamCount(examStudentCacheBean.getLeftExamCount());
|
|
|
|
});
|
|
});
|
|
s.setActivities(teExamActivityList);
|
|
s.setActivities(teExamActivityList);
|
|
});
|
|
});
|
|
@@ -170,11 +157,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));
|
|
@@ -613,18 +600,36 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
ret.setFinishTime(now.getTime());
|
|
ret.setFinishTime(now.getTime());
|
|
ret.setObjectiveScore(ExamRecordCacheUtil.getObjectiveScore(recordId));
|
|
ret.setObjectiveScore(ExamRecordCacheUtil.getObjectiveScore(recordId));
|
|
ExamCacheBean exam = getExamCacheBean(es.getExamId());
|
|
ExamCacheBean exam = getExamCacheBean(es.getExamId());
|
|
- //TODO
|
|
|
|
|
|
+ //页面结果
|
|
if (exam.getShowObjectiveScore() != null && exam.getShowObjectiveScore().intValue() == 1) {//实时出分
|
|
if (exam.getShowObjectiveScore() != null && exam.getShowObjectiveScore().intValue() == 1) {//实时出分
|
|
- if (ret.getObjectiveScore() == null) {
|
|
|
|
- ret.setStatus(FinishExamResultEnum.SCORE_CALCULATE);
|
|
|
|
- } else {
|
|
|
|
- ret.setStatus(FinishExamResultEnum.SCORE_VIEW);
|
|
|
|
|
|
+ if(InvigilateVerifyEnum.NOW.equals(exam.getInvigilateVerify())) {//实时审核
|
|
|
|
+ Integer warningCount=ExamRecordCacheUtil.getWarningCount(recordId);
|
|
|
|
+ Integer breachStatus=ExamRecordCacheUtil.getBreachStatus(recordId);
|
|
|
|
+ if(warningCount!=null&&warningCount.intValue()>0) {//有预警
|
|
|
|
+ if(breachStatus==null) {//无违纪结果
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.AUDITING);
|
|
|
|
+ }else if(breachStatus.intValue()==0) {//违纪结果是false
|
|
|
|
+ ret.setReviewResult(ReviewResultEnum.PASS);
|
|
|
|
+ if (ret.getObjectiveScore() == null) {
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.SCORE_CALCULATE);
|
|
|
|
+ } else {
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.SCORE_VIEW);
|
|
|
|
+ }
|
|
|
|
+ }else if(breachStatus.intValue()==1) {//违纪结果是true
|
|
|
|
+ ret.setReviewResult(ReviewResultEnum.UN_PASS);
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.BREACH);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ if (ret.getObjectiveScore() == null) {
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.SCORE_CALCULATE);
|
|
|
|
+ } else {
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.SCORE_VIEW);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
|
|
+ } else {//非实时出分
|
|
ret.setStatus(FinishExamResultEnum.NORMAL);
|
|
ret.setStatus(FinishExamResultEnum.NORMAL);
|
|
}
|
|
}
|
|
- // TODO
|
|
|
|
- ret.setReviewResult("");
|
|
|
|
ExamRecordCacheUtil.setFinishTime(recordId, now);
|
|
ExamRecordCacheUtil.setFinishTime(recordId, now);
|
|
ExamRecordCacheUtil.setDurationSeconds(recordId, durationSeconds);
|
|
ExamRecordCacheUtil.setDurationSeconds(recordId, durationSeconds);
|
|
ExamRecordCacheUtil.setFinishType(recordId, FinishTypeEnum.valueOf(type));
|
|
ExamRecordCacheUtil.setFinishType(recordId, FinishTypeEnum.valueOf(type));
|
|
@@ -676,8 +681,37 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
ret.setObjectiveScore(ExamRecordCacheUtil.getObjectiveScore(recordId));
|
|
ret.setObjectiveScore(ExamRecordCacheUtil.getObjectiveScore(recordId));
|
|
}
|
|
}
|
|
|
|
|
|
- //TODO
|
|
|
|
- ret.setReviewResult("");
|
|
|
|
|
|
+ //页面结果
|
|
|
|
+ ExamCacheBean exam = getExamCacheBean(er.getExamId());
|
|
|
|
+ if (exam.getShowObjectiveScore() != null && exam.getShowObjectiveScore().intValue() == 1) {//实时出分
|
|
|
|
+ if(InvigilateVerifyEnum.NOW.equals(exam.getInvigilateVerify())) {//实时审核
|
|
|
|
+ Integer warningCount=ExamRecordCacheUtil.getWarningCount(recordId);
|
|
|
|
+ Integer breachStatus=ExamRecordCacheUtil.getBreachStatus(recordId);
|
|
|
|
+ if(warningCount!=null&&warningCount.intValue()>0) {//有预警
|
|
|
|
+ if(breachStatus==null) {//无违纪结果
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.AUDITING);
|
|
|
|
+ }else if(breachStatus.intValue()==0) {//违纪结果是false
|
|
|
|
+ ret.setReviewResult(ReviewResultEnum.PASS);
|
|
|
|
+ if (ret.getObjectiveScore() == null) {
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.SCORE_CALCULATE);
|
|
|
|
+ } else {
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.SCORE_VIEW);
|
|
|
|
+ }
|
|
|
|
+ }else if(breachStatus.intValue()==1) {//违纪结果是true
|
|
|
|
+ ret.setReviewResult(ReviewResultEnum.UN_PASS);
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.BREACH);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ if (ret.getObjectiveScore() == null) {
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.SCORE_CALCULATE);
|
|
|
|
+ } else {
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.SCORE_VIEW);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {//非实时出分
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.NORMAL);
|
|
|
|
+ }
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|