|
@@ -3,6 +3,7 @@ package cn.com.qmth.examcloud.core.oe.student.service.impl;
|
|
|
import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
|
import cn.com.qmth.examcloud.commons.util.FileUtil;
|
|
|
import cn.com.qmth.examcloud.commons.util.PathUtil;
|
|
|
+import cn.com.qmth.examcloud.commons.util.StringUtil;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.base.utils.CommonUtil;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.base.utils.FileDisposeUtil;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.base.utils.HttpPoolUtil;
|
|
@@ -16,6 +17,7 @@ import cn.com.qmth.examcloud.core.oe.student.service.ExamRecordDataService;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.service.ExamingSessionService;
|
|
|
import cn.com.qmth.examcloud.support.Constants;
|
|
|
import cn.com.qmth.examcloud.support.cache.CacheHelper;
|
|
|
+import cn.com.qmth.examcloud.support.cache.bean.ExamPropertyCacheBean;
|
|
|
import cn.com.qmth.examcloud.support.cache.bean.StudentCacheBean;
|
|
|
import cn.com.qmth.examcloud.support.cache.bean.SysPropertyCacheBean;
|
|
|
import cn.com.qmth.examcloud.support.enums.ExamProperties;
|
|
@@ -228,17 +230,25 @@ public class ExamFaceLivenessVerifyServiceImpl implements ExamFaceLivenessVerify
|
|
|
public void faceTestEndHandle(Long examRecordDataId, Long studentId, String result) {
|
|
|
//保存活体检测的结果
|
|
|
ExamRecordData examRecordData = examRecordDataService.getExamRecordDataCache(examRecordDataId);
|
|
|
- examRecordData.setFaceVerifyResult(IsSuccess.strToEnum(result) == IsSuccess.FAILED ? IsSuccess.FAILED : IsSuccess.SUCCESS);
|
|
|
+ IsSuccess verifyResult = IsSuccess.FAILED == IsSuccess.strToEnum(result) ? IsSuccess.FAILED : IsSuccess.SUCCESS;
|
|
|
+ examRecordData.setFaceVerifyResult(verifyResult);
|
|
|
+
|
|
|
+ // 是否考中活体不通过强制退出
|
|
|
+ ExamPropertyCacheBean examProperty = CacheHelper.getExamProperty(examRecordData.getExamId(), ExamProperties.FACE_VERIFY_FORCE_EXIT.name());
|
|
|
+ boolean isFaceVerifyForceExit = examProperty != null && StringUtil.isTrue(examProperty.getValue());
|
|
|
|
|
|
//活检失败,则认为违纪
|
|
|
- if (IsSuccess.strToEnum(result) == IsSuccess.FAILED) {
|
|
|
+ if (isFaceVerifyForceExit && IsSuccess.FAILED == verifyResult) {
|
|
|
examRecordData.setIsIllegality(true);
|
|
|
}
|
|
|
|
|
|
examRecordDataService.saveExamRecordDataCache(examRecordDataId, examRecordData);
|
|
|
|
|
|
+ log.warn("[webClient]保存活检结果!examRecordDataId:{} status:{} isIllegality:{} isFaceVerifyForceExit:{}",
|
|
|
+ examRecordDataId, verifyResult, examRecordData.getIsIllegality(), isFaceVerifyForceExit);
|
|
|
+
|
|
|
//如果活体检失败,需要清除会话并自动交卷
|
|
|
- if (IsSuccess.strToEnum(result) == IsSuccess.FAILED) {
|
|
|
+ if (isFaceVerifyForceExit && IsSuccess.FAILED == verifyResult) {
|
|
|
String fromBy = "handInExam-auto-活检失败";
|
|
|
examControlService.handInExam(examRecordDataId, HandInExamType.AUTO, null, true, fromBy);
|
|
|
}
|