|
@@ -19,6 +19,7 @@ import com.qmth.teachcloud.common.entity.SysOrg;
|
|
|
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.*;
|
|
@@ -50,7 +51,7 @@ public class ExamStudentServiceImpl extends ServiceImpl<ExamStudentMapper, ExamS
|
|
|
return examStudents.stream().filter(m -> StringUtils.isNotBlank(m.getPaperType())).map(m -> m.getPaperType()).distinct().collect(Collectors.toList());
|
|
|
} else {
|
|
|
ExamDetailCourse examDetailCourse = examDetailCourseMapper.selectById(examDetailCourseId);
|
|
|
- if(examDetailCourse != null && StringUtils.isNotBlank(examDetailCourse.getPaperType())){
|
|
|
+ if (examDetailCourse != null && StringUtils.isNotBlank(examDetailCourse.getPaperType())) {
|
|
|
return Arrays.stream(examDetailCourse.getPaperType().split(",")).collect(Collectors.toList());
|
|
|
}
|
|
|
}
|
|
@@ -93,10 +94,10 @@ public class ExamStudentServiceImpl extends ServiceImpl<ExamStudentMapper, ExamS
|
|
|
@Override
|
|
|
public BasicCollege getBasicCollegeByBelongOrgId(String studentCode, Long schoolId) {
|
|
|
List<BasicCollege> basicCollegeList = this.baseMapper.getBasicCollegeByBelongOrgId(studentCode, schoolId);
|
|
|
- if (basicCollegeList.size() != 1){
|
|
|
- throw ExceptionResultEnum.ERROR.exception("学生学院数据异常");
|
|
|
+ if (!CollectionUtils.isEmpty(basicCollegeList)) {
|
|
|
+ return basicCollegeList.get(0);
|
|
|
}
|
|
|
- return basicCollegeList.get(0);
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -114,7 +115,7 @@ public class ExamStudentServiceImpl extends ServiceImpl<ExamStudentMapper, ExamS
|
|
|
List<SyncExamStudentDto> syncExamStudentDtoList = new ArrayList<>();
|
|
|
for (ExamDetailCourseDto examDetailCourseDto : examDetailCourseList) {
|
|
|
List<SyncExamStudentDto> syncExamStudentDtos = this.baseMapper.listStudentByExamDetailCourseId(examDetailCourseDto.getId());
|
|
|
- if(!syncExamStudentDtos.isEmpty()){
|
|
|
+ if (!syncExamStudentDtos.isEmpty()) {
|
|
|
syncExamStudentDtoList.addAll(syncExamStudentDtos);
|
|
|
}
|
|
|
}
|