|
@@ -7,13 +7,11 @@ import com.keao.edu.common.page.QueryInfo;
|
|
|
import com.keao.edu.common.service.impl.BaseServiceImpl;
|
|
|
import com.keao.edu.user.dao.ExamRegistrationDao;
|
|
|
import com.keao.edu.user.entity.ExamRegistration;
|
|
|
-import com.keao.edu.user.service.AgencyService;
|
|
|
import com.keao.edu.user.service.ExamRegistrationService;
|
|
|
import com.keao.edu.util.collection.MapUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -22,8 +20,6 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
|
|
|
|
|
|
@Autowired
|
|
|
private ExamRegistrationDao examRegistrationDao;
|
|
|
- @Autowired
|
|
|
- private AgencyService agencyService;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Long, ExamRegistration> getDAO() {
|
|
@@ -43,9 +39,12 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
|
|
|
params.put("offset", pageInfo.getOffset());
|
|
|
dataList = this.getDAO().queryPage(params);
|
|
|
List<Integer> agencyIds = dataList.stream().map(ExamRegistration::getAgencyId).collect(Collectors.toList());
|
|
|
- Map<BigDecimal, String> agencyIdNameMap = this.getMap("agency", "id_", "name_", agencyIds, BigDecimal.class, String.class);
|
|
|
+ Map<Integer, String> agencyIdNameMap = this.getMap("agency", "id_", "name_", agencyIds, Integer.class, String.class);
|
|
|
+ List<Integer> subjectIds = dataList.stream().map(ExamRegistration::getSubjectId).collect(Collectors.toList());
|
|
|
+ Map<Integer, String> subjectIdNameMap = this.getMap("subject", "id_", "name_", subjectIds, Integer.class, String.class);
|
|
|
for (ExamRegistration examRegistration : dataList) {
|
|
|
- examRegistration.setSongJson(agencyIdNameMap.get(examRegistration.getAgencyId()));
|
|
|
+ examRegistration.getAgency().setName(agencyIdNameMap.get(examRegistration.getAgencyId()));
|
|
|
+ examRegistration.getSubject().setName(subjectIdNameMap.get(examRegistration.getStudentId()));
|
|
|
}
|
|
|
}
|
|
|
pageInfo.setRows(dataList);
|