|
@@ -130,6 +130,11 @@ public class FaceBiopsyServiceImpl implements FaceBiopsyService {
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public SaveFaceBiopsyResultResp saveFaceBiopsyResult(SaveFaceBiopsyResultReq req, Long studentId) {
|
|
|
+ // 检测结果至少有一条检测结果不允许为空
|
|
|
+ if (!req.getVerifySteps().stream().anyMatch(p -> null != p.getResult())) {
|
|
|
+ throw new StatusException("201005", "检测结果不允许为空");
|
|
|
+ }
|
|
|
+
|
|
|
//构建业务实体
|
|
|
SaveFaceBiopsyResultResp resp = buildSaveFaceBiopsyResultResp(req);
|
|
|
|
|
@@ -223,19 +228,15 @@ public class FaceBiopsyServiceImpl implements FaceBiopsyService {
|
|
|
* @return
|
|
|
*/
|
|
|
private SaveFaceBiopsyResultResp buildSaveFaceBiopsyResultResp(SaveFaceBiopsyResultReq req) {
|
|
|
- List<FaceBiopsyStepInfo> verifySteps = req.getVerifySteps();
|
|
|
- // 检测结果至少有一条检测结果不允许为空
|
|
|
- if (!verifySteps.stream().anyMatch(p -> null != p.getResult())) {
|
|
|
- throw new StatusException("201005", "检测结果不允许为空");
|
|
|
- }
|
|
|
-
|
|
|
- boolean finalIsSuccess = calculateIsSuccess(req.getVerifySteps());
|
|
|
- Boolean isEndExam = calculateIsEndExam(verifySteps, req.getExamRecordDataId(), finalIsSuccess);
|
|
|
-
|
|
|
//构建业务实体
|
|
|
SaveFaceBiopsyResultResp resp = new SaveFaceBiopsyResultResp();
|
|
|
- resp.setEndExam(isEndExam);
|
|
|
+
|
|
|
+ Boolean finalIsSuccess = calculateIsSuccess(req.getVerifySteps());
|
|
|
resp.setVerifyResult(finalIsSuccess);
|
|
|
+
|
|
|
+ Boolean isEndExam = calculateIsEndExam(req.getVerifySteps(), req.getExamRecordDataId(), finalIsSuccess);
|
|
|
+ resp.setEndExam(isEndExam);
|
|
|
+
|
|
|
resp.setNeedNextVerify(calculateNeedNextVerify(isEndExam, finalIsSuccess, req.getExamRecordDataId()));
|
|
|
resp.setErrorMessage(getErrorMsg(req.getVerifySteps()));
|
|
|
return resp;
|
|
@@ -330,6 +331,7 @@ public class FaceBiopsyServiceImpl implements FaceBiopsyService {
|
|
|
|
|
|
/**
|
|
|
* 计算是否结束考试
|
|
|
+ *
|
|
|
* @param verifySteps
|
|
|
* @param examRecordDataId
|
|
|
* @param finalIsSuccess
|