|
@@ -10,6 +10,7 @@ import com.qmth.distributed.print.business.entity.*;
|
|
|
import com.qmth.distributed.print.business.service.*;
|
|
|
import com.qmth.teachcloud.common.entity.BasicMajor;
|
|
|
import com.qmth.teachcloud.common.entity.BasicSchool;
|
|
|
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
|
import com.qmth.teachcloud.common.service.BasicMajorService;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -199,9 +200,13 @@ public class OpenApiServiceImpl implements OpenApiService {
|
|
|
BasicMajor basicMajor = basicMajorService.getById(m.getMajorId());
|
|
|
examStudentScore.setMajor(basicMajor == null ? null : basicMajor.getName());
|
|
|
examStudentScore.setClassName(m.getClazzName());
|
|
|
- GradeBatchStudentClazz gradeBatchStudentClazz = gradeBatchStudentClazzList.isEmpty() ? null : gradeBatchStudentClazzList.stream().filter(s -> s.getClazzId().equals(m.getClazzId().toString()) && s.getPaperNumber().equals(examStudentScore.getPaperNumber()) && s.getPaperType().equals(examStudentScore.getPaperType())).findFirst().orElseGet(null);
|
|
|
- examStudentScore.setTeacherName(gradeBatchStudentClazz != null ? gradeBatchStudentClazz.getTeacherName() : null);
|
|
|
- examStudentScore.setTeacherCode(gradeBatchStudentClazz != null ? gradeBatchStudentClazz.getTeacherNumber() : null);
|
|
|
+ List<GradeBatchStudentClazz> gradeBatchStudentClazzs = gradeBatchStudentClazzList.isEmpty() ? null : gradeBatchStudentClazzList.stream().filter(s -> s.getClazzId().equals(m.getClazzId().toString()) && s.getPaperNumber().equals(examStudentScore.getPaperNumber()) && s.getPaperType().equals(examStudentScore.getPaperType())).collect(Collectors.toList());
|
|
|
+ GradeBatchStudentClazz gradeBatchStudentClazz = gradeBatchStudentClazzs == null || gradeBatchStudentClazzs.isEmpty() ? null : gradeBatchStudentClazzs.get(0);
|
|
|
+ if(gradeBatchStudentClazz == null){
|
|
|
+ throw ExceptionResultEnum.ERROR.exception(String.format("科目[%s],试卷编号[%s],班级[%s]未导入任课老师", examTask.getCourseName(), examTask.getPaperNumber(), m.getClazzName()));
|
|
|
+ }
|
|
|
+ examStudentScore.setTeacherName(gradeBatchStudentClazz.getTeacherName());
|
|
|
+ examStudentScore.setTeacherCode(gradeBatchStudentClazz.getTeacherNumber());
|
|
|
examStudentScore.setStatus(m.getStatus());
|
|
|
examStudentScore.setTotalScore(m.getTotalScore());
|
|
|
examStudentScore.setObjectiveScore(m.getObjectiveScore());
|
|
@@ -210,6 +215,7 @@ public class OpenApiServiceImpl implements OpenApiService {
|
|
|
return examStudentScore;
|
|
|
}
|
|
|
}).collect(Collectors.toList());
|
|
|
- return examStudentScoreList.stream().filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
+ List<ExamStudentScore> list = examStudentScoreList.stream().filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
+ return list;
|
|
|
}
|
|
|
}
|