|
@@ -35,7 +35,6 @@ import org.dromara.system.service.ISysUserService;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
import java.util.Collection;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -240,11 +239,9 @@ public class StaffManageServiceImpl implements IStaffManageService {
|
|
|
//根据权限字符去查询角色id
|
|
|
SysRoleVo sysRoleVo = sysRoleMapper.selectVoOne(new LambdaQueryWrapper<SysRole>().eq(SysRole::getRoleKey, staffManage.getStaffCategory()));
|
|
|
if (sysRoleVo != null) {
|
|
|
- List<Long> list = new ArrayList<>();
|
|
|
- Long roleId = sysRoleVo.getRoleId();
|
|
|
- list.add(roleId);
|
|
|
- user.setUserId(userId);
|
|
|
- user.setRoleIds(list.toArray(new Long[list.size()]));
|
|
|
+ Long[] longArray = new Long[1];
|
|
|
+ longArray[0] = sysRoleVo.getRoleId();
|
|
|
+ user.setRoleIds(longArray);
|
|
|
}
|
|
|
userService.insertUserRole(user, false);
|
|
|
}
|
|
@@ -294,11 +291,11 @@ public class StaffManageServiceImpl implements IStaffManageService {
|
|
|
//给该userId赋予角色
|
|
|
// 新增用户与角色管理
|
|
|
//根据权限字符去查询角色id
|
|
|
- Long[] roles;
|
|
|
SysRoleVo sysRoleVo = sysRoleMapper.selectVoOne(new LambdaQueryWrapper<SysRole>().eq(SysRole::getRoleKey, examineStaffManage.getStaffCategory()));
|
|
|
if (sysRoleVo != null) {
|
|
|
- roles = new Long[]{sysRoleVo.getRoleId()};
|
|
|
- sysUser.setRoleIds(roles);
|
|
|
+ Long[] longArray = new Long[1];
|
|
|
+ longArray[0] = sysRoleVo.getRoleId();
|
|
|
+ sysUser.setRoleIds(longArray);
|
|
|
}
|
|
|
userService.insertUserRole(sysUser, true);
|
|
|
}
|
|
@@ -359,7 +356,6 @@ public class StaffManageServiceImpl implements IStaffManageService {
|
|
|
//给该userId赋予角色
|
|
|
// 新增用户与角色管理
|
|
|
//根据权限字符去查询角色id
|
|
|
- Long[] roles;
|
|
|
SysRoleVo sysRoleVo = sysRoleMapper.selectVoOne(new LambdaQueryWrapper<SysRole>().eq(SysRole::getRoleKey, examineStaffManage.getStaffCategory()));
|
|
|
if (sysRoleVo != null) {
|
|
|
Long[] longArray = new Long[1];
|