|
@@ -112,24 +112,25 @@ public class CourseStatisticServiceImpl implements CourseStatisticService {
|
|
|
Check.isNull(req.getOrgId(), "学校ID不能为空!");
|
|
|
Check.isNull(req.getExamId(), "考试ID不能为空!");
|
|
|
|
|
|
+ //待刷新的课程列表
|
|
|
+ List<ExamCourseInfo> examCourses = null;
|
|
|
+
|
|
|
List<CourseStatisticRefreshReq.Course> courses = req.getCourses();
|
|
|
if (courses == null || courses.size() == 0) {
|
|
|
- //未选择课程时,则跳过统计
|
|
|
- return;
|
|
|
+ //未选择课程时,则统计当前考试下的所有课程
|
|
|
+ examCourses = statisticService.findExamCourseAndPaperTypes(req.getOrgId(), req.getExamId());
|
|
|
+ } else {
|
|
|
+ examCourses = new ArrayList<>();
|
|
|
+ for (CourseStatisticRefreshReq.Course course : courses) {
|
|
|
+ if (course.getCourseId() == null || StringUtils.isBlank(course.getPaperType())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ examCourses.add(new ExamCourseInfo(req.getOrgId(), req.getExamId(), course.getCourseId(), course.getPaperType()));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//获取当前考试下已有的课程统计信息
|
|
|
Map<String, CourseStatistic> oldCourseStatisticMaps = this.getCourseStatisticMaps(req.getOrgId(), req.getExamId());
|
|
|
-
|
|
|
- //待刷新的课程列表
|
|
|
- List<ExamCourseInfo> examCourses = new ArrayList<>();
|
|
|
- for (CourseStatisticRefreshReq.Course course : courses) {
|
|
|
- if (course.getCourseId() == null || StringUtils.isBlank(course.getPaperType())) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- examCourses.add(new ExamCourseInfo(req.getOrgId(), req.getExamId(), course.getCourseId(), course.getPaperType()));
|
|
|
- }
|
|
|
-
|
|
|
this.syncCourseStatistics(examCourses, oldCourseStatisticMaps);
|
|
|
}
|
|
|
|