| | |
| | | package org.springblade.modules.community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.modules.community.entity.CommunityEntity; |
| | | import org.springblade.modules.community.vo.CommunityVO; |
| | |
| | | @Service |
| | | public class CommunityServiceImpl extends ServiceImpl<CommunityMapper, CommunityEntity> implements ICommunityService { |
| | | |
| | | @Autowired |
| | | private IDeptService deptService; |
| | | |
| | | @Override |
| | | public IPage<CommunityVO> selectCommunityPage(IPage<CommunityVO> page, CommunityVO community) { |
| | | Dept dept = deptService.getById(AuthUtil.getDeptId()); |
| | | if (null!=dept){ |
| | | community.setRegionCode(dept.getRegionCode()); |
| | | } |
| | | return page.setRecords(baseMapper.selectCommunityPage(page, community)); |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator()==true?1:2; |
| | | return page.setRecords(baseMapper.selectCommunityPage(page, community,regionChildCodesList,isAdministrator)); |
| | | } |
| | | |
| | | /** |