From 8b7258c9427882bb1798f1502eaa35184c6e374e Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Fri, 09 Aug 2024 14:29:18 +0800
Subject: [PATCH] 短信指定楼栋发送

---
 src/main/java/org/springblade/common/cache/SysCache.java |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/springblade/common/cache/SysCache.java b/src/main/java/org/springblade/common/cache/SysCache.java
index 100c552..792babf 100644
--- a/src/main/java/org/springblade/common/cache/SysCache.java
+++ b/src/main/java/org/springblade/common/cache/SysCache.java
@@ -13,6 +13,7 @@
 import java.util.List;
 import java.util.stream.Collectors;
 
+import static org.springblade.common.cache.CacheNames.ARTICLE_KEY;
 import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
 
 /**
@@ -400,12 +401,8 @@
 				// 查询对应的区域编号code
 				Dept dept = deptService.getById(id);
 				if (null != dept) {
-					if (
-						(roleName.equals("mj") && dept.getDeptNature()==1) ||
-						(
-							(roleName.equals("wgy") || roleName.equals("wzcj")) && dept.getDeptNature()==2
-						)
-					){
+					if ((roleName.equals("mj") && dept.getDeptNature() == 1) ||
+						((roleName.equals("wgy") || roleName.equals("wzcj")) && dept.getDeptNature() == 2)) {
 						if (!AuthUtil.isAdministrator()) {
 							if (dept.getRegionCode() == null) {
 								return;
@@ -508,4 +505,12 @@
 		return CacheUtil.get(SYS_CACHE, REGION_CHILD_CODE, regionCode, () -> regionService.getRegionChild(regionCode,communityCode));
 	}
 
+	/**
+	 * 查询当前文章范围对应的社区编号字符串集合
+	 * @param articleRange
+	 * @return
+	 */
+	public static String getAllCommunityNameListString(String articleRange,String id) {
+		return CacheUtil.get(ARTICLE_KEY, "id", id ,() -> regionService.getAllCommunityNameListString(articleRange));
+	}
 }

--
Gitblit v1.9.3