|
@@ -347,7 +347,24 @@ public class MqLogicServiceImpl implements MqLogicService {
|
|
|
VerifyExceptionEnum warningEnum = VerifyExceptionEnum.valueOf(exception);
|
|
|
WarningDto warningDto = new WarningDto(warningEnum, faceCount, realness, recordId, photoUrl);
|
|
|
if (Objects.equals(VerifyExceptionEnum.NONE, warningEnum)) {//无异常,往考生日志表里插一条
|
|
|
- faceVerifyHistoryService.save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception, null);
|
|
|
+ if (Objects.nonNull(realness) && realness.intValue() == 0) {//真实性异常
|
|
|
+ String realnessErrorRandom = ExamRecordCacheUtil.getRealnessErrorRandom(recordId);
|
|
|
+ if (Objects.isNull(realnessErrorRandom)) {
|
|
|
+ realnessErrorRandom = String.valueOf(UUID.randomUUID()).replaceAll("-", "");
|
|
|
+ ExamRecordCacheUtil.setRealnessErrorRandom(recordId, realnessErrorRandom);
|
|
|
+ }
|
|
|
+ ExamRecordCacheUtil.setRealnessErrorNum(recordId, ExamRecordCacheUtil.getRealnessErrorNum(recordId) + 1);
|
|
|
+ warningDto.setRandom(realnessErrorRandom);
|
|
|
+ faceVerifyHistoryService.save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception, realnessErrorRandom);
|
|
|
+ Integer count = ExamRecordCacheUtil.getRealnessErrorNum(recordId);
|
|
|
+ if (count > teConfig.getRealnessCount()) {
|
|
|
+ ExamRecordCacheUtil.setRealnessErrorRandom(recordId, String.valueOf(UUID.randomUUID()).replaceAll("-", ""));
|
|
|
+ ExamRecordCacheUtil.setRealnessErrorNum(recordId, 0);
|
|
|
+ warningService.realnessError(warningDto);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ faceVerifyHistoryService.save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception, null);
|
|
|
+ }
|
|
|
} else {
|
|
|
if (Objects.equals(VerifyExceptionEnum.FACE_COUNT_ERROR, warningEnum)) {//人脸数量异常
|
|
|
if (faceCount > 1) {//多张人脸
|
|
@@ -389,7 +406,7 @@ public class MqLogicServiceImpl implements MqLogicService {
|
|
|
}
|
|
|
ExamRecordCacheUtil.setFaceCompareErrorNum(recordId, ExamRecordCacheUtil.getFaceCompareErrorNum(recordId) + 1);
|
|
|
warningDto.setRandom(faceCompareErrorRandom);
|
|
|
- faceVerifyHistoryService.save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception, null);
|
|
|
+ faceVerifyHistoryService.save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception, faceCompareErrorRandom);
|
|
|
Integer count = ExamRecordCacheUtil.getFaceCompareErrorNum(recordId);
|
|
|
if (count > teConfig.getTotalFaceCompareErrorCount()) {
|
|
|
ExamRecordCacheUtil.setFaceCompareErrorRandom(recordId, String.valueOf(UUID.randomUUID()).replaceAll("-", ""));
|
|
@@ -404,16 +421,13 @@ public class MqLogicServiceImpl implements MqLogicService {
|
|
|
}
|
|
|
ExamRecordCacheUtil.setEyeCloseErrorNum(recordId, ExamRecordCacheUtil.getEyeCloseErrorNum(recordId) + 1);
|
|
|
warningDto.setRandom(eyeCloseErrorRandom);
|
|
|
- faceVerifyHistoryService.save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception, null);
|
|
|
+ faceVerifyHistoryService.save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception, eyeCloseErrorRandom);
|
|
|
Integer count = ExamRecordCacheUtil.getEyeCloseErrorNum(recordId);
|
|
|
if (count > teConfig.getTotalEyeCloseErrorCount()) {
|
|
|
ExamRecordCacheUtil.setEyeCloseErrorRandom(recordId, String.valueOf(UUID.randomUUID()).replaceAll("-", ""));
|
|
|
ExamRecordCacheUtil.setEyeCloseErrorNum(recordId, 0);
|
|
|
warningService.eyeCloseError(warningDto);
|
|
|
}
|
|
|
- } else {
|
|
|
- faceVerifyHistoryService.save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception, null);
|
|
|
- warningService.realnessError(warningDto);
|
|
|
}
|
|
|
}
|
|
|
} else {
|