修复管理员报错

This commit is contained in:
TinyAnts 2022-11-29 18:52:47 +08:00
parent 2c5310ca21
commit 06bc994b42
1 changed files with 15 additions and 11 deletions

View File

@ -92,12 +92,14 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
} else { } else {
List<String> role = new LinkedList<>(); List<String> role = new LinkedList<>();
List<Integer> roleIds = ArrayUtil.stringToListAsInt(vo.getRole(), ","); List<Integer> roleIds = ArrayUtil.stringToListAsInt(vo.getRole(), ",");
if (!roleIds.isEmpty()) {
List<SystemAuthRole> roleList = systemAuthRoleMapper.selectList(new QueryWrapper<SystemAuthRole>() List<SystemAuthRole> roleList = systemAuthRoleMapper.selectList(new QueryWrapper<SystemAuthRole>()
.select("id,name") .select("id,name")
.in("id", roleIds)); .in("id", roleIds));
for (SystemAuthRole d : roleList) { for (SystemAuthRole d : roleList) {
role.add(d.getName()); role.add(d.getName());
} }
}
vo.setRole(ArrayUtil.listToStringByStr(role, "/")); vo.setRole(ArrayUtil.listToStringByStr(role, "/"));
} }
@ -106,6 +108,7 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
} else { } else {
List<String> dept = new LinkedList<>(); List<String> dept = new LinkedList<>();
List<Integer> deptIds = ArrayUtil.stringToListAsInt(vo.getDept(), ","); List<Integer> deptIds = ArrayUtil.stringToListAsInt(vo.getDept(), ",");
if (!deptIds.isEmpty()) {
List<SystemAuthDept> deptList = systemAuthDeptMapper.selectList(new QueryWrapper<SystemAuthDept>() List<SystemAuthDept> deptList = systemAuthDeptMapper.selectList(new QueryWrapper<SystemAuthDept>()
.select("id,name") .select("id,name")
.in("id", deptIds) .in("id", deptIds)
@ -113,6 +116,7 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
for (SystemAuthDept d : deptList) { for (SystemAuthDept d : deptList) {
dept.add(d.getName()); dept.add(d.getName());
} }
}
vo.setDept(ArrayUtil.listToStringByStr(dept, "/")); vo.setDept(ArrayUtil.listToStringByStr(dept, "/"));
} }