|
@@ -12,9 +12,12 @@ import com.keao.edu.user.entity.ExamOrganizationRelation;
|
|
import com.keao.edu.user.entity.ExaminationBasic;
|
|
import com.keao.edu.user.entity.ExaminationBasic;
|
|
import com.keao.edu.user.enums.ExamStatusEnum;
|
|
import com.keao.edu.user.enums.ExamStatusEnum;
|
|
import com.keao.edu.user.enums.YesOrNoEnum;
|
|
import com.keao.edu.user.enums.YesOrNoEnum;
|
|
|
|
+import com.keao.edu.user.page.ExamOrganizationRelationQueryInfo;
|
|
import com.keao.edu.user.service.ExamOrganizationRelationService;
|
|
import com.keao.edu.user.service.ExamOrganizationRelationService;
|
|
import com.keao.edu.user.service.OrganizationService;
|
|
import com.keao.edu.user.service.OrganizationService;
|
|
|
|
+import com.keao.edu.util.collection.MapUtil;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
+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 org.springframework.transaction.annotation.Isolation;
|
|
import org.springframework.transaction.annotation.Isolation;
|
|
@@ -41,8 +44,33 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public PageInfo<ExamOrganizationRelation> queryPage(QueryInfo queryInfo) {
|
|
|
|
- return super.queryPage(queryInfo);
|
|
|
|
|
|
+ public PageInfo<ExamOrganizationRelation> queryExamOrgans(ExamOrganizationRelationQueryInfo queryInfo) {
|
|
|
|
+ PageInfo<ExamOrganizationRelation> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
|
+ Map<String, Object> params = new HashMap<String, Object>();
|
|
|
|
+ MapUtil.populateMap(params, queryInfo);
|
|
|
|
+
|
|
|
|
+ List<Integer> nextLevelOrganIds = organizationService.getNextLevelOrganIds(queryInfo.getOrganId(), true);
|
|
|
|
+ params.put("organIds", nextLevelOrganIds);
|
|
|
|
+
|
|
|
|
+ List<ExamOrganizationRelation> dataList = new ArrayList<>();
|
|
|
|
+ int count = this.findCount(params);
|
|
|
|
+ if (count > 0) {
|
|
|
|
+ pageInfo.setTotal(count);
|
|
|
|
+ params.put("offset", pageInfo.getOffset());
|
|
|
|
+ dataList = this.getDAO().queryPage(params);
|
|
|
|
+ List<Integer> organIds = dataList.stream().map(ExamOrganizationRelation::getOrganId).collect(Collectors.toList());
|
|
|
|
+ List<ExamOrganizationRelation> countInfos = examOrganizationRelationDao.countExamOrganStudentAndPayment(queryInfo.getExamId(), organIds);
|
|
|
|
+ Map<Integer, ExamOrganizationRelation> organCountInfoMap = countInfos.stream().collect(Collectors.toMap(ExamOrganizationRelation::getOrganId, e -> e));
|
|
|
|
+ for (ExamOrganizationRelation examOrganizationRelation : dataList) {
|
|
|
|
+ ExamOrganizationRelation countInfo = organCountInfoMap.get(examOrganizationRelation.getOrganId());
|
|
|
|
+ if(Objects.nonNull(countInfo)){
|
|
|
|
+ examOrganizationRelation.setTotalRegistrationStudentNum(countInfo.getTotalRegistrationStudentNum());
|
|
|
|
+ examOrganizationRelation.setTotalPaymentAmount(countInfo.getTotalPaymentAmount());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ pageInfo.setRows(dataList);
|
|
|
|
+ return pageInfo;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|