|
@@ -8,9 +8,12 @@ import com.keao.edu.common.page.PageInfo;
|
|
|
import com.keao.edu.common.service.IdGeneratorService;
|
|
|
import com.keao.edu.common.service.impl.BaseServiceImpl;
|
|
|
import com.keao.edu.user.dao.*;
|
|
|
+import com.keao.edu.user.dto.ExamRecordDto;
|
|
|
+import com.keao.edu.user.dto.ExamRegistrationDto;
|
|
|
import com.keao.edu.user.dto.ExamRegistrationStatisticsDto;
|
|
|
import com.keao.edu.user.entity.*;
|
|
|
import com.keao.edu.user.enums.ExamStatusEnum;
|
|
|
+import com.keao.edu.user.page.ExamRecordQueryInfo;
|
|
|
import com.keao.edu.user.page.ExamRegistrationQueryInfo;
|
|
|
import com.keao.edu.user.service.ExamRegistrationPaymentService;
|
|
|
import com.keao.edu.user.service.ExamRegistrationService;
|
|
@@ -33,8 +36,6 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
|
|
|
@Autowired
|
|
|
private StudentDao studentDao;
|
|
|
@Autowired
|
|
|
- private ExamCertificationDao examCertificationDao;
|
|
|
- @Autowired
|
|
|
private ExaminationBasicDao examinationBasicDao;
|
|
|
@Autowired
|
|
|
private SysUserDao sysUserDao;
|
|
@@ -160,4 +161,60 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
|
|
|
}
|
|
|
return examRegistrationStaticsInfo;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageInfo<ExamRegistrationDto> applyList(ExamRegistrationQueryInfo queryInfo) {
|
|
|
+ PageInfo<ExamRegistrationDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
+ Map<String, Object> params = new HashMap<String, Object>();
|
|
|
+ MapUtil.populateMap(params, queryInfo);
|
|
|
+
|
|
|
+ List<ExamRegistrationDto> dataList = null;
|
|
|
+ int count = examRegistrationDao.countStudentList(params);
|
|
|
+ if (count > 0) {
|
|
|
+ pageInfo.setTotal(count);
|
|
|
+ params.put("offset", pageInfo.getOffset());
|
|
|
+ dataList = examRegistrationDao.queryStudentList(params);
|
|
|
+ List<Integer> subjectIds = dataList.stream().map(e -> e.getSubjectId()).collect(Collectors.toList());
|
|
|
+ Map<Integer, String> subjectNameMap = this.getMap("subject", "id_", "name_", subjectIds, Integer.class, String.class);
|
|
|
+ dataList.forEach(e->{
|
|
|
+ e.setSubjectName(subjectNameMap.get(e.getSubjectId()));
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (count == 0) {
|
|
|
+ dataList = new ArrayList<>();
|
|
|
+ }
|
|
|
+ pageInfo.setRows(dataList);
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageInfo<ExamRecordDto> examList(ExamRecordQueryInfo queryInfo) {
|
|
|
+ PageInfo<ExamRecordDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
+ Map<String, Object> params = new HashMap<String, Object>();
|
|
|
+ MapUtil.populateMap(params, queryInfo);
|
|
|
+
|
|
|
+ List<ExamRecordDto> dataList = null;
|
|
|
+ int count = examRegistrationDao.countExamList(params);
|
|
|
+ if (count > 0) {
|
|
|
+ pageInfo.setTotal(count);
|
|
|
+ params.put("offset", pageInfo.getOffset());
|
|
|
+ dataList = examRegistrationDao.queryExamList(params);
|
|
|
+ List<Integer> subjectIds = dataList.stream().map(e -> e.getSubjectId()).collect(Collectors.toList());
|
|
|
+ List<Integer> basicIds = dataList.stream().map(e -> e.getExaminationBasicId()).collect(Collectors.toList());
|
|
|
+ List<Integer> registrationIds = dataList.stream().map(e -> e.getId()).collect(Collectors.toList());
|
|
|
+ Map<Integer, String> subjectNameMap = this.getMap("subject", "id_", "name_", subjectIds, Integer.class, String.class);
|
|
|
+ Map<Integer, String> examNameMap = this.getMap("examination_basic", "id_", "name_", basicIds, Integer.class, String.class);
|
|
|
+ Map<Integer, String> certificationNameMap = this.getMap("exam_certification", "exam_registration_id_", "card_no_", registrationIds, Integer.class, String.class);
|
|
|
+ dataList.forEach(e->{
|
|
|
+ e.setSubjectName(subjectNameMap.get(e.getSubjectId()));
|
|
|
+ e.setSubjectName(examNameMap.get(e.getExaminationBasicId()));
|
|
|
+ e.setSubjectName(certificationNameMap.get(e.getId()));
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (count == 0) {
|
|
|
+ dataList = new ArrayList<>();
|
|
|
+ }
|
|
|
+ pageInfo.setRows(dataList);
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
}
|