|
@@ -88,6 +88,14 @@ public class UserController extends ControllerSupport {
|
|
throw new StatusException("B-150001", "非法请求");
|
|
throw new StatusException("B-150001", "非法请求");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Org rootOrg = orgRepo.findOne(rootOrgId);
|
|
|
|
+ if (null == rootOrg) {
|
|
|
|
+ throw new StatusException("B-150003", "机构不存在");
|
|
|
|
+ }
|
|
|
|
+ if (null != rootOrg.getParentId()) {
|
|
|
|
+ throw new StatusException("B-150004", "机构错误");
|
|
|
|
+ }
|
|
|
|
+
|
|
RoleEntity roleEntity = roleRepo.findOne(roleId);
|
|
RoleEntity roleEntity = roleRepo.findOne(roleId);
|
|
if (null == roleEntity) {
|
|
if (null == roleEntity) {
|
|
throw new StatusException("B-150002", "角色不存在");
|
|
throw new StatusException("B-150002", "角色不存在");
|
|
@@ -114,9 +122,12 @@ public class UserController extends ControllerSupport {
|
|
bean.setName(next.getName());
|
|
bean.setName(next.getName());
|
|
bean.setRootOrgId(next.getRootOrgId());
|
|
bean.setRootOrgId(next.getRootOrgId());
|
|
bean.setOrgId(next.getOrgId());
|
|
bean.setOrgId(next.getOrgId());
|
|
- Org org = orgRepo.findOne(Long.valueOf(bean.getOrgId()));
|
|
|
|
- bean.setOrgName(org.getName());
|
|
|
|
- Org rootOrg = orgRepo.findOne(Long.valueOf(bean.getRootOrgId()));
|
|
|
|
|
|
+ if (null != bean.getOrgId()) {
|
|
|
|
+ Org org = orgRepo.findOne(Long.valueOf(bean.getOrgId()));
|
|
|
|
+ if (null != org) {
|
|
|
|
+ bean.setOrgName(org.getName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
bean.setRootOrgName(rootOrg.getName());
|
|
bean.setRootOrgName(rootOrg.getName());
|
|
bean.setEnable(next.getEnable());
|
|
bean.setEnable(next.getEnable());
|
|
|
|
|