From 9a895763d55e147be355a2198ecfd33f66c2e746 Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期二, 23 八月 2022 20:59:26 +0800 Subject: [PATCH] 优化页面内嵌iframe切换tab不刷新数据 --- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java | 24 ++++++++++++++++++------ 1 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index a2c3b5b..1aa456f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -49,6 +49,19 @@ } /** + * 查询部门树结构信息 + * + * @param dept 部门信息 + * @return 部门树信息集合 + */ + @Override + public List<TreeSelect> selectDeptTreeList(SysDept dept) + { + List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept); + return buildDeptTreeSelect(depts); + } + + /** * 构建前端所需要树结构 * * @param depts 部门列表 @@ -63,9 +76,8 @@ { 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())) { @@ -100,7 +112,7 @@ * @return 选中部门列表 */ @Override - public List<Integer> selectDeptListByRoleId(Long roleId) + public List<Long> selectDeptListByRoleId(Long roleId) { SysRole role = roleMapper.selectRoleById(roleId); return deptMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly()); @@ -140,7 +152,7 @@ public boolean hasChildByDeptId(Long deptId) { int result = deptMapper.hasChildByDeptId(deptId); - return result > 0 ? true : false; + return result > 0; } /** @@ -153,7 +165,7 @@ public boolean checkDeptExistUser(Long deptId) { int result = deptMapper.checkDeptExistUser(deptId); - return result > 0 ? true : false; + return result > 0; } /** @@ -325,6 +337,6 @@ */ private boolean hasChild(List<SysDept> list, SysDept t) { - return getChildList(list, t).size() > 0 ? true : false; + return getChildList(list, t).size() > 0; } } -- Gitblit v1.9.2