From acc8533a344f3baab1af7c7d9e04f4fc2a31ffda Mon Sep 17 00:00:00 2001 From: anthonywj Date: Tue, 28 Mar 2023 21:06:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E7=B9=81=E5=BF=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../glxp/api/controller/auth/SysUserController.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/auth/SysUserController.java b/src/main/java/com/glxp/api/controller/auth/SysUserController.java index 66116932..92840db0 100644 --- a/src/main/java/com/glxp/api/controller/auth/SysUserController.java +++ b/src/main/java/com/glxp/api/controller/auth/SysUserController.java @@ -153,10 +153,10 @@ public class SysUserController extends BaseController { AuthAdmin curUser = getUser(); //先获取账号最大用户量 - CustomerInfoEntity customerInfoEntity = customerInfoService.selectById(curUser.getCustomerId()); + CustomerInfoEntity customerInfoEntity = customerInfoService.selectById(curUser.getCustomerId()); //获取此账号下存在的用户量 List byCustomerld = authAdminService.findByCustomerld(curUser.getCustomerId()); - if(customerInfoEntity.getUserMax() <=byCustomerld.size()){ + if (customerInfoEntity != null && customerInfoEntity.getUserMax() <= byCustomerld.size()) { return ResultVOUtils.error(500, "已到达最大用户量"); } @@ -179,7 +179,7 @@ public class SysUserController extends BaseController { } // 插入角色 - if (authUserSaveRequest.getRoles().size()!=0) { + if (authUserSaveRequest.getRoles().size() != 0) { userService.insertUserAuth(authAdmin.getId(), authUserSaveRequest.getRoles()); } //先获取角色id @@ -190,8 +190,6 @@ public class SysUserController extends BaseController { userService.insertUserAuth1(sysUserRole); - - //插入部门 if (CollUtil.isNotEmpty(authUserSaveRequest.getDepts())) { List list = new ArrayList<>(); @@ -247,12 +245,11 @@ public class SysUserController extends BaseController { return ResultVOUtils.error(ResultEnum.NOT_NETWORK); } // 修改角色 - // userService.insertUserAuth(authAdmin.getId(), authUserSaveRequest.getRoles()); + // userService.insertUserAuth(authAdmin.getId(), authUserSaveRequest.getRoles()); userService.updateAuthAdmin(authAdmin); - //修改所属部门 deptUserService.deleteByUser(authUserSaveRequest.getId()); if (CollUtil.isNotEmpty(authUserSaveRequest.getDepts())) {