|
@@ -94,11 +94,13 @@ public class UserServiceImpl extends MPJBaseServiceImpl<UserMapper, User> implem
|
|
|
save(user);
|
|
|
|
|
|
|
|
|
- if (dto.getRoleId() != null) {
|
|
|
- UserRoleRelation userRoleRelation = new UserRoleRelation();
|
|
|
- userRoleRelation.setUserId(user.getId());
|
|
|
- userRoleRelation.setRoleId(dto.getRoleId());
|
|
|
- userRoleRelationMapper.insert(userRoleRelation);
|
|
|
+ if (dto.getRoleIds() != null) {
|
|
|
+ for (Long roleId : dto.getRoleIds()) {
|
|
|
+ UserRoleRelation userRoleRelation = new UserRoleRelation();
|
|
|
+ userRoleRelation.setUserId(user.getId());
|
|
|
+ userRoleRelation.setRoleId(roleId);
|
|
|
+ userRoleRelationMapper.insert(userRoleRelation);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
List<UserDeptRelation> userDeptRelationList = new ArrayList<>();
|