From 77fea47f1fa683f9a0356df3d2328e2bb68b28cf Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Thu, 18 Jan 2024 17:56:22 +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