|
@@ -2,22 +2,54 @@ package com.keao.edu.user.service.impl;
|
|
|
|
|
|
|
|
|
import com.keao.edu.common.dal.BaseDAO;
|
|
|
+import com.keao.edu.common.page.PageInfo;
|
|
|
+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.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
@Service
|
|
|
public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegistration> implements ExamRegistrationService {
|
|
|
|
|
|
@Autowired
|
|
|
private ExamRegistrationDao examRegistrationDao;
|
|
|
+ @Autowired
|
|
|
+ private AgencyService agencyService;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Long, ExamRegistration> getDAO() {
|
|
|
return examRegistrationDao;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageInfo<ExamRegistration> queryPage(QueryInfo queryInfo) {
|
|
|
+ PageInfo<ExamRegistration> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
+ Map<String, Object> params = new HashMap<String, Object>();
|
|
|
+ MapUtil.populateMap(params, queryInfo);
|
|
|
+
|
|
|
+ List<ExamRegistration> dataList = new ArrayList<>();
|
|
|
+ int count = this.findCount(params);
|
|
|
+ if (count > 0) {
|
|
|
+ pageInfo.setTotal(count);
|
|
|
+ params.put("offset", pageInfo.getOffset());
|
|
|
+ dataList = this.getDAO().queryPage(params);
|
|
|
+ }
|
|
|
+ pageInfo.setRows(dataList);
|
|
|
+
|
|
|
+ List<Integer> agencyIds=new ArrayList<>();
|
|
|
+ agencyIds.add(3);
|
|
|
+ Map map = agencyService.getMap("id_", "name_", agencyIds);
|
|
|
+
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
}
|