haogh 7 сар өмнө
parent
commit
1a628a74d1

+ 6 - 1
src/main/java/com/qmth/exam/reserve/service/impl/StudentImportAsyncServiceImpl.java

@@ -58,7 +58,7 @@ public class StudentImportAsyncServiceImpl implements StudentImportAsyncService
     public void asyncImportStudent(StudentImportTaskEntity task, Long orgId, List<DataMap> lineList) {
         Map<String, CategoryEntity> teachingCache = getTeachingCache();
         List<StudentImportInfo> studentList = new ArrayList<>();
-        List<Map<String, Object>> failRecords = new ArrayList<Map<String, Object>>();
+        List<Map<String, Object>> failRecords = new ArrayList<>();
         for (int i = 0; i < lineList.size(); i++) {
             DataMap line = lineList.get(i);
             StringBuilder msg = new StringBuilder();
@@ -136,6 +136,11 @@ public class StudentImportAsyncServiceImpl implements StudentImportAsyncService
             } else {
                 studentList.add(student);
             }
+
+            //只要有错误,就跳出循环
+            if (CollectionUtils.isNotEmpty(failRecords)) {
+                break;
+            }
         }
 
         if (CollectionUtils.isNotEmpty(failRecords)) {