Commit 45a4539b0350032ded6b800c682a09a1ec245fe9
1 parent
83832dda
fix: 租户管理员数据更新问题修复
1、组织异常问题。 2、用户角色问题
Showing
1 changed file
with
5 additions
and
6 deletions
... | ... | @@ -312,8 +312,10 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
312 | 312 | baseMapper.updateById(user); |
313 | 313 | if (null != userDTO.getRoleIds()) { |
314 | 314 | deleteAndAddUserRole(user.getId(), userDTO.getRoleIds()); |
315 | + } | |
316 | + if (null != userDTO.getOrganizationIds()) { | |
315 | 317 | userOrganizationMappingService.addOrUpdateUserOrganizationMapping( |
316 | - user.getId(), Arrays.asList(userDTO.getOrganizationIds()), true); | |
318 | + user.getId(), Arrays.asList(userDTO.getOrganizationIds()), true); | |
317 | 319 | } |
318 | 320 | user.copyToDTO(userDTO, PASSWORD, ACTIVATE_TOKEN); |
319 | 321 | return userDTO; |
... | ... | @@ -449,11 +451,8 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
449 | 451 | } |
450 | 452 | baseMapper.insert(user); |
451 | 453 | List<SysTenantRoleEntity> tenantRoleList = validateTenantRole(userDTO.getTenantId()); |
452 | - for (SysTenantRoleEntity tenantRole : tenantRoleList) { | |
453 | - String roleId = tenantRole.getRoleId(); | |
454 | - if(userDTO.getRoleIds().contains(roleId)){ | |
455 | - roleMapper.saveUserRoleMapping(user.getId(), roleId); | |
456 | - } | |
454 | + for (String roleId : userDTO.getRoleIds()) { | |
455 | + roleMapper.saveUserRoleMapping(user.getId(), roleId); | |
457 | 456 | } |
458 | 457 | user.copyToDTO(userDTO, PASSWORD, ACTIVATE_TOKEN); |
459 | 458 | return userDTO; | ... | ... |