xiatian 1 год назад
Родитель
Сommit
65334dafab

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

@@ -296,11 +296,14 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
 	        if (optional.isPresent()) {
 	            // 修改考试记录为已审
 	            ExamRecordDataEntity entity = optional.get();
-	            entity.setIsAudit(false);
 	            entity.setIsWarn(false);
 	            entity.setIsIllegality(false);
+	            if(examAuditService.updateExamAuditByAllPass(realExamRecordDataId)) {
+	            	entity.setIsAudit(true);
+	            }else {
+	            	entity.setIsAudit(false);
+	            }
 	            examRecordDataRepo.save(entity);
-	            examAuditService.updateExamAuditByAllPass(realExamRecordDataId);
 	        }
         }
     }

+ 1 - 1
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/ExamAuditService.java

@@ -96,6 +96,6 @@ public interface ExamAuditService {
 
 
 
-	void updateExamAuditByAllPass(Long examRecordDataId);
+	boolean updateExamAuditByAllPass(Long examRecordDataId);
 
 }

+ 7 - 3
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamAuditServiceImpl.java

@@ -808,16 +808,20 @@ public class ExamAuditServiceImpl implements ExamAuditService {
 	}
 	
     @Override
-    public void updateExamAuditByAllPass(Long examRecordDataId) {
+    public boolean updateExamAuditByAllPass(Long examRecordDataId) {
         ExamAuditEntity examAuditEntity = examAuditRepo.findByExamRecordDataId(examRecordDataId);
-        if (examAuditEntity == null||AuditStatus.PASS.equals(examAuditEntity.getStatus())) {
-            return;
+        if (examAuditEntity == null) {
+            return false;
+        }
+        if (AuditStatus.PASS.equals(examAuditEntity.getStatus())) {
+            return true;
         }
         examAuditEntity.setDisciplineType(null);
         examAuditEntity.setDisciplineDetail("开启审核全通过");
         examAuditEntity.setStatus(AuditStatus.PASS);
         examAuditEntity.setIllegallyTypeId(null);
         examAuditRepo.save(examAuditEntity);
+        return true;
     }
 
 }