|
@@ -423,15 +423,13 @@ public class MqLogicServiceImpl implements MqLogicService {
|
|
|
examStudentId = tOeExamRecord.getExamStudentId();
|
|
|
}
|
|
|
ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
|
|
|
- if (Objects.nonNull(photoUrl) && (Objects.equals(type.toUpperCase(), ExamTypeEnum.FIRST_START.name()) || Objects
|
|
|
- .equals(type.toUpperCase(), ExamTypeEnum.RESUME_START.name()))) {
|
|
|
+ if (Objects.nonNull(photoUrl) && (Objects.equals(type.toUpperCase(), ExamTypeEnum.FIRST_START.name()) || Objects.equals(type.toUpperCase(), ExamTypeEnum.RESUME_START.name()))) {
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put(PhotoTypeEnum.FACE_VERIFY_PHOTO.name(), photoUrl);
|
|
|
TEExamStudentLog teExamStudentLog = new TEExamStudentLog(type, ExamTypeEnum.valueOf(type).getCode(),
|
|
|
jsonObject.toJSONString(), examStudentCacheBean.getStudentId(), examStudentCacheBean.getId(),
|
|
|
recordId, ExamTypeEnum.valueOf(type).getTitle());
|
|
|
- faceVerifyHistoryService
|
|
|
- .save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception, null);
|
|
|
+ faceVerifyHistoryService.save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception, null);
|
|
|
teExamStudentLogService.saveOrUpdate(teExamStudentLog);
|
|
|
} else if (Objects.equals(type.toUpperCase(), ExamTypeEnum.IN_PROCESS.name())) {
|
|
|
VerifyExceptionEnum warningEnum = VerifyExceptionEnum.valueOf(exception);
|
|
@@ -443,22 +441,17 @@ public class MqLogicServiceImpl implements MqLogicService {
|
|
|
realnessErrorRandom = SystemConstant.getNanoId();
|
|
|
ExamRecordCacheUtil.setRealnessErrorRandom(recordId, realnessErrorRandom);
|
|
|
}
|
|
|
- ExamRecordCacheUtil
|
|
|
- .setRealnessErrorNum(recordId, new AtomicInteger(ExamRecordCacheUtil.getRealnessErrorNum(recordId).incrementAndGet()));
|
|
|
+ ExamRecordCacheUtil.setRealnessErrorNum(recordId, new AtomicInteger(ExamRecordCacheUtil.getRealnessErrorNum(recordId).incrementAndGet()));
|
|
|
warningDto.setRandom(realnessErrorRandom);
|
|
|
- faceVerifyHistoryService
|
|
|
- .save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception,
|
|
|
- realnessErrorRandom);
|
|
|
+ faceVerifyHistoryService.save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception, realnessErrorRandom);
|
|
|
Integer count = ExamRecordCacheUtil.getRealnessErrorNum(recordId).get();
|
|
|
if (count > teConfig.getRealnessCount()) {
|
|
|
- ExamRecordCacheUtil.setRealnessErrorRandom(recordId,
|
|
|
- SystemConstant.getNanoId());
|
|
|
+ ExamRecordCacheUtil.setRealnessErrorRandom(recordId, SystemConstant.getNanoId());
|
|
|
ExamRecordCacheUtil.setRealnessErrorNum(recordId, new AtomicInteger(0));
|
|
|
warningService.realnessError(warningDto);
|
|
|
}
|
|
|
} else {
|
|
|
- faceVerifyHistoryService
|
|
|
- .save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception, null);
|
|
|
+ faceVerifyHistoryService.save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception, null);
|
|
|
}
|
|
|
} else {
|
|
|
if (Objects.equals(VerifyExceptionEnum.FACE_COUNT_ERROR, warningEnum)) {//人脸数量异常
|
|
@@ -468,16 +461,12 @@ public class MqLogicServiceImpl implements MqLogicService {
|
|
|
multipleFaceRandom = SystemConstant.getNanoId();
|
|
|
ExamRecordCacheUtil.setMultipleFaceCountErrorRandom(recordId, multipleFaceRandom);
|
|
|
}
|
|
|
- ExamRecordCacheUtil.setMultipleFaceCountErrorNum(recordId,
|
|
|
- new AtomicInteger(ExamRecordCacheUtil.getMultipleFaceCountErrorNum(recordId).incrementAndGet()));
|
|
|
+ ExamRecordCacheUtil.setMultipleFaceCountErrorNum(recordId, new AtomicInteger(ExamRecordCacheUtil.getMultipleFaceCountErrorNum(recordId).incrementAndGet()));
|
|
|
warningDto.setRandom(multipleFaceRandom);
|
|
|
- faceVerifyHistoryService
|
|
|
- .save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception,
|
|
|
- multipleFaceRandom);
|
|
|
+ faceVerifyHistoryService.save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception, multipleFaceRandom);
|
|
|
Integer count = ExamRecordCacheUtil.getMultipleFaceCountErrorNum(recordId).get();
|
|
|
if (count > teConfig.getMultipleFaceCountError()) {
|
|
|
- ExamRecordCacheUtil.setMultipleFaceCountErrorRandom(recordId,
|
|
|
- SystemConstant.getNanoId());
|
|
|
+ ExamRecordCacheUtil.setMultipleFaceCountErrorRandom(recordId, SystemConstant.getNanoId());
|
|
|
ExamRecordCacheUtil.setMultipleFaceCountErrorNum(recordId, new AtomicInteger(0));
|
|
|
warningService.faceCountError(warningDto);
|
|
|
}
|
|
@@ -487,16 +476,12 @@ public class MqLogicServiceImpl implements MqLogicService {
|
|
|
noFaceRandom = SystemConstant.getNanoId();
|
|
|
ExamRecordCacheUtil.setNoFaceCountErrorRandom(recordId, noFaceRandom);
|
|
|
}
|
|
|
- ExamRecordCacheUtil.setNoFaceCountErrorNum(recordId,
|
|
|
- new AtomicInteger(ExamRecordCacheUtil.getNoFaceCountErrorNum(recordId).incrementAndGet()));
|
|
|
+ ExamRecordCacheUtil.setNoFaceCountErrorNum(recordId, new AtomicInteger(ExamRecordCacheUtil.getNoFaceCountErrorNum(recordId).incrementAndGet()));
|
|
|
warningDto.setRandom(noFaceRandom);
|
|
|
- faceVerifyHistoryService
|
|
|
- .save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception,
|
|
|
- noFaceRandom);
|
|
|
+ faceVerifyHistoryService.save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception, noFaceRandom);
|
|
|
Integer count = ExamRecordCacheUtil.getNoFaceCountErrorNum(recordId).get();
|
|
|
if (count > teConfig.getNoFaceCountError()) {
|
|
|
- ExamRecordCacheUtil.setNoFaceCountErrorRandom(recordId,
|
|
|
- SystemConstant.getNanoId());
|
|
|
+ ExamRecordCacheUtil.setNoFaceCountErrorRandom(recordId, SystemConstant.getNanoId());
|
|
|
ExamRecordCacheUtil.setNoFaceCountErrorNum(recordId, new AtomicInteger(0));
|
|
|
warningService.faceCountError(warningDto);
|
|
|
}
|
|
@@ -507,16 +492,12 @@ public class MqLogicServiceImpl implements MqLogicService {
|
|
|
faceCompareErrorRandom = SystemConstant.getNanoId();
|
|
|
ExamRecordCacheUtil.setFaceCompareErrorRandom(recordId, faceCompareErrorRandom);
|
|
|
}
|
|
|
- ExamRecordCacheUtil
|
|
|
- .setFaceCompareErrorNum(recordId, new AtomicInteger(ExamRecordCacheUtil.getFaceCompareErrorNum(recordId).incrementAndGet()));
|
|
|
+ ExamRecordCacheUtil.setFaceCompareErrorNum(recordId, new AtomicInteger(ExamRecordCacheUtil.getFaceCompareErrorNum(recordId).incrementAndGet()));
|
|
|
warningDto.setRandom(faceCompareErrorRandom);
|
|
|
- faceVerifyHistoryService
|
|
|
- .save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception,
|
|
|
- faceCompareErrorRandom);
|
|
|
+ faceVerifyHistoryService.save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception, faceCompareErrorRandom);
|
|
|
Integer count = ExamRecordCacheUtil.getFaceCompareErrorNum(recordId).get();
|
|
|
if (count > teConfig.getTotalFaceCompareErrorCount()) {
|
|
|
- ExamRecordCacheUtil.setFaceCompareErrorRandom(recordId,
|
|
|
- SystemConstant.getNanoId());
|
|
|
+ ExamRecordCacheUtil.setFaceCompareErrorRandom(recordId, SystemConstant.getNanoId());
|
|
|
ExamRecordCacheUtil.setFaceCompareErrorNum(recordId, new AtomicInteger(0));
|
|
|
warningService.faceCompareError(warningDto);
|
|
|
}
|
|
@@ -526,24 +507,19 @@ public class MqLogicServiceImpl implements MqLogicService {
|
|
|
eyeCloseErrorRandom = SystemConstant.getNanoId();
|
|
|
ExamRecordCacheUtil.setEyeCloseErrorRandom(recordId, eyeCloseErrorRandom);
|
|
|
}
|
|
|
- ExamRecordCacheUtil
|
|
|
- .setEyeCloseErrorNum(recordId, new AtomicInteger(ExamRecordCacheUtil.getEyeCloseErrorNum(recordId).incrementAndGet()));
|
|
|
+ ExamRecordCacheUtil.setEyeCloseErrorNum(recordId, new AtomicInteger(ExamRecordCacheUtil.getEyeCloseErrorNum(recordId).incrementAndGet()));
|
|
|
warningDto.setRandom(eyeCloseErrorRandom);
|
|
|
- faceVerifyHistoryService
|
|
|
- .save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception,
|
|
|
- eyeCloseErrorRandom);
|
|
|
+ faceVerifyHistoryService.save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception, eyeCloseErrorRandom);
|
|
|
Integer count = ExamRecordCacheUtil.getEyeCloseErrorNum(recordId).get();
|
|
|
if (count > teConfig.getTotalEyeCloseErrorCount()) {
|
|
|
- ExamRecordCacheUtil.setEyeCloseErrorRandom(recordId,
|
|
|
- SystemConstant.getNanoId());
|
|
|
+ ExamRecordCacheUtil.setEyeCloseErrorRandom(recordId, SystemConstant.getNanoId());
|
|
|
ExamRecordCacheUtil.setEyeCloseErrorNum(recordId, new AtomicInteger(0));
|
|
|
warningService.eyeCloseError(warningDto);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- faceVerifyHistoryService
|
|
|
- .save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception, null);
|
|
|
+ faceVerifyHistoryService.save(id, recordId, type, photoUrl, faceCount, similarity, realness, time, exception, null);
|
|
|
}
|
|
|
tmRocketMessageService.saveMqMessageSuccess(mqDto, key);
|
|
|
}
|
|
@@ -573,27 +549,20 @@ public class MqLogicServiceImpl implements MqLogicService {
|
|
|
examStudentId = tOeExamRecord.getExamStudentId();
|
|
|
}
|
|
|
ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
|
|
|
- if (Objects.equals(type.toUpperCase(), ExamTypeEnum.FIRST_START.name()) || Objects
|
|
|
- .equals(type.toUpperCase(), ExamTypeEnum.RESUME_START.name())) {
|
|
|
+ if (Objects.equals(type.toUpperCase(), ExamTypeEnum.FIRST_START.name()) || Objects.equals(type.toUpperCase(), ExamTypeEnum.RESUME_START.name())) {
|
|
|
JSONArray jsonArray = JSONArray.parseArray(actions);
|
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
|
|
- String photoType = Objects.nonNull(jsonObject.get(SystemConstant.TYPE)) ?
|
|
|
- String.valueOf(jsonObject.get(SystemConstant.TYPE)) :
|
|
|
- null;
|
|
|
- String photoUrl = Objects.nonNull(jsonObject.get("photoUrl")) ?
|
|
|
- String.valueOf(jsonObject.get("photoUrl")) :
|
|
|
- null;
|
|
|
- if (Objects.nonNull(photoType) && Objects.nonNull(photoUrl) && Objects
|
|
|
- .equals(photoType.toLowerCase(), "startup")) {
|
|
|
+ String photoType = Objects.nonNull(jsonObject.get(SystemConstant.TYPE)) ? String.valueOf(jsonObject.get(SystemConstant.TYPE)) : null;
|
|
|
+ String photoUrl = Objects.nonNull(jsonObject.get("photoUrl")) ? String.valueOf(jsonObject.get("photoUrl")) : null;
|
|
|
+ if (Objects.nonNull(photoType) && Objects.nonNull(photoUrl) && Objects.equals(photoType.toLowerCase(), "startup")) {
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put(PhotoTypeEnum.LIVENESS_VERIFY_PHOTO.name(), photoUrl);
|
|
|
TEExamStudentLog teExamStudentLog = new TEExamStudentLog(type,
|
|
|
LivenessTypeEnum.valueOf(type).getCode(), object.toJSONString(),
|
|
|
examStudentCacheBean.getStudentId(), examStudentCacheBean.getId(), recordId,
|
|
|
LivenessTypeEnum.valueOf(type).getTitle());
|
|
|
- livenessVerifyHistoryService
|
|
|
- .save(id, recordId, type, actions, retry, startTime, finishTime, exception, null);
|
|
|
+ livenessVerifyHistoryService.save(id, recordId, type, actions, retry, startTime, finishTime, exception, null);
|
|
|
teExamStudentLogService.saveOrUpdate(teExamStudentLog);
|
|
|
break;
|
|
|
}
|
|
@@ -604,29 +573,23 @@ public class MqLogicServiceImpl implements MqLogicService {
|
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
|
|
if (Objects.equals(VerifyExceptionEnum.NONE, warningEnum)) {//无异常,往考生日志表里插一条
|
|
|
- livenessVerifyHistoryService
|
|
|
- .save(id, recordId, type, actions, retry, startTime, finishTime, exception, null);
|
|
|
+ livenessVerifyHistoryService.save(id, recordId, type, actions, retry, startTime, finishTime, exception, null);
|
|
|
} else {
|
|
|
if (Objects.equals(VerifyExceptionEnum.FACE_COUNT_ERROR, warningEnum)) {//人脸数量异常
|
|
|
Integer faceCount = Integer.parseInt(String.valueOf(jsonObject.get("faceCount")));
|
|
|
- WarningDto warningDto = new WarningDto(warningEnum, faceCount, null, recordId,
|
|
|
- String.valueOf(jsonObject.get("photoUrl")));
|
|
|
+ WarningDto warningDto = new WarningDto(warningEnum, faceCount, null, recordId, String.valueOf(jsonObject.get("photoUrl")));
|
|
|
if (faceCount > 1) {//多张人脸
|
|
|
String multipleFaceRandom = ExamRecordCacheUtil.getMultipleFaceCountErrorRandom(recordId);
|
|
|
if (Objects.isNull(multipleFaceRandom)) {
|
|
|
multipleFaceRandom = SystemConstant.getNanoId();
|
|
|
ExamRecordCacheUtil.setMultipleFaceCountErrorRandom(recordId, multipleFaceRandom);
|
|
|
}
|
|
|
- ExamRecordCacheUtil.setMultipleFaceCountErrorNum(recordId,
|
|
|
- new AtomicInteger(ExamRecordCacheUtil.getMultipleFaceCountErrorNum(recordId).incrementAndGet()));
|
|
|
+ ExamRecordCacheUtil.setMultipleFaceCountErrorNum(recordId, new AtomicInteger(ExamRecordCacheUtil.getMultipleFaceCountErrorNum(recordId).incrementAndGet()));
|
|
|
warningDto.setRandom(multipleFaceRandom);
|
|
|
- livenessVerifyHistoryService
|
|
|
- .save(id, recordId, type, actions, retry, startTime, finishTime, exception,
|
|
|
- multipleFaceRandom);
|
|
|
+ livenessVerifyHistoryService.save(id, recordId, type, actions, retry, startTime, finishTime, exception, multipleFaceRandom);
|
|
|
Integer count = ExamRecordCacheUtil.getMultipleFaceCountErrorNum(recordId).get();
|
|
|
if (count > teConfig.getMultipleFaceCountError()) {
|
|
|
- ExamRecordCacheUtil.setMultipleFaceCountErrorRandom(recordId,
|
|
|
- SystemConstant.getNanoId());
|
|
|
+ ExamRecordCacheUtil.setMultipleFaceCountErrorRandom(recordId, SystemConstant.getNanoId());
|
|
|
ExamRecordCacheUtil.setMultipleFaceCountErrorNum(recordId, new AtomicInteger(0));
|
|
|
warningService.faceCountError(warningDto);
|
|
|
}
|
|
@@ -636,47 +599,41 @@ public class MqLogicServiceImpl implements MqLogicService {
|
|
|
noFaceRandom = SystemConstant.getNanoId();
|
|
|
ExamRecordCacheUtil.setNoFaceCountErrorRandom(recordId, noFaceRandom);
|
|
|
}
|
|
|
- ExamRecordCacheUtil.setNoFaceCountErrorNum(recordId,
|
|
|
- new AtomicInteger(ExamRecordCacheUtil.getMultipleFaceCountErrorNum(recordId).incrementAndGet()));
|
|
|
+ ExamRecordCacheUtil.setNoFaceCountErrorNum(recordId, new AtomicInteger(ExamRecordCacheUtil.getMultipleFaceCountErrorNum(recordId).incrementAndGet()));
|
|
|
warningDto.setRandom(noFaceRandom);
|
|
|
- livenessVerifyHistoryService
|
|
|
- .save(id, recordId, type, actions, retry, startTime, finishTime, exception,
|
|
|
- noFaceRandom);
|
|
|
+ livenessVerifyHistoryService.save(id, recordId, type, actions, retry, startTime, finishTime, exception, noFaceRandom);
|
|
|
Integer count = ExamRecordCacheUtil.getNoFaceCountErrorNum(recordId).get();
|
|
|
if (count > teConfig.getNoFaceCountError()) {
|
|
|
- ExamRecordCacheUtil.setNoFaceCountErrorRandom(recordId,
|
|
|
- SystemConstant.getNanoId());
|
|
|
+ ExamRecordCacheUtil.setNoFaceCountErrorRandom(recordId, SystemConstant.getNanoId());
|
|
|
ExamRecordCacheUtil.setNoFaceCountErrorNum(recordId, new AtomicInteger(0));
|
|
|
warningService.faceCountError(warningDto);
|
|
|
}
|
|
|
}
|
|
|
} else if (Objects.equals(VerifyExceptionEnum.FACE_COMPARE_ERROR, warningEnum)) {//人脸比对异常
|
|
|
- WarningDto warningDto = new WarningDto(warningEnum, null, null, recordId,
|
|
|
- String.valueOf(jsonObject.get("photoUrl")));
|
|
|
+ WarningDto warningDto = new WarningDto(warningEnum, null, null, recordId, String.valueOf(jsonObject.get("photoUrl")));
|
|
|
String faceCompareErrorRandom = ExamRecordCacheUtil.getFaceCompareErrorRandom(recordId);
|
|
|
if (Objects.isNull(faceCompareErrorRandom)) {
|
|
|
faceCompareErrorRandom = SystemConstant.getNanoId();
|
|
|
ExamRecordCacheUtil.setFaceCompareErrorRandom(recordId, faceCompareErrorRandom);
|
|
|
}
|
|
|
- ExamRecordCacheUtil.setFaceCompareErrorNum(recordId,
|
|
|
- new AtomicInteger(ExamRecordCacheUtil.getFaceCompareErrorNum(recordId).incrementAndGet()));
|
|
|
+ ExamRecordCacheUtil.setFaceCompareErrorNum(recordId, new AtomicInteger(ExamRecordCacheUtil.getFaceCompareErrorNum(recordId).incrementAndGet()));
|
|
|
warningDto.setRandom(faceCompareErrorRandom);
|
|
|
- livenessVerifyHistoryService
|
|
|
- .save(id, recordId, type, actions, retry, startTime, finishTime, exception,
|
|
|
- faceCompareErrorRandom);
|
|
|
+ livenessVerifyHistoryService.save(id, recordId, type, actions, retry, startTime, finishTime, exception, faceCompareErrorRandom);
|
|
|
Integer count = ExamRecordCacheUtil.getFaceCompareErrorNum(recordId).get();
|
|
|
if (count > teConfig.getTotalFaceCompareErrorCount()) {
|
|
|
- ExamRecordCacheUtil.setFaceCompareErrorRandom(recordId,
|
|
|
- SystemConstant.getNanoId());
|
|
|
+ ExamRecordCacheUtil.setFaceCompareErrorRandom(recordId, SystemConstant.getNanoId());
|
|
|
ExamRecordCacheUtil.setFaceCompareErrorNum(recordId, new AtomicInteger(0));
|
|
|
warningService.faceCompareError(warningDto);
|
|
|
}
|
|
|
+ } else if (Objects.equals(VerifyExceptionEnum.LIVENESS_ACTION_ERROR, warningEnum)) {//活检动作错误
|
|
|
+ WarningDto warningDto = new WarningDto(warningEnum, null, null, recordId, String.valueOf(jsonObject.get("photoUrl")));
|
|
|
+ livenessVerifyHistoryService.save(id, recordId, type, actions, retry, startTime, finishTime, exception, null);
|
|
|
+ warningService.livenessActionError(warningDto);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- livenessVerifyHistoryService
|
|
|
- .save(id, recordId, type, actions, retry, startTime, finishTime, exception, null);
|
|
|
+ livenessVerifyHistoryService.save(id, recordId, type, actions, retry, startTime, finishTime, exception, null);
|
|
|
}
|
|
|
tmRocketMessageService.saveMqMessageSuccess(mqDto, key);
|
|
|
}
|