|
@@ -1,14 +1,28 @@
|
|
package com.keao.edu.user.service.impl;
|
|
package com.keao.edu.user.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
+import com.keao.edu.auth.api.entity.SysUser;
|
|
import com.keao.edu.common.dal.BaseDAO;
|
|
import com.keao.edu.common.dal.BaseDAO;
|
|
|
|
+import com.keao.edu.common.page.PageInfo;
|
|
import com.keao.edu.common.service.impl.BaseServiceImpl;
|
|
import com.keao.edu.common.service.impl.BaseServiceImpl;
|
|
import com.keao.edu.user.dao.ExamReviewDao;
|
|
import com.keao.edu.user.dao.ExamReviewDao;
|
|
|
|
+import com.keao.edu.user.dto.ExamReviewDto;
|
|
|
|
+import com.keao.edu.user.dto.ExamRoomStudentRelationDto;
|
|
import com.keao.edu.user.entity.ExamReview;
|
|
import com.keao.edu.user.entity.ExamReview;
|
|
|
|
+import com.keao.edu.user.entity.Subject;
|
|
|
|
+import com.keao.edu.user.page.ExamReviewQueryInfo;
|
|
import com.keao.edu.user.service.ExamReviewService;
|
|
import com.keao.edu.user.service.ExamReviewService;
|
|
|
|
+import com.keao.edu.util.collection.MapUtil;
|
|
|
|
+import org.apache.poi.ss.formula.functions.T;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
+
|
|
@Service
|
|
@Service
|
|
public class ExamReviewServiceImpl extends BaseServiceImpl<Long, ExamReview> implements ExamReviewService {
|
|
public class ExamReviewServiceImpl extends BaseServiceImpl<Long, ExamReview> implements ExamReviewService {
|
|
|
|
|
|
@@ -19,5 +33,29 @@ public class ExamReviewServiceImpl extends BaseServiceImpl<Long, ExamReview> imp
|
|
public BaseDAO<Long, ExamReview> getDAO() {
|
|
public BaseDAO<Long, ExamReview> getDAO() {
|
|
return examReviewDao;
|
|
return examReviewDao;
|
|
}
|
|
}
|
|
-
|
|
|
|
-}
|
|
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public PageInfo<ExamReviewDto> findExamResult(ExamReviewQueryInfo queryInfo) {
|
|
|
|
+ PageInfo<ExamReviewDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
|
+ Map<String, Object> params = new HashMap<String, Object>();
|
|
|
|
+ MapUtil.populateMap(params, queryInfo);
|
|
|
|
+
|
|
|
|
+ List<ExamReviewDto> dataList = null;
|
|
|
|
+ int count = examReviewDao.countExamResult(params);
|
|
|
|
+ if (count > 0) {
|
|
|
|
+ pageInfo.setTotal(count);
|
|
|
|
+ params.put("offset", pageInfo.getOffset());
|
|
|
|
+ dataList = examReviewDao.findExamResult(params);
|
|
|
|
+ List<Integer> studentIds = dataList.stream().map(ExamReviewDto::getStudentId).collect(Collectors.toList());
|
|
|
|
+ List<Integer> subjectIds = dataList.stream().map(e->e.getExamRegistration().getSubjectId()).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);
|
|
|
|
+ for (ExamReviewDto e : dataList) {
|
|
|
|
+ e.setStudentInfo(new SysUser(e.getStudentId(),studentIdNameMap.get(e.getStudentId())));
|
|
|
|
+ e.getExamRegistration().setSubject(new Subject(e.getExamRegistration().getSubjectId(), subjectIdNameMap.get(e.getExamRegistration().getSubjectId())));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ pageInfo.setRows(dataList);
|
|
|
|
+ return pageInfo;
|
|
|
|
+ }
|
|
|
|
+}
|