From 31f4c15310c7d127ea6e0aaf5c4e9a52dfaf5954 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期四, 27 二月 2025 11:50:18 +0800
Subject: [PATCH] 增加区划代码联动

---
 springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemUserController.java |   36 +++++++++++++++++++++++++++++++-----
 1 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemUserController.java b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemUserController.java
index 1d7edde..d939818 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemUserController.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemUserController.java
@@ -19,6 +19,8 @@
 import com.panzhihua.sangeshenbian.warpper.SystemUserListVo;
 import com.panzhihua.sangeshenbian.warpper.TokenVo;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.BeanUtils;
 import org.springframework.data.redis.core.RedisTemplate;
@@ -27,9 +29,7 @@
 
 import javax.annotation.Resource;
 import java.time.LocalDateTime;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
@@ -197,7 +197,7 @@
 	
 	@PutMapping("/freeze/{id}")
 	@ApiOperation(value = "冻结账号", tags = {"三个身边后台-人员管理"})
-	@OperLog(operModul = "三个身边后台",operType = 0,businessType = "冻结账号")
+	@OperLog(operModul = "三个身边后台",operType = 2,businessType = "冻结账号")
 	public R freeze(@PathVariable("id") Integer id){
 		SystemUser systemUser = systemUserService.getById(id);
 		if(2 == systemUser.getStatus()){
@@ -211,7 +211,7 @@
 	
 	@PutMapping("/unfreeze/{id}")
 	@ApiOperation(value = "解冻账号", tags = {"三个身边后台-人员管理"})
-	@OperLog(operModul = "三个身边后台",operType = 0,businessType = "解冻账号")
+	@OperLog(operModul = "三个身边后台",operType = 2,businessType = "解冻账号")
 	public R unfreeze(@PathVariable("id") Integer id){
 		SystemUser systemUser = systemUserService.getById(id);
 		if(1 == systemUser.getStatus()){
@@ -243,4 +243,30 @@
 		BeanUtils.copyProperties(systemUser, systemUserVo);
 		return R.ok(systemUserVo);
 	}
+	
+	
+	
+	@GetMapping("/getAdministrativeDivision/{id}/{tier}")
+	@ApiOperation(value = "获取行政区划层级联动数据", tags = {"三个身边后台-人员管理"})
+	@ApiImplicitParams({
+			@ApiImplicitParam(name = "id", value = "上级id", required = false, dataType = "string"),
+			@ApiImplicitParam(name = "tier", value = "数据层级(2=区县,3=街道,4=社区)", required = true, dataType = "int"),
+	})
+	@OperLog(operModul = "三个身边后台",operType = 0,businessType = "获取行政区划层级联动数据")
+	public R<List<Map<String, Object>>> getAdministrativeDivision(@PathVariable("id") String id, @PathVariable("tier") Integer tier){
+		List<Map<String, Object>> list = new ArrayList<>();
+		//区县
+		if(2 == tier){
+			list = systemUserService.getRegion("510400");
+		}
+		//街道
+		if(3 == tier){
+			list = systemUserService.getStreet(id);
+		}
+		//社区
+		if(4 == tier){
+			list = systemUserService.getCommunity(id);
+		}
+		return R.ok(list);
+	}
 }

--
Gitblit v1.7.1