|
@@ -630,9 +630,9 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
|
|
|
if (StringUtils.isBlank(tSyncDataStudent.getCourseCode())) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("课程代码必填");
|
|
|
}
|
|
|
- if (StringUtils.isBlank(tSyncDataStudent.getCourseCollegeName())) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("课程开课学院必填");
|
|
|
- }
|
|
|
+// if (StringUtils.isBlank(tSyncDataStudent.getCourseCollegeName())) {
|
|
|
+// throw ExceptionResultEnum.ERROR.exception("课程开课学院必填");
|
|
|
+// }
|
|
|
if (needPaperNumber && StringUtils.isBlank(tSyncDataStudent.getPaperNumber())) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("试卷编号必填");
|
|
|
}
|
|
@@ -658,21 +658,35 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
|
|
|
Long courseId = null;
|
|
|
String key = tSyncDataStudent.getCourseCode() + SystemConstant.HYPHEN + tSyncDataStudent.getCourseCollegeName();
|
|
|
if (!basicCourseIdMap.containsKey(key)) {
|
|
|
- List<SysOrg> sysOrgList = sysOrgService.getSecondOrg(schoolId, tSyncDataStudent.getCourseCollegeName());
|
|
|
- if (CollectionUtils.isEmpty(sysOrgList)) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("开课学院[" + tSyncDataStudent.getCourseCollegeName() + "]在学院层级不存在");
|
|
|
- } else if (sysOrgList.size() == 1) {
|
|
|
- SysOrg sysOrg = sysOrgList.get(0);
|
|
|
- // 校验课程代码和开课学院
|
|
|
- BasicCourse basicCourse = basicCourseService.getByTeachRoomIdAndCode(sysOrg.getId(), tSyncDataStudent.getCourseCode());
|
|
|
- if (Objects.isNull(basicCourse)) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("课程代码[" + tSyncDataStudent.getCourseCode() + "]在开课学院[" + tSyncDataStudent.getCourseCollegeName() + "]不存在");
|
|
|
+ String courseCollege = tSyncDataStudent.getCourseCollegeName();
|
|
|
+ if (StringUtils.isNotBlank(courseCollege)) {
|
|
|
+ List<SysOrg> sysOrgList = sysOrgService.getSecondOrg(schoolId, tSyncDataStudent.getCourseCollegeName());
|
|
|
+ if (CollectionUtils.isEmpty(sysOrgList)) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("开课学院[" + tSyncDataStudent.getCourseCollegeName() + "]在学院层级不存在");
|
|
|
+ } else if (sysOrgList.size() == 1) {
|
|
|
+ SysOrg sysOrg = sysOrgList.get(0);
|
|
|
+ // 校验课程代码和开课学院
|
|
|
+ BasicCourse basicCourse = basicCourseService.getByTeachRoomIdAndCode(sysOrg.getId(), tSyncDataStudent.getCourseCode());
|
|
|
+ if (Objects.isNull(basicCourse)) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("课程代码[" + tSyncDataStudent.getCourseCode() + "]在开课学院[" + tSyncDataStudent.getCourseCollegeName() + "]不存在");
|
|
|
+ } else {
|
|
|
+ courseId = basicCourse.getId();
|
|
|
+ basicCourseIdMap.put(key, basicCourse.getId());
|
|
|
+ }
|
|
|
} else {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("开课学院[" + tSyncDataStudent.getCourseCollegeName() + "]存在多个相同值");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ List<BasicCourse> basicCourseList = basicCourseService.listBySchoolIdAndCode(schoolId, tSyncDataStudent.getCourseCode());
|
|
|
+ if (CollectionUtils.isEmpty(basicCourseList)) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("课程代码[" + tSyncDataStudent.getCourseCode() + "]不存在");
|
|
|
+ } else if (basicCourseList.size() == 1) {
|
|
|
+ BasicCourse basicCourse = basicCourseList.get(0);
|
|
|
courseId = basicCourse.getId();
|
|
|
basicCourseIdMap.put(key, basicCourse.getId());
|
|
|
+ } else {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("课程代码[" + tSyncDataStudent.getCourseCode() + "]存在多个值,开课学院[" + tSyncDataStudent.getCourseCollegeName() + "]必填");
|
|
|
}
|
|
|
- } else {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("开课学院[" + tSyncDataStudent.getCourseCollegeName() + "]存在多个相同值");
|
|
|
}
|
|
|
} else {
|
|
|
courseId = basicCourseIdMap.get(key);
|
|
@@ -718,7 +732,7 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
|
|
|
|
|
|
if (StringUtils.isNotBlank(tSyncDataStudent.getPaperNumber())) {
|
|
|
if (paperNumberCourseIdMap.containsKey(tSyncDataStudent.getPaperNumber())) {
|
|
|
- if (!paperNumberCourseIdMap.get(basicExamStudent.getPaperNumber()).equals(basicExamStudent.getCourseId())) {
|
|
|
+ if (!paperNumberCourseIdMap.get(tSyncDataStudent.getPaperNumber()).equals(basicExamStudent.getCourseId())) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("试卷编号[" + basicExamStudent.getPaperNumber() + "]不能绑定多个课程");
|
|
|
}
|
|
|
} else {
|