优化代码

This commit is contained in:
RuoYi
2022-02-12 14:23:11 +08:00
parent e66f65b257
commit dbca691746
19 changed files with 37 additions and 49 deletions

View File

@@ -63,9 +63,8 @@ public class SysDeptServiceImpl implements ISysDeptService
{
tempList.add(dept.getDeptId());
}
for (Iterator<SysDept> iterator = depts.iterator(); iterator.hasNext();)
for (SysDept dept : depts)
{
SysDept dept = (SysDept) iterator.next();
// 如果是顶级节点, 遍历该父节点的所有子节点
if (!tempList.contains(dept.getParentId()))
{

View File

@@ -498,7 +498,7 @@ public class SysMenuServiceImpl implements ISysMenuService
*/
private boolean hasChild(List<SysMenu> list, SysMenu t)
{
return getChildList(list, t).size() > 0 ? true : false;
return getChildList(list, t).size() > 0;
}
/**