From f6222774733db5783c8a06fe933174779c7c58b9 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期二, 10 六月 2025 08:56:41 +0800
Subject: [PATCH] 打通用户数据  新增大屏接口  优化流程

---
 springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/SystemUserController.java |   59 +++++++++++++++--------------------------------------------
 1 files changed, 15 insertions(+), 44 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..9553043 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
@@ -7,7 +7,7 @@
 import com.panzhihua.common.interfaces.OperLog;
 import com.panzhihua.common.model.vos.LoginReturnVO;
 import com.panzhihua.common.model.vos.R;
-import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo;
+import com.panzhihua.common.model.vos.west.SystemUserVo;
 import com.panzhihua.common.service.auth.TokenService;
 import com.panzhihua.westcommittee.annotation.SysLog;
 import com.panzhihua.westcommittee.model.entity.*;
@@ -69,10 +69,6 @@
 	@Resource
 	private IDepartmentService departmentService;
 
-	@Resource
-	private ISystemUserLevelService systemUserLevelService;
-
-
 
 
 
@@ -103,6 +99,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());
 		redisTemplate.delete(key);
@@ -117,14 +119,6 @@
 		if(collect.size() > 0){
 			LambdaQueryWrapper<SystemMenu> queryWrapper = new LambdaQueryWrapper<SystemMenu>().in(SystemMenu::getId, collect);
 			switch (systemUser.getAccountLevel()){
-				case 2:
-					queryWrapper.notIn(SystemMenu::getUrl, Arrays.asList("/system_setting/position_management", "/system_setting/position_management/add", "/system_setting/position_management/del",
-							"/system_setting/role_management", "/system_setting/role_management/add", "/system_setting/role_management/edit", "/system_setting/role_management/del",
-							"/work_order_transaction_management/work_order_item_configuration", "/work_order_transaction_management/work_order_item_configuration/save",
-							"/work_order_transaction_management/problem_type_management", "/work_order_transaction_management/problem_type_management/add",
-							"/work_order_transaction_management/problem_type_management/edit", "/work_order_transaction_management/problem_type_management/del", "/work_order_transaction_management/banner_management",
-							"/work_order_transaction_management/banner_management/add", "/work_order_transaction_management/banner_management/edit", "/work_order_transaction_management/banner_management/del"));
-					break;
 				case 3:
 					queryWrapper.notIn(SystemMenu::getUrl, Arrays.asList("/system_setting/position_management", "/system_setting/position_management/add", "/system_setting/position_management/del",
 							"/system_setting/role_management", "/system_setting/role_management/add", "/system_setting/role_management/edit", "/system_setting/role_management/del",
@@ -211,18 +205,7 @@
 	@ApiOperation(value = "添加人员", tags = {"西区纪委管理后台-人员管理"})
 	@SysLog(operatorCategory = "添加账号",operId = 4)
 	public R add(@RequestBody SystemUser systemUser){
-		Integer id = this.getLoginUserInfoWest().getId();
-		SystemUser user = systemUserService.getById(id);
 
-		if(2 == user.getAccountLevel() && 1 == systemUser.getAccountLevel()){
-			return R.fail("不能添加市级账号");
-		}
-		if(3 == user.getAccountLevel() && 3 < systemUser.getAccountLevel()){
-			return R.fail("不能添加区县和市级账号");
-		}
-		if(4 == user.getAccountLevel() && 4 < systemUser.getAccountLevel()){
-			return R.fail("不能添加街道、区县和市级账号");
-		}
 		long count = systemUserService.count(new LambdaQueryWrapper<SystemUser>().eq(SystemUser::getPhone, systemUser.getPhone()).ne(SystemUser::getStatus, 3));
 		if(0 < count){
 			return R.fail("手机号重复。");
@@ -239,8 +222,6 @@
 		systemUser.setAccountLevel(department.getTier());
 		systemUser.setStatus(1);
 		systemUser.setCreateTime(LocalDateTime.now());
-		// 2.0.1 默认管理员
-		systemUser.setIsAdmin(1);
 		systemUserService.save(systemUser);
 		return R.ok();
 	}
@@ -304,23 +285,6 @@
 		systemUser.setStatus(2);
 		systemUserService.updateById(systemUser);
 		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("设置失败");
 	}
 
 
@@ -443,6 +407,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 = {"西区纪委后台-人员管理"})
@@ -462,7 +433,7 @@
         String jsapiTicket = SignatureUtil.getJsApiTicket(accessToken);
         String nonceStr = UUID.randomUUID().toString().replace("-", "");
         String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
-//        String url = "https://huacheng.psciio.com/web/sangeshenbian/"; // 当前页面的URL,不包含#及其后面部分
+//        String url = "https://huacheng.psciio.com/web/west/"; // 当前页面的URL,不包含#及其后面部分
         String url = "http://192.168.110.91:8080/#/pages/Appeal/Appeal/"; // 当前页面的URL,不包含#及其后面部分
 
         String signature = SignatureUtil.getSignature(jsapiTicket, nonceStr, timestamp, url);

--
Gitblit v1.7.1