|
@@ -54,14 +54,16 @@ public class RoleService extends ServiceImpl<RoleMapper, Role> implements IRoleS
|
|
|
if(roleList != null && roleList.size() > 0){
|
|
|
List<RoleResponse> roleResponseList = new ArrayList<>();
|
|
|
//获取创建者名称
|
|
|
- List<Long> userIdList = ProjectUtils.getAttrList(roleList, "userId", null);
|
|
|
+ List<Long> userIdList = ProjectUtils.getAttrList(roleList, "createUserId", null);
|
|
|
Map<Long, UserInfo> userIdToInfo = userInfoService.userIdToInfo(userIdList);
|
|
|
for(Role role : roleList){
|
|
|
RoleResponse roleResponse = new RoleResponse(role);
|
|
|
//设置创建者名称
|
|
|
if(userIdToInfo != null){
|
|
|
UserInfo userInfo = userIdToInfo.get(role.getCreateUserId());
|
|
|
- roleResponse.setCreateUserName(userInfo.getName());
|
|
|
+ if(userInfo != null){
|
|
|
+ roleResponse.setCreateUserName(userInfo.getName());
|
|
|
+ }
|
|
|
}
|
|
|
roleResponseList.add(roleResponse);
|
|
|
}
|