From b3b566ebdfed4005aaa513da3d5d2fd3924903cc Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Wed, 31 Jan 2024 16:17:54 +0800
Subject: [PATCH] 拿不到地址总表数据,不设置网格信息

---
 src/main/java/org/springblade/modules/community/service/impl/CommunityServiceImpl.java |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/springblade/modules/community/service/impl/CommunityServiceImpl.java b/src/main/java/org/springblade/modules/community/service/impl/CommunityServiceImpl.java
index a93bfd4..71bb2db 100644
--- a/src/main/java/org/springblade/modules/community/service/impl/CommunityServiceImpl.java
+++ b/src/main/java/org/springblade/modules/community/service/impl/CommunityServiceImpl.java
@@ -17,6 +17,7 @@
 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;
@@ -39,16 +40,11 @@
 @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));
 	}
 
 	/**

--
Gitblit v1.9.3