修复管理员报错

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,11 +92,13 @@ 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(), ",");
List<SystemAuthRole> roleList = systemAuthRoleMapper.selectList(new QueryWrapper<SystemAuthRole>() if (!roleIds.isEmpty()) {
.select("id,name") List<SystemAuthRole> roleList = systemAuthRoleMapper.selectList(new QueryWrapper<SystemAuthRole>()
.in("id", roleIds)); .select("id,name")
for (SystemAuthRole d : roleList) { .in("id", roleIds));
role.add(d.getName()); for (SystemAuthRole d : roleList) {
role.add(d.getName());
}
} }
vo.setRole(ArrayUtil.listToStringByStr(role, "/")); vo.setRole(ArrayUtil.listToStringByStr(role, "/"));
} }
@ -106,12 +108,14 @@ 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(), ",");
List<SystemAuthDept> deptList = systemAuthDeptMapper.selectList(new QueryWrapper<SystemAuthDept>() if (!deptIds.isEmpty()) {
.select("id,name") List<SystemAuthDept> deptList = systemAuthDeptMapper.selectList(new QueryWrapper<SystemAuthDept>()
.in("id", deptIds) .select("id,name")
.eq("is_delete", 0)); .in("id", deptIds)
for (SystemAuthDept d : deptList) { .eq("is_delete", 0));
dept.add(d.getName()); for (SystemAuthDept d : deptList) {
dept.add(d.getName());
}
} }
vo.setDept(ArrayUtil.listToStringByStr(dept, "/")); vo.setDept(ArrayUtil.listToStringByStr(dept, "/"));
} }