|
@@ -227,16 +227,16 @@ public class ImportLogicServiceImpl implements ImportLogicService {
|
|
|
if (stringJoiner.toString().length() == 0) {
|
|
|
basicExamStudents.add(basicExamStudent);
|
|
|
}
|
|
|
-
|
|
|
- map.put(SystemConstant.ERROR_DATA_LIST, basicExamStudentImportList);
|
|
|
- map.put(SystemConstant.DATASOURCE, basicExamStudents);
|
|
|
- map.put(SystemConstant.DATA_COUNT, basicExamStudentImportList.size());
|
|
|
- map.put(SystemConstant.SUCCESS_DATA_COUNT, basicExamStudents.size());
|
|
|
- map.put(SystemConstant.ERROR_DATA_COUNT, basicExamStudentImportList.size() - basicExamStudents.size());
|
|
|
- map.put(SystemConstant.HAS_ERROR_DATA, hasError);
|
|
|
- map.put(SystemConstant.COLUMN_NAMES, basicExamStudentParseDto.getColumnNames());
|
|
|
}
|
|
|
|
|
|
+ map.put(SystemConstant.ERROR_DATA_LIST, basicExamStudentImportList);
|
|
|
+ map.put(SystemConstant.DATASOURCE, basicExamStudents);
|
|
|
+ map.put(SystemConstant.DATA_COUNT, basicExamStudentImportList.size());
|
|
|
+ map.put(SystemConstant.SUCCESS_DATA_COUNT, basicExamStudents.size());
|
|
|
+ map.put(SystemConstant.ERROR_DATA_COUNT, basicExamStudentImportList.size() - basicExamStudents.size());
|
|
|
+ map.put(SystemConstant.HAS_ERROR_DATA, hasError);
|
|
|
+ map.put(SystemConstant.COLUMN_NAMES, basicExamStudentParseDto.getColumnNames());
|
|
|
+
|
|
|
return map;
|
|
|
}
|
|
|
|
|
@@ -289,7 +289,7 @@ public class ImportLogicServiceImpl implements ImportLogicService {
|
|
|
Map<String, Long> courseIdStudentCodeMap = basicExamStudentList.stream().collect(Collectors.toMap(k -> k.getCourseId() + SystemConstant.HYPHEN + k.getStudentCode(), BaseEntity::getId));
|
|
|
|
|
|
// 文件中试卷编号对应多个课程代码
|
|
|
- Map<String, Long> paperNumberWithCourseCodeInExcelMap = new HashMap<>();
|
|
|
+ Map<String, Long> paperNumberCourseIdInMap = new HashMap<>();
|
|
|
Map<String, Long> basicCourseIdMap = new HashMap<>();
|
|
|
|
|
|
// 课程管理中课程代码-课程名
|
|
@@ -358,13 +358,13 @@ public class ImportLogicServiceImpl implements ImportLogicService {
|
|
|
}
|
|
|
|
|
|
// 校验试卷编号和课程代码对应关系
|
|
|
- if (paperNumberWithCourseCodeInExcelMap.containsKey(basicExamStudent.getPaperNumber())) {
|
|
|
- Long courseId = paperNumberWithCourseCodeInExcelMap.get(basicExamStudent.getPaperNumber());
|
|
|
+ if (paperNumberCourseIdInMap.containsKey(basicExamStudent.getPaperNumber())) {
|
|
|
+ Long courseId = paperNumberCourseIdInMap.get(basicExamStudent.getPaperNumber());
|
|
|
if (!basicExamStudent.getCourseId().equals(courseId)) {
|
|
|
stringJoiner.add(String.format("文件中试卷编号[%s]对应多个不同的课程代码", basicExamStudent.getPaperNumber()));
|
|
|
}
|
|
|
} else {
|
|
|
- paperNumberWithCourseCodeInExcelMap.put(basicExamStudent.getPaperNumber(), basicExamStudent.getCourseId());
|
|
|
+ paperNumberCourseIdInMap.put(basicExamStudent.getPaperNumber(), basicExamStudent.getCourseId());
|
|
|
}
|
|
|
|
|
|
if (paperNumberMap.containsKey(basicExamStudent.getPaperNumber())) {
|
|
@@ -372,7 +372,7 @@ public class ImportLogicServiceImpl implements ImportLogicService {
|
|
|
if (examTasks.size() > 1) {
|
|
|
stringJoiner.add(String.format("试卷编号[%s]在考试[%s]下有多条命题任务,请联系管理员处理", basicExamStudent.getPaperNumber(), examId));
|
|
|
} else {
|
|
|
- Long courseId = paperNumberWithCourseCodeInExcelMap.get(basicExamStudent.getPaperNumber());
|
|
|
+ Long courseId = paperNumberCourseIdInMap.get(basicExamStudent.getPaperNumber());
|
|
|
ExamTask examTask = examTasks.get(0);
|
|
|
if (!examTask.getCourseId().equals(courseId)) {
|
|
|
stringJoiner.add(String.format("文件中试卷编号[%s]对应课程代码与命题任务中对应课程代码不一致", basicExamStudent.getPaperNumber()));
|
|
@@ -415,16 +415,19 @@ public class ImportLogicServiceImpl implements ImportLogicService {
|
|
|
if (stringJoiner.toString().length() == 0) {
|
|
|
basicExamStudents.add(basicExamStudent);
|
|
|
}
|
|
|
-
|
|
|
- map.put(SystemConstant.ERROR_DATA_LIST, basicExamStudentImportList);
|
|
|
- map.put(SystemConstant.DATASOURCE, basicExamStudents);
|
|
|
- map.put(SystemConstant.DATA_COUNT, basicExamStudentImportList.size());
|
|
|
- map.put(SystemConstant.SUCCESS_DATA_COUNT, basicExamStudents.size());
|
|
|
- map.put(SystemConstant.ERROR_DATA_COUNT, basicExamStudentImportList.size() - basicExamStudents.size());
|
|
|
- map.put(SystemConstant.HAS_ERROR_DATA, hasError);
|
|
|
- map.put(SystemConstant.COLUMN_NAMES, basicExamStudentParseDto.getColumnNames());
|
|
|
}
|
|
|
|
|
|
+ //校验命题任务是否存在并审核通过
|
|
|
+
|
|
|
+ map.put(SystemConstant.ERROR_DATA_LIST, basicExamStudentImportList);
|
|
|
+ map.put(SystemConstant.DATASOURCE, basicExamStudents);
|
|
|
+ map.put(SystemConstant.DATA_COUNT, basicExamStudentImportList.size());
|
|
|
+ map.put(SystemConstant.SUCCESS_DATA_COUNT, basicExamStudents.size());
|
|
|
+ map.put(SystemConstant.ERROR_DATA_COUNT, basicExamStudentImportList.size() - basicExamStudents.size());
|
|
|
+ map.put(SystemConstant.HAS_ERROR_DATA, hasError);
|
|
|
+ map.put(SystemConstant.COLUMN_NAMES, basicExamStudentParseDto.getColumnNames());
|
|
|
+ map.put("paperNumberCourseIdInMap", paperNumberCourseIdInMap);
|
|
|
+
|
|
|
return map;
|
|
|
}
|
|
|
|
|
@@ -1136,16 +1139,16 @@ public class ImportLogicServiceImpl implements ImportLogicService {
|
|
|
if (stringJoiner.toString().length() == 0) {
|
|
|
basicExamStudents.add(basicExamStudent);
|
|
|
}
|
|
|
-
|
|
|
- map.put(SystemConstant.ERROR_DATA_LIST, basicExamStudentImportList);
|
|
|
- map.put(SystemConstant.DATASOURCE, basicExamStudents);
|
|
|
- map.put(SystemConstant.DATA_COUNT, basicExamStudentImportList.size());
|
|
|
- map.put(SystemConstant.SUCCESS_DATA_COUNT, basicExamStudents.size());
|
|
|
- map.put(SystemConstant.ERROR_DATA_COUNT, basicExamStudentImportList.size() - basicExamStudents.size());
|
|
|
- map.put(SystemConstant.HAS_ERROR_DATA, hasError);
|
|
|
- map.put(SystemConstant.COLUMN_NAMES, basicExamStudentParseDto.getColumnNames());
|
|
|
}
|
|
|
|
|
|
+ map.put(SystemConstant.ERROR_DATA_LIST, basicExamStudentImportList);
|
|
|
+ map.put(SystemConstant.DATASOURCE, basicExamStudents);
|
|
|
+ map.put(SystemConstant.DATA_COUNT, basicExamStudentImportList.size());
|
|
|
+ map.put(SystemConstant.SUCCESS_DATA_COUNT, basicExamStudents.size());
|
|
|
+ map.put(SystemConstant.ERROR_DATA_COUNT, basicExamStudentImportList.size() - basicExamStudents.size());
|
|
|
+ map.put(SystemConstant.HAS_ERROR_DATA, hasError);
|
|
|
+ map.put(SystemConstant.COLUMN_NAMES, basicExamStudentParseDto.getColumnNames());
|
|
|
+
|
|
|
return map;
|
|
|
}
|
|
|
}
|