|
@@ -12,6 +12,7 @@ import cn.com.qmth.examcloud.core.oe.student.service.ExamFaceLiveVerifyService;
|
|
|
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.enums.ExamRecordStatus;
|
|
|
+import cn.com.qmth.examcloud.support.enums.IsSuccess;
|
|
|
import cn.com.qmth.examcloud.support.examing.ExamRecordData;
|
|
|
import cn.com.qmth.examcloud.support.examing.ExamingSession;
|
|
|
import org.slf4j.Logger;
|
|
@@ -70,6 +71,7 @@ public class ExamFaceLiveVerifyServiceImpl implements ExamFaceLiveVerifyService
|
|
|
Check.isNull(req.getFaceLiveVerifyId(), "当前活检记录ID不能为空");
|
|
|
Check.isNull(req.getExamRecordDataId(), "考试记录ID不能为空");
|
|
|
Check.isNull(req.getStatus(), "人脸活体验证状态不能为空");
|
|
|
+ Check.isEmpty(req.getActions(), "动作验证列表不能为空");
|
|
|
|
|
|
ExamRecordData examRecordData = examRecordDataService.getExamRecordDataCache(req.getExamRecordDataId());
|
|
|
if (examRecordData == null || ExamRecordStatus.EXAM_ING != examRecordData.getExamRecordStatus()) {
|
|
@@ -90,6 +92,11 @@ public class ExamFaceLiveVerifyServiceImpl implements ExamFaceLiveVerifyService
|
|
|
}
|
|
|
|
|
|
ExamFaceLiveVerifyEntity entity = optional.get();
|
|
|
+ if (entity.getFinished()) {
|
|
|
+ log.warn("当前活检记录已完成!faceLiveVerifyId = {}", req.getFaceLiveVerifyId());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
entity.setFinished(true);
|
|
|
entity.setStatus(req.getStatus());
|
|
|
entity.setFaceCount(req.getFaceCount());
|
|
@@ -100,6 +107,13 @@ public class ExamFaceLiveVerifyServiceImpl implements ExamFaceLiveVerifyService
|
|
|
entity.setActions(new JsonMapper().toJson(req.getActions()));
|
|
|
entity.setUpdateTime(new Date());
|
|
|
examFaceLiveVerifyRepo.save(entity);
|
|
|
+
|
|
|
+ examRecordData.setFaceVerifyResult(FaceLiveVerifyStatus.SUCCESS == req.getStatus() ? IsSuccess.SUCCESS : IsSuccess.FAILED);
|
|
|
+ if (FaceLiveVerifyStatus.SUCCESS != req.getStatus()) {
|
|
|
+ // 活检失败,则认为违纪
|
|
|
+ examRecordData.setIsIllegality(true);
|
|
|
+ }
|
|
|
+ examRecordDataService.saveExamRecordDataCache(req.getExamRecordDataId(), examRecordData);
|
|
|
}
|
|
|
|
|
|
}
|