|
@@ -87,8 +87,6 @@ public class ExamStudentImportForkJoin extends RecursiveTask<Set<String>> {
|
|
|
List<TEExamStudent> teExamStudentUpdateList = new ArrayList<>();
|
|
|
Map<String, TEStudent> teStudentInsertMap = new HashMap<>();
|
|
|
Map<String, TEStudent> teStudentUpdateMap = new HashMap<>();
|
|
|
- List<TEStudent> teStudentInsertList = new ArrayList<>();
|
|
|
- List<TEStudent> teStudentUpdateList = new ArrayList<>();
|
|
|
for (int i = start; i <= end; i++) {
|
|
|
ExamStudentImportDto examStudentImportDto = (ExamStudentImportDto) list.get(i);
|
|
|
if (Objects.equals(modeEnum, ExamModeEnum.TOGETHER)) {
|
|
@@ -147,12 +145,10 @@ public class ExamStudentImportForkJoin extends RecursiveTask<Set<String>> {
|
|
|
if (teStudentExists) {
|
|
|
if (!teStudentInsertMap.containsKey(teStudent.toString())) {
|
|
|
teStudentInsertMap.put(teStudent.toString(), teStudent);
|
|
|
- teStudentInsertList.add(teStudent);
|
|
|
}
|
|
|
} else {
|
|
|
if (!teStudentUpdateMap.containsKey(teStudent.toString())) {
|
|
|
teStudentUpdateMap.put(teStudent.toString(), teStudent);
|
|
|
- teStudentUpdateList.add(teStudent);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -170,11 +166,11 @@ public class ExamStudentImportForkJoin extends RecursiveTask<Set<String>> {
|
|
|
teExamStudentUpdateList.add(teExamStudent);
|
|
|
}
|
|
|
}
|
|
|
- if (!CollectionUtils.isEmpty(teStudentInsertList)) {
|
|
|
- teStudentService.saveBatch(teStudentInsertList);
|
|
|
+ if (!CollectionUtils.isEmpty(teStudentInsertMap)) {
|
|
|
+ teStudentService.saveBatch(teStudentInsertMap.values());
|
|
|
}
|
|
|
- if (!CollectionUtils.isEmpty(teStudentUpdateList)) {
|
|
|
- teStudentService.updateBatchById(teStudentUpdateList);
|
|
|
+ if (!CollectionUtils.isEmpty(teStudentUpdateMap)) {
|
|
|
+ teStudentService.updateBatchById(teStudentUpdateMap.values());
|
|
|
}
|
|
|
if (!CollectionUtils.isEmpty(teExamStudentInsertList)) {
|
|
|
teExamStudentService.saveBatch(teExamStudentInsertList);
|