|
@@ -7,10 +7,13 @@ import com.qmth.themis.business.dto.WarningDto;
|
|
|
import com.qmth.themis.business.entity.TEConfig;
|
|
|
import com.qmth.themis.business.entity.TEExamStudentLog;
|
|
|
import com.qmth.themis.business.entity.TIeInvigilateWarnInfo;
|
|
|
+import com.qmth.themis.business.entity.TOeExamRecord;
|
|
|
import com.qmth.themis.business.enums.ExamTypeEnum;
|
|
|
import com.qmth.themis.business.enums.VerifyExceptionEnum;
|
|
|
import com.qmth.themis.business.enums.WarningLevelEnum;
|
|
|
import com.qmth.themis.business.service.*;
|
|
|
+import com.qmth.themis.common.enums.ExceptionResultEnum;
|
|
|
+import com.qmth.themis.common.exception.BusinessException;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -65,6 +68,12 @@ public class WarningServiceImpl implements WarningService {
|
|
|
Long examId = ExamRecordCacheUtil.getExamId(recordId);
|
|
|
Long examStudentId = ExamRecordCacheUtil.getExamStudentId(recordId);
|
|
|
Long examActivityId = ExamRecordCacheUtil.getExamActivityId(recordId);
|
|
|
+ if (Objects.isNull(examStudentId)) {
|
|
|
+ TOeExamRecord tOeExamRecord = tOeExamRecordService.getById(recordId);
|
|
|
+ Optional.ofNullable(tOeExamRecord).orElseThrow(() -> new BusinessException(ExceptionResultEnum.NOT_FOUND_EXAM_RECORD));
|
|
|
+ examStudentId = tOeExamRecord.getExamStudentId();
|
|
|
+ examActivityId = tOeExamRecord.getExamActivityId();
|
|
|
+ }
|
|
|
ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
|
|
|
if (faceCount > 1) {//多张人脸
|
|
|
Map<String, Object> map = faceVerifyHistoryService.faceCountError(recordId, warningDto.getWarningEnum().name(), faceCount, true, ExamTypeEnum.IN_PROCESS.name(), warningDto.getRandom());
|
|
@@ -108,6 +117,12 @@ public class WarningServiceImpl implements WarningService {
|
|
|
Long examId = ExamRecordCacheUtil.getExamId(recordId);
|
|
|
Long examStudentId = ExamRecordCacheUtil.getExamStudentId(recordId);
|
|
|
Long examActivityId = ExamRecordCacheUtil.getExamActivityId(recordId);
|
|
|
+ if (Objects.isNull(examStudentId)) {
|
|
|
+ TOeExamRecord tOeExamRecord = tOeExamRecordService.getById(recordId);
|
|
|
+ Optional.ofNullable(tOeExamRecord).orElseThrow(() -> new BusinessException(ExceptionResultEnum.NOT_FOUND_EXAM_RECORD));
|
|
|
+ examStudentId = tOeExamRecord.getExamStudentId();
|
|
|
+ examActivityId = tOeExamRecord.getExamActivityId();
|
|
|
+ }
|
|
|
ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
|
|
|
Map<String, Object> map = faceVerifyHistoryService.faceCompareError(recordId, warningDto.getWarningEnum().name(), ExamTypeEnum.IN_PROCESS.name(), warningDto.getRandom());
|
|
|
if (Objects.nonNull(map) && map.size() > 0) {
|
|
@@ -137,6 +152,12 @@ public class WarningServiceImpl implements WarningService {
|
|
|
Long examId = ExamRecordCacheUtil.getExamId(recordId);
|
|
|
Long examStudentId = ExamRecordCacheUtil.getExamStudentId(recordId);
|
|
|
Long examActivityId = ExamRecordCacheUtil.getExamActivityId(recordId);
|
|
|
+ if (Objects.isNull(examStudentId)) {
|
|
|
+ TOeExamRecord tOeExamRecord = tOeExamRecordService.getById(recordId);
|
|
|
+ Optional.ofNullable(tOeExamRecord).orElseThrow(() -> new BusinessException(ExceptionResultEnum.NOT_FOUND_EXAM_RECORD));
|
|
|
+ examStudentId = tOeExamRecord.getExamStudentId();
|
|
|
+ examActivityId = tOeExamRecord.getExamActivityId();
|
|
|
+ }
|
|
|
ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
|
|
|
Map<String, Object> map = faceVerifyHistoryService.eyeCloseError(recordId, warningDto.getWarningEnum().name(), ExamTypeEnum.IN_PROCESS.name(), warningDto.getRandom());
|
|
|
if (Objects.nonNull(map) && map.size() > 0) {
|
|
@@ -176,6 +197,12 @@ public class WarningServiceImpl implements WarningService {
|
|
|
Long examId = ExamRecordCacheUtil.getExamId(recordId);
|
|
|
Long examStudentId = ExamRecordCacheUtil.getExamStudentId(recordId);
|
|
|
Long examActivityId = ExamRecordCacheUtil.getExamActivityId(recordId);
|
|
|
+ if (Objects.isNull(examStudentId)) {
|
|
|
+ TOeExamRecord tOeExamRecord = tOeExamRecordService.getById(recordId);
|
|
|
+ Optional.ofNullable(tOeExamRecord).orElseThrow(() -> new BusinessException(ExceptionResultEnum.NOT_FOUND_EXAM_RECORD));
|
|
|
+ examStudentId = tOeExamRecord.getExamStudentId();
|
|
|
+ examActivityId = tOeExamRecord.getExamActivityId();
|
|
|
+ }
|
|
|
ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
|
|
|
Map<String, Object> map = faceVerifyHistoryService.realnessError(recordId, warningDto.getWarningEnum().name(), ExamTypeEnum.IN_PROCESS.name(), warningDto.getRandom());
|
|
|
if (Objects.nonNull(map) && map.size() > 0) {
|
|
@@ -231,7 +258,7 @@ public class WarningServiceImpl implements WarningService {
|
|
|
teExamStudentLogService.saveOrUpdate(teExamStudentLog);
|
|
|
}
|
|
|
|
|
|
- public static void main(String[] args){
|
|
|
+ public static void main(String[] args) {
|
|
|
AtomicInteger atomicInteger = new AtomicInteger(0);
|
|
|
atomicInteger.incrementAndGet();
|
|
|
System.out.println(atomicInteger.get());
|