更新用户信息删除角色问题

master
chen 2 years ago
parent 1e2ed7cbc2
commit 27780b1573
  1. 9
      src/main/java/com/huoran/iasf/service/impl/UserServiceImpl.java

@ -197,10 +197,11 @@ public class UserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impleme
vo.setEmail(vo.getPhone());
}
//删除所有部门
userDeptMapper.delete(Wrappers.<UserDept>lambdaQuery().eq(UserDept::getUserId, vo.getId()));
//更新部门
if (!CollectionUtils.isEmpty(vo.getDeptArchitectureId())) {
//删除所有部门
userDeptMapper.delete(Wrappers.<UserDept>lambdaQuery().eq(UserDept::getUserId, vo.getId()));
List<Integer> deptArchitectureId = vo.getDeptArchitectureId();
for (Integer deptId : deptArchitectureId) {
UserDept userDept = new UserDept();
@ -210,10 +211,12 @@ public class UserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impleme
}
}
if (!CollectionUtils.isEmpty(vo.getRoleIds())) {
LambdaQueryWrapper<SysUserRole> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(SysUserRole::getUserId, vo.getId());
userRoleService.remove(queryWrapper);
if (!CollectionUtils.isEmpty(vo.getRoleIds())) {
UserRoleOperationReqVO reqVO = new UserRoleOperationReqVO();
reqVO.setUserId(vo.getId());
reqVO.setRoleIds(vo.getRoleIds());

Loading…
Cancel
Save