From 5ca038d888922e93bf45c7bd37f3c6dce849dcff Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期五, 24 十二月 2021 11:36:02 +0800 Subject: [PATCH] update 调整监控依赖 从 common 迁移到 framework --- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 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 995bd2d..0f8897f 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 @@ -1,10 +1,10 @@ package com.ruoyi.system.service.impl; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.convert.Convert; import cn.hutool.core.lang.tree.Tree; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.domain.entity.SysRole; @@ -46,8 +46,9 @@ * @return 閮ㄩ棬淇℃伅闆嗗悎 */ @Override - @DataScope(deptAlias = "d") public List<SysDept> selectDeptList(SysDept dept) { +// return baseMapper.selectList(); +// return baseMapper.selectList(new LambdaQueryWrapper<>()); return baseMapper.selectDeptList(dept); } @@ -59,7 +60,11 @@ */ @Override public List<Tree<Long>> buildDeptTreeSelect(List<SysDept> depts) { - return TreeBuildUtils.build(depts, (dept, tree) -> + if (CollUtil.isEmpty(depts)) { + return CollUtil.newArrayList(); + } + Long parentId = depts.get(0).getParentId(); + return TreeBuildUtils.build(depts, parentId, (dept, tree) -> tree.setId(dept.getDeptId()) .setParentId(dept.getParentId()) .setName(dept.getDeptName()) @@ -73,7 +78,7 @@ * @return 閫変腑閮ㄩ棬鍒楄〃 */ @Override - public List<Integer> selectDeptListByRoleId(Long roleId) { + public List<Long> selectDeptListByRoleId(Long roleId) { SysRole role = roleMapper.selectById(roleId); return baseMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly()); } -- Gitblit v1.9.3