From 0ae521a7dc948e3589104f8b48ad49b77ff9d066 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期五, 17 一月 2025 10:42:31 +0800 Subject: [PATCH] update springboot 3.3.5 => 3.4.1 update springdoc 2.7.0 => 2.8.3 update mybatis-plus 3.5.9 => 3.5.10 update hutool 5.8.31 => 5.8.35 update springboot-admin 3.3.4 => 3.4.1 update redisson 3.39.0 => 3.43.0 update mapstruct-plus 1.4.5 => 1.4.6 update lombok 1.18.34 => 1.18.36 update anyline 20241022 => 20250101 update snailjob beta1 => beta1.1 --- ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDataScopeServiceImpl.java | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDataScopeServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDataScopeServiceImpl.java index 018f9a0..12a5072 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDataScopeServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDataScopeServiceImpl.java @@ -5,13 +5,14 @@ import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import lombok.RequiredArgsConstructor; +import org.dromara.common.core.constant.CacheNames; import org.dromara.common.core.utils.StreamUtils; -import org.dromara.common.mybatis.helper.DataBaseHelper; import org.dromara.system.domain.SysDept; import org.dromara.system.domain.SysRoleDept; import org.dromara.system.mapper.SysDeptMapper; import org.dromara.system.mapper.SysRoleDeptMapper; import org.dromara.system.service.ISysDataScopeService; +import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import java.util.List; @@ -37,6 +38,7 @@ * @param roleId 瑙掕壊Id * @return 閮ㄩ棬Id缁� */ + @Cacheable(cacheNames = CacheNames.SYS_ROLE_CUSTOM, key = "#roleId", condition = "#roleId != null") @Override public String getRoleCustom(Long roleId) { if (ObjectUtil.isNull(roleId)) { @@ -58,14 +60,13 @@ * @param deptId 閮ㄩ棬Id * @return 閮ㄩ棬Id缁� */ + @Cacheable(cacheNames = CacheNames.SYS_DEPT_AND_CHILD, key = "#deptId", condition = "#deptId != null") @Override public String getDeptAndChild(Long deptId) { if (ObjectUtil.isNull(deptId)) { return "-1"; } - List<SysDept> deptList = deptMapper.selectList(new LambdaQueryWrapper<SysDept>() - .select(SysDept::getDeptId) - .apply(DataBaseHelper.findInSet(deptId, "ancestors"))); + List<SysDept> deptList = deptMapper.selectListByParentId(deptId); List<Long> ids = StreamUtils.toList(deptList, SysDept::getDeptId); ids.add(deptId); if (CollUtil.isNotEmpty(ids)) { -- Gitblit v1.9.3