|
@@ -8,7 +8,6 @@ import cn.com.qmth.examcloud.core.oe.student.dao.entity.ExamCaptureQueueEntity;
|
|
import cn.com.qmth.examcloud.core.oe.student.dao.enums.ExamCaptureQueueStatus;
|
|
import cn.com.qmth.examcloud.core.oe.student.dao.enums.ExamCaptureQueueStatus;
|
|
import cn.com.qmth.examcloud.core.oe.task.service.ExamRecordDataService;
|
|
import cn.com.qmth.examcloud.core.oe.task.service.ExamRecordDataService;
|
|
import cn.com.qmth.examcloud.starters.face.verify.common.CommonUtils;
|
|
import cn.com.qmth.examcloud.starters.face.verify.common.CommonUtils;
|
|
-import cn.com.qmth.examcloud.starters.face.verify.common.FaceVerifyException;
|
|
|
|
import cn.com.qmth.examcloud.starters.face.verify.model.FaceResult;
|
|
import cn.com.qmth.examcloud.starters.face.verify.model.FaceResult;
|
|
import cn.com.qmth.examcloud.starters.face.verify.model.param.ImageBase64Parm;
|
|
import cn.com.qmth.examcloud.starters.face.verify.model.param.ImageBase64Parm;
|
|
import cn.com.qmth.examcloud.starters.face.verify.model.param.ImageParm;
|
|
import cn.com.qmth.examcloud.starters.face.verify.model.param.ImageParm;
|
|
@@ -130,9 +129,9 @@ public class FaceVerifyJobHandler {
|
|
faceCompareResult = faceVerifyService.faceCompareByFacePlus(basePhoto, capturePhoto);
|
|
faceCompareResult = faceVerifyService.faceCompareByFacePlus(basePhoto, capturePhoto);
|
|
}
|
|
}
|
|
|
|
|
|
- if (!faceCompareResult.isApiSuccess()) {
|
|
|
|
- throw new FaceVerifyException(faceCompareResult.getError());
|
|
|
|
- }
|
|
|
|
|
|
+ // if (!faceCompareResult.needReTry()) {
|
|
|
|
+ // throw new FaceVerifyException(faceCompareResult.getError());
|
|
|
|
+ // }
|
|
|
|
|
|
queue.setIsPass(faceCompareResult.isPass());
|
|
queue.setIsPass(faceCompareResult.isPass());
|
|
queue.setFaceCompareResult(faceCompareResult.getJsonResult());
|
|
queue.setFaceCompareResult(faceCompareResult.getJsonResult());
|
|
@@ -156,6 +155,8 @@ public class FaceVerifyJobHandler {
|
|
if (!faceCompareResult.isPass()) {
|
|
if (!faceCompareResult.isPass()) {
|
|
queue.setExtMsg(faceCompareResult.getError());
|
|
queue.setExtMsg(faceCompareResult.getError());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ examCaptureQueueRepo.save(queue);
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
int errorNum = queue.getErrorNum() != null ? queue.getErrorNum() : 0;
|
|
int errorNum = queue.getErrorNum() != null ? queue.getErrorNum() : 0;
|
|
@@ -166,13 +167,13 @@ public class FaceVerifyJobHandler {
|
|
log.error("人脸比对错误!examRecordDataId:{} queueId:{} errorNum:{} error:{}", queue.getExamRecordDataId(),
|
|
log.error("人脸比对错误!examRecordDataId:{} queueId:{} errorNum:{} error:{}", queue.getExamRecordDataId(),
|
|
queue.getId(), queue.getErrorNum(), e.getMessage());
|
|
queue.getId(), queue.getErrorNum(), e.getMessage());
|
|
examCaptureQueueRepo.save(queue);
|
|
examCaptureQueueRepo.save(queue);
|
|
- return;
|
|
|
|
|
|
+ continue;
|
|
}
|
|
}
|
|
|
|
|
|
if (errFaceNum) {
|
|
if (errFaceNum) {
|
|
// 没有检测到正常人脸,直接保存人脸检测最终结果并删除该队列记录
|
|
// 没有检测到正常人脸,直接保存人脸检测最终结果并删除该队列记录
|
|
this.saveExamCaptureAndDeleteQueue(queue);
|
|
this.saveExamCaptureAndDeleteQueue(queue);
|
|
- return;
|
|
|
|
|
|
+ continue;
|
|
}
|
|
}
|
|
|
|
|
|
try {
|
|
try {
|
|
@@ -180,9 +181,9 @@ public class FaceVerifyJobHandler {
|
|
FaceResult faceLivenessResult = faceVerifyService.faceVerifyByBaidu(capturePhoto);
|
|
FaceResult faceLivenessResult = faceVerifyService.faceVerifyByBaidu(capturePhoto);
|
|
queue.setFacelivenessResult(faceLivenessResult.getJsonResult());
|
|
queue.setFacelivenessResult(faceLivenessResult.getJsonResult());
|
|
|
|
|
|
- if (!faceLivenessResult.isApiSuccess()) {
|
|
|
|
- throw new FaceVerifyException(faceLivenessResult.getError());
|
|
|
|
- }
|
|
|
|
|
|
+ // if (!faceLivenessResult.needReTry()) {
|
|
|
|
+ // throw new FaceVerifyException(faceLivenessResult.getError());
|
|
|
|
+ // }
|
|
|
|
|
|
if (!faceLivenessResult.isPass()) {
|
|
if (!faceLivenessResult.isPass()) {
|
|
queue.setExtMsg(faceLivenessResult.getError());
|
|
queue.setExtMsg(faceLivenessResult.getError());
|
|
@@ -196,7 +197,7 @@ public class FaceVerifyJobHandler {
|
|
log.error("人脸活体检测错误!examRecordDataId:{} queueId:{} errorNum:{} error:{}", queue.getExamRecordDataId(),
|
|
log.error("人脸活体检测错误!examRecordDataId:{} queueId:{} errorNum:{} error:{}", queue.getExamRecordDataId(),
|
|
queue.getId(), queue.getErrorNum(), e.getMessage());
|
|
queue.getId(), queue.getErrorNum(), e.getMessage());
|
|
examCaptureQueueRepo.save(queue);
|
|
examCaptureQueueRepo.save(queue);
|
|
- return;
|
|
|
|
|
|
+ continue;
|
|
}
|
|
}
|
|
|
|
|
|
// 保存人脸检测最终结果并删除该队列记录
|
|
// 保存人脸检测最终结果并删除该队列记录
|