|
@@ -114,10 +114,21 @@ public class UserController extends ControllerSupport {
|
|
bean.setEnable(next.getEnable());
|
|
bean.setEnable(next.getEnable());
|
|
|
|
|
|
List<UserRole> userRoles = next.getUserRoles();
|
|
List<UserRole> userRoles = next.getUserRoles();
|
|
- List<String> roleNameList = userRoles.stream()
|
|
|
|
- .map(userRole -> RoleMeta.valueOf(userRole.getRoleCode()).getName())
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
+ List<String> roleNameList = Lists.newArrayList();
|
|
|
|
+ List<Long> roleIdList = Lists.newArrayList();
|
|
|
|
+ List<String> roleCodeList = Lists.newArrayList();
|
|
|
|
+ for (UserRole cur : userRoles) {
|
|
|
|
+ RoleEntity curRoleEntity = roleRepo.findByCode(cur.getRoleCode());
|
|
|
|
+ if (null == curRoleEntity) {
|
|
|
|
+ throw new StatusException("B-150002", "角色错误");
|
|
|
|
+ }
|
|
|
|
+ roleNameList.add(curRoleEntity.getName());
|
|
|
|
+ roleIdList.add(curRoleEntity.getId());
|
|
|
|
+ roleCodeList.add(curRoleEntity.getCode());
|
|
|
|
+ }
|
|
bean.setRoleNamesStr(StringUtils.join(roleNameList, ","));
|
|
bean.setRoleNamesStr(StringUtils.join(roleNameList, ","));
|
|
|
|
+ bean.setRoleIds(roleIdList);
|
|
|
|
+ bean.setRoleCodes(roleCodeList);
|
|
|
|
|
|
Org org = orgRepo.findOne(Long.valueOf(bean.getRootOrgId()));
|
|
Org org = orgRepo.findOne(Long.valueOf(bean.getRootOrgId()));
|
|
bean.setRootOrgName(org.getName());
|
|
bean.setRootOrgName(org.getName());
|