From cec9ec95b1a835602c80fafbaa071b8815bdbc44 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期一, 02 六月 2025 14:36:53 +0800
Subject: [PATCH] 小程序接口修改

---
 springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/SystemUserController.java |   34 +++++++++++++---------------------
 1 files changed, 13 insertions(+), 21 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/SystemUserController.java b/springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/SystemUserController.java
index 0342827..0fbf5a7 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/SystemUserController.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/SystemUserController.java
@@ -69,10 +69,6 @@
 	@Resource
 	private IDepartmentService departmentService;
 
-	@Resource
-	private ISystemUserLevelService systemUserLevelService;
-
-
 
 
 
@@ -102,6 +98,12 @@
 		}
 		if(2 == systemUser.getStatus()){
 			return R.fail("当前账号已冻结。");
+		}
+
+		Integer oneDepartmentId = systemUser.getOneDepartmentId();
+		Department byId = departmentService.getById(oneDepartmentId);
+		if(byId.getStatus()==2){
+			 return R.fail("当前单位已关闭。");
 		}
 		//创建token
 		R<LoginReturnVO> reult = tokenService.loginWest(systemUser.getId());
@@ -306,23 +308,6 @@
 		return R.ok();
 	}
 
-	@PostMapping("/setDeptAdmin")
-	@ApiOperation(value = "设置单位管理员", tags = {"西区纪委后台-人员管理"})
-	@OperLog(operModul = "西区纪委后台",operType = 2,businessType = "设置单位管理员")
-	public R setDeptAdmin(@RequestParam(name = "id",value = "用户id",required = true) Integer id, @RequestParam(name = "deptId",value = "单位id",required = true) Integer deptId){
-		SystemUser systemUser = systemUserService.getById(id);
-		if(!systemUser.getOneDepartmentId().equals(deptId)){
-			return R.fail("不能设置非所属单位管理员为单位管理员");
-		}
-		boolean update = systemUserService.update(new LambdaUpdateWrapper<SystemUser>().eq(SystemUser::getIsDeptAdmin, deptId).set(SystemUser::getIsDeptAdmin, 0));
-		if(update){
-			systemUser.setIsDeptAdmin(1);
-			systemUserService.updateById(systemUser);
-			return R.ok();
-		}
-		return R.fail("设置失败");
-	}
-
 
 	@PutMapping("/unfreeze/{id}")
 	@ApiOperation(value = "解冻账号", tags = {"西区纪委后台-人员管理"})
@@ -443,6 +428,13 @@
 	}
 
 
+	@GetMapping("/getDept")
+	@ApiOperation(value = "获取所有单位",tags = {"西区纪委后台-人员管理"})
+	public R<List<Department>> getDept(){
+		List<Department> list4 = departmentService.list();
+		return R.ok(list4);
+	}
+
 
 	@GetMapping("/regionTree")
 	@ApiOperation(value = "获取区县-街道-社区树",tags = {"西区纪委后台-人员管理"})

--
Gitblit v1.7.1