|
@@ -8,6 +8,7 @@ import com.keao.edu.common.service.impl.BaseServiceImpl;
|
|
|
import com.keao.edu.user.api.entity.Student;
|
|
|
import com.keao.edu.user.dao.ExaminationBasicDao;
|
|
|
import com.keao.edu.user.dao.StudentExamResultDao;
|
|
|
+import com.keao.edu.user.dto.ExaminationBasicDto;
|
|
|
import com.keao.edu.user.dto.StudentExamResultStatisticsDto;
|
|
|
import com.keao.edu.user.entity.ExaminationBasic;
|
|
|
import com.keao.edu.user.entity.Organization;
|
|
@@ -50,22 +51,28 @@ public class StudentExamResultServiceImpl extends BaseServiceImpl<Long, StudentE
|
|
|
params.put("organIds", childOrganIds);
|
|
|
|
|
|
List<StudentExamResult> dataList = new ArrayList<>();
|
|
|
- int count = this.findCount(params);
|
|
|
+ int count = studentExamResultDao.countStudentExamResult(params);
|
|
|
if (count > 0) {
|
|
|
pageInfo.setTotal(count);
|
|
|
params.put("offset", pageInfo.getOffset());
|
|
|
- dataList = this.getDAO().queryPage(params);
|
|
|
+ dataList = studentExamResultDao.queryStudentExamResult(params);
|
|
|
+ List<Integer> examIds = dataList.stream().map(StudentExamResult::getExaminationBasicId).collect(Collectors.toList());
|
|
|
List<Integer> studentIds = dataList.stream().map(StudentExamResult::getStudentId).collect(Collectors.toList());
|
|
|
List<Integer> subjectIds = dataList.stream().map(e -> e.getExamRegistration().getSubjectId()).collect(Collectors.toList());
|
|
|
List<Integer> organIds = dataList.stream().map(e -> e.getExamRegistration().getOrganId()).collect(Collectors.toList());
|
|
|
Map<Integer, String> studentIdNameMap = this.getMap("sys_user", "id_", "real_name_", studentIds, Integer.class, String.class);
|
|
|
Map<Integer, String> subjectIdNameMap = this.getMap("subject", "id_", "name_", subjectIds, Integer.class, String.class);
|
|
|
Map<Integer, String> organIdNameMap = this.getMap("organization", "id_", "name_", organIds, Integer.class, String.class);
|
|
|
+
|
|
|
+ List<ExaminationBasicDto> exams = examinationBasicDao.getExams(examIds);
|
|
|
+ Map<Integer, ExaminationBasicDto> idExamMap = exams.stream().collect(Collectors.toMap(ExaminationBasic::getId, e -> e));
|
|
|
+
|
|
|
for (StudentExamResult s : dataList) {
|
|
|
Student student=new Student(s.getStudentId(), studentIdNameMap.get(s.getStudentId()));
|
|
|
+ s.setExaminationBasic(idExamMap.get(s.getExaminationBasicId()));
|
|
|
s.getExamRegistration().setSysUser(student);
|
|
|
s.getExamRegistration().setSubject(new Subject(s.getExamRegistration().getSubjectId(), subjectIdNameMap.get(s.getExamRegistration().getSubjectId())));
|
|
|
- s.getExamRegistration().setOrganization(new Organization(s.getExamRegistration().getOrganId(), organIdNameMap.get(s.getExamRegistration().getSubjectId())));
|
|
|
+ s.getExamRegistration().setOrganization(new Organization(s.getExamRegistration().getOrganId(), organIdNameMap.get(s.getExamRegistration().getOrganId())));
|
|
|
}
|
|
|
}
|
|
|
pageInfo.setRows(dataList);
|