瀏覽代碼

修复自动审核的bug

lideyin 5 年之前
父節點
當前提交
e5ee900fa9

+ 12 - 0
examcloud-core-oe-admin-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/admin/api/provider/SyncExamDataCloudServiceProvider.java

@@ -391,17 +391,29 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
     }
 
     private void saveAutoAudit(ExamRecordDataBean examRecordData, boolean isNoPhotoAndIllegality, Long realExamRecordDataId) {
+        boolean isAutoAudit = false;//是否已自动审核
         //无照片违纪自动审核
         if (isNoPhotoAndIllegality) {
             examAuditService.saveExamAuditByNoPhoto(realExamRecordDataId);
+            isAutoAudit = true;
         } else {
             //活体检测失败违纪自动审核
             if (null != examRecordData.getFaceVerifyResult()
                     && IsSuccess.FAILED.name().equals(examRecordData.getFaceVerifyResult())
                     && examRecordData.getIllegality()) {
                 examAuditService.saveExamAuditByFaceVerifyFailed(realExamRecordDataId, examRecordData.getRootOrgId());
+                isAutoAudit = true;
             }
         }
+
+        //如果进行了自动审核,更新考试记录表中的自动审核状态
+        if (isAutoAudit) {
+            //更新考试记录表中的作答记录id
+            ExamRecordDataEntity examRecordDataEntity =
+                    GlobalHelper.getEntity(examRecordDataRepo, realExamRecordDataId, ExamRecordDataEntity.class);
+            examRecordDataEntity.setIsAudit(true);
+            examRecordDataRepo.save(examRecordDataEntity);
+        }
     }
 
     private void syncExamRecordQuestions(ExamRecordQuestionsBean examRecordQuestions, Long realExamRecordDataId) {