|
@@ -1,20 +1,31 @@
|
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
+import com.ym.mec.biz.dal.dao.OrganizationDao;
|
|
|
import com.ym.mec.biz.dal.dao.SchoolDao;
|
|
|
import com.ym.mec.biz.dal.entity.School;
|
|
|
+import com.ym.mec.biz.dal.page.SchoolQueryInfo;
|
|
|
import com.ym.mec.biz.service.SchoolService;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
+import com.ym.mec.common.page.PageInfo;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
+import com.ym.mec.util.collection.MapUtil;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Set;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
|
public class SchoolServiceImpl extends BaseServiceImpl<Integer, School> implements SchoolService {
|
|
|
|
|
|
@Autowired
|
|
|
private SchoolDao schoolDao;
|
|
|
+ @Autowired
|
|
|
+ private OrganizationDao organizationDao;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Integer, School> getDAO() {
|
|
@@ -30,4 +41,16 @@ public class SchoolServiceImpl extends BaseServiceImpl<Integer, School> impleme
|
|
|
public List<School> findVipSchoolByTeacher(Integer teacherId,String organId,Integer isDefault) {
|
|
|
return schoolDao.findVipSchoolByUserId(teacherId,organId,isDefault);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageInfo<School> queryPageDetail(SchoolQueryInfo queryInfo) {
|
|
|
+ PageInfo<School> schoolPageInfo = queryPage(queryInfo);
|
|
|
+ List<School> rows = schoolPageInfo.getRows();
|
|
|
+ Set<Integer> organIds = rows.stream().map(e -> e.getOrganId()).collect(Collectors.toSet());
|
|
|
+ Map<Integer,String> organNames = MapUtil.convertMybatisMap(organizationDao.findOrganNameMap(StringUtils.join(organIds,",")));
|
|
|
+ rows.forEach(e->{
|
|
|
+ e.setOrganName(organNames.get(e.getOrganId()));
|
|
|
+ });
|
|
|
+ return schoolPageInfo;
|
|
|
+ }
|
|
|
}
|