|
@@ -131,6 +131,8 @@ public class ImportLogicServiceImpl implements ImportLogicService {
|
|
boolean needPaperNumber = (basicSchool.getHasPaperNumber() != null && basicSchool.getHasPaperNumber()) || ExamModelEnum.MODEL4.equals(basicExam.getExamModel());
|
|
boolean needPaperNumber = (basicSchool.getHasPaperNumber() != null && basicSchool.getHasPaperNumber()) || ExamModelEnum.MODEL4.equals(basicExam.getExamModel());
|
|
|
|
|
|
Map<String, Long> basicCourseIdMap = new HashMap<>();
|
|
Map<String, Long> basicCourseIdMap = new HashMap<>();
|
|
|
|
+ // 课程学号唯一
|
|
|
|
+ List<String> courseCodeStudentCodeList = new ArrayList<>();
|
|
// 是否有错误提示
|
|
// 是否有错误提示
|
|
boolean hasError = false;
|
|
boolean hasError = false;
|
|
|
|
|
|
@@ -210,6 +212,14 @@ public class ImportLogicServiceImpl implements ImportLogicService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 校验课程学号唯一
|
|
|
|
+ String courseCodeStudentCode = basicExamStudentImport.getCourseCode()+basicExamStudentImport.getStudentCode();
|
|
|
|
+ if(courseCodeStudentCodeList.contains(courseCodeStudentCode)){
|
|
|
|
+ stringJoiner.add("课程代码[" + basicExamStudentImport.getCourseCode() + "]已存在学号["+basicExamStudentImport.getStudentCode()+"]的考生数据");
|
|
|
|
+ } else{
|
|
|
|
+ courseCodeStudentCodeList.add(courseCodeStudentCode);
|
|
|
|
+ }
|
|
|
|
+
|
|
if (basicExamStudent.getCourseId() != null) {
|
|
if (basicExamStudent.getCourseId() != null) {
|
|
if (courseIdStudentCodeMap.containsKey(basicExamStudent.getCourseId() + SystemConstant.HYPHEN + basicExamStudent.getStudentCode())) {
|
|
if (courseIdStudentCodeMap.containsKey(basicExamStudent.getCourseId() + SystemConstant.HYPHEN + basicExamStudent.getStudentCode())) {
|
|
basicExamStudent.setId(courseIdStudentCodeMap.get(basicExamStudent.getCourseId() + SystemConstant.HYPHEN + basicExamStudent.getStudentCode()));
|
|
basicExamStudent.setId(courseIdStudentCodeMap.get(basicExamStudent.getCourseId() + SystemConstant.HYPHEN + basicExamStudent.getStudentCode()));
|
|
@@ -296,6 +306,9 @@ public class ImportLogicServiceImpl implements ImportLogicService {
|
|
Map<String, BasicCourse> courseCodeNameInBasicCourseMap = new HashMap<>();
|
|
Map<String, BasicCourse> courseCodeNameInBasicCourseMap = new HashMap<>();
|
|
List<BasicCourse> basicCourseList = basicCourseService.list(new QueryWrapper<BasicCourse>().lambda().eq(BasicCourse::getSchoolId, schoolId));
|
|
List<BasicCourse> basicCourseList = basicCourseService.list(new QueryWrapper<BasicCourse>().lambda().eq(BasicCourse::getSchoolId, schoolId));
|
|
basicCourseList.forEach(e -> courseCodeNameInBasicCourseMap.put(e.getTeachingRoomId().toString().concat(e.getCode()), e));
|
|
basicCourseList.forEach(e -> courseCodeNameInBasicCourseMap.put(e.getTeachingRoomId().toString().concat(e.getCode()), e));
|
|
|
|
+
|
|
|
|
+ // 课程学号唯一
|
|
|
|
+ List<String> courseCodeStudentCodeList = new ArrayList<>();
|
|
// 是否有错误提示
|
|
// 是否有错误提示
|
|
boolean hasError = false;
|
|
boolean hasError = false;
|
|
|
|
|
|
@@ -404,6 +417,14 @@ public class ImportLogicServiceImpl implements ImportLogicService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 校验课程学号唯一
|
|
|
|
+ String courseCodeStudentCode = basicExamStudentImport.getCourseCode()+basicExamStudentImport.getStudentCode();
|
|
|
|
+ if(courseCodeStudentCodeList.contains(courseCodeStudentCode)){
|
|
|
|
+ stringJoiner.add("课程代码[" + basicExamStudentImport.getCourseCode() + "]已存在学号["+basicExamStudentImport.getStudentCode()+"]的考生数据");
|
|
|
|
+ } else{
|
|
|
|
+ courseCodeStudentCodeList.add(courseCodeStudentCode);
|
|
|
|
+ }
|
|
|
|
+
|
|
if (stringJoiner.toString().length() > 0) {
|
|
if (stringJoiner.toString().length() > 0) {
|
|
basicExamStudentImport.setErrorMsg(stringJoiner.toString());
|
|
basicExamStudentImport.setErrorMsg(stringJoiner.toString());
|
|
}
|
|
}
|
|
@@ -460,8 +481,10 @@ public class ImportLogicServiceImpl implements ImportLogicService {
|
|
|
|
|
|
basicExamStudentParseDto.setColumnNames(columnNames);
|
|
basicExamStudentParseDto.setColumnNames(columnNames);
|
|
|
|
|
|
|
|
+ AtomicInteger i = new AtomicInteger(2);
|
|
dataMapList.forEach(m -> {
|
|
dataMapList.forEach(m -> {
|
|
BasicExamStudentImport basicExamStudentImport = new BasicExamStudentImport();
|
|
BasicExamStudentImport basicExamStudentImport = new BasicExamStudentImport();
|
|
|
|
+ basicExamStudentImport.setRowIndex(i.getAndIncrement());
|
|
Class<BasicExamStudentImport> aClass = (Class<BasicExamStudentImport>) basicExamStudentImport.getClass();
|
|
Class<BasicExamStudentImport> aClass = (Class<BasicExamStudentImport>) basicExamStudentImport.getClass();
|
|
for (Map.Entry<String, String> entry : m.entrySet()) {
|
|
for (Map.Entry<String, String> entry : m.entrySet()) {
|
|
// 必填字段
|
|
// 必填字段
|
|
@@ -1055,6 +1078,9 @@ public class ImportLogicServiceImpl implements ImportLogicService {
|
|
Map<String, BasicExamStudent> courseIdStudentCodeMap = basicExamStudentList.stream().collect(Collectors.toMap(k -> k.getCourseId() + SystemConstant.HYPHEN + k.getStudentCode(), e -> e));
|
|
Map<String, BasicExamStudent> courseIdStudentCodeMap = basicExamStudentList.stream().collect(Collectors.toMap(k -> k.getCourseId() + SystemConstant.HYPHEN + k.getStudentCode(), e -> e));
|
|
|
|
|
|
Map<String, Long> basicCourseIdMap = new HashMap<>();
|
|
Map<String, Long> basicCourseIdMap = new HashMap<>();
|
|
|
|
+
|
|
|
|
+ // 课程学号唯一
|
|
|
|
+ List<String> courseCodeStudentCodeList = new ArrayList<>();
|
|
// 是否有错误提示
|
|
// 是否有错误提示
|
|
boolean hasError = false;
|
|
boolean hasError = false;
|
|
|
|
|
|
@@ -1128,6 +1154,14 @@ public class ImportLogicServiceImpl implements ImportLogicService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 校验课程学号唯一
|
|
|
|
+ String courseCodeStudentCode = basicExamStudentImport.getCourseCode()+basicExamStudentImport.getStudentCode();
|
|
|
|
+ if(courseCodeStudentCodeList.contains(courseCodeStudentCode)){
|
|
|
|
+ stringJoiner.add("课程代码[" + basicExamStudentImport.getCourseCode() + "]已存在学号["+basicExamStudentImport.getStudentCode()+"]的考生数据");
|
|
|
|
+ } else{
|
|
|
|
+ courseCodeStudentCodeList.add(courseCodeStudentCode);
|
|
|
|
+ }
|
|
|
|
+
|
|
if (stringJoiner.toString().length() > 0) {
|
|
if (stringJoiner.toString().length() > 0) {
|
|
basicExamStudentImport.setErrorMsg(stringJoiner.toString());
|
|
basicExamStudentImport.setErrorMsg(stringJoiner.toString());
|
|
}
|
|
}
|