merge
This commit is contained in:
@@ -63,7 +63,7 @@ public class SysAuthorityControl {
|
||||
return JSONObjResult.toJSONObj("禁用子节点权限失败");
|
||||
}
|
||||
} else {
|
||||
// 如果是启用看父节点是否被禁用,一级的不需要判断
|
||||
// 如果是启用,看父节点是否被禁用,一级的不需要判断
|
||||
if (!CommonConstant.ROOT.equals(sysAuthority.getParentId())) {
|
||||
SysAuthority parent = sysAuthorityService.getById(sysAuthority.getParentId());
|
||||
if (parent != null && CommonEnum.YesOrNoEnum.NO.getCode().equals(parent.getEnable()))
|
||||
@@ -88,8 +88,6 @@ public class SysAuthorityControl {
|
||||
@ApiOperation(value = "根据父节点查询子节点")
|
||||
@ApiImplicitParam(name = "parentId", value = "父id,可为空", paramType = "query", dataType = "string")
|
||||
public JSONObject listByParentId(String parentId) {
|
||||
if (StringUtils.isEmpty(parentId))
|
||||
parentId = CommonConstant.ROOT;
|
||||
if (!CommonConstant.ROOT.equals(parentId) && sysAuthorityService.getById(parentId) == null)
|
||||
return JSONObjResult.toJSONObj("父节点不存在");
|
||||
List<SysAuthority> queryByParentId = sysAuthorityService.listByParentEnable(parentId, null);
|
||||
|
||||
@@ -113,8 +113,9 @@ public class SysRoleControl {
|
||||
return JSONObjResult.toJSONObj("该角色不存在");
|
||||
String ids[] = authorityIds.split(",");
|
||||
List<SysRoleAuthority> list = new ArrayList<>();
|
||||
SysRoleAuthority roleAuthority;
|
||||
for (String id : ids) {
|
||||
SysRoleAuthority roleAuthority = new SysRoleAuthority();
|
||||
roleAuthority = new SysRoleAuthority();
|
||||
roleAuthority.setRoleId(roleId);
|
||||
roleAuthority.setAuthorityId(id);
|
||||
list.add(roleAuthority);
|
||||
|
||||
@@ -179,8 +179,9 @@ public class SysUserControl {
|
||||
return JSONObjResult.toJSONObj("不能对管理员进行操作");
|
||||
String ids[] = roleIds.split(",");
|
||||
List<SysUserRole> list = new ArrayList<>();
|
||||
SysUserRole userRole;
|
||||
for (String id : ids) {
|
||||
SysUserRole userRole = new SysUserRole();
|
||||
userRole = new SysUserRole();
|
||||
userRole.setRoleId(id);
|
||||
userRole.setUserId(userId);
|
||||
list.add(userRole);
|
||||
|
||||
Reference in New Issue
Block a user