|
@@ -31,6 +31,7 @@ import com.qmth.teachcloud.report.business.enums.SemesterEnum;
|
|
import com.qmth.teachcloud.report.business.mapper.*;
|
|
import com.qmth.teachcloud.report.business.mapper.*;
|
|
import com.qmth.teachcloud.report.business.service.TBExamStudentService;
|
|
import com.qmth.teachcloud.report.business.service.TBExamStudentService;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
+import org.checkerframework.checker.units.qual.A;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -312,18 +313,25 @@ public class TBExamStudentServiceImpl extends ServiceImpl<TBExamStudentMapper, T
|
|
// 考生信息
|
|
// 考生信息
|
|
StudentInfo studentInfo = tbStudentMapper.getStudentBySchoolIdAndStudentCode(schoolId, studentCode);
|
|
StudentInfo studentInfo = tbStudentMapper.getStudentBySchoolIdAndStudentCode(schoolId, studentCode);
|
|
if (Objects.isNull(studentInfo)) {
|
|
if (Objects.isNull(studentInfo)) {
|
|
- throw ExceptionResultEnum.ERROR.exception("未找到此考生信息");
|
|
|
|
|
|
+ studentInfo = new StudentInfo();
|
|
}
|
|
}
|
|
reportResult.setStudentInfo(studentInfo);
|
|
reportResult.setStudentInfo(studentInfo);
|
|
|
|
|
|
//考试信息
|
|
//考试信息
|
|
List<ExamInfo> examInfo = tbExamStudentMapper.listExamBySchoolIdAndStudentCode(schoolId, studentCode);
|
|
List<ExamInfo> examInfo = tbExamStudentMapper.listExamBySchoolIdAndStudentCode(schoolId, studentCode);
|
|
if (Objects.isNull(examInfo) || examInfo.size() == 0) {
|
|
if (Objects.isNull(examInfo) || examInfo.size() == 0) {
|
|
- throw ExceptionResultEnum.ERROR.exception("未找到此考生的考试信息");
|
|
|
|
- }
|
|
|
|
- for (ExamInfo info : examInfo) {
|
|
|
|
- List<CourseInfo> courseInfos = tbExamStudentMapper.listCourseByExamIdAndStudentCode(schoolId, info.getExamId(), studentCode);
|
|
|
|
- info.setCourseInfo(courseInfos);
|
|
|
|
|
|
+ examInfo = new ArrayList<>();
|
|
|
|
+ ExamInfo tmpE = new ExamInfo();
|
|
|
|
+ List<CourseInfo> courseInfos = new ArrayList<>();
|
|
|
|
+ CourseInfo courseInfo = new CourseInfo();
|
|
|
|
+ courseInfos.add(courseInfo);
|
|
|
|
+ tmpE.setCourseInfo(courseInfos);
|
|
|
|
+ examInfo.add(tmpE);
|
|
|
|
+ }else {
|
|
|
|
+ for (ExamInfo info : examInfo) {
|
|
|
|
+ List<CourseInfo> courseInfos = tbExamStudentMapper.listCourseByExamIdAndStudentCode(schoolId, info.getExamId(), studentCode);
|
|
|
|
+ info.setCourseInfo(courseInfos);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
reportResult.setExamInfo(examInfo);
|
|
reportResult.setExamInfo(examInfo);
|
|
return reportResult;
|
|
return reportResult;
|