From 7e4fb37ab669cd37d9fb94e828842b1a5834789c Mon Sep 17 00:00:00 2001 From: dataprince Date: Mon, 27 Nov 2023 20:47:05 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E9=97=A8=E6=A0=91=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-admin/src/main/resources/application-prod.yml | 2 +- .../com/ruoyi/system/service/impl/SysDeptServiceImpl.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ruoyi-admin/src/main/resources/application-prod.yml b/ruoyi-admin/src/main/resources/application-prod.yml index 3b66250..c6edfce 100644 --- a/ruoyi-admin/src/main/resources/application-prod.yml +++ b/ruoyi-admin/src/main/resources/application-prod.yml @@ -44,7 +44,7 @@ mybatis-flex: # 指定为HikariDataSource type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://localhost:3306/jjry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true + url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true username: root123 password: Root@369---0000 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index 05db883..381bbbf 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -26,7 +26,6 @@ import lombok.RequiredArgsConstructor; import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; -import com.ruoyi.common.core.annotation.DataScope; import com.ruoyi.common.core.constant.UserConstants; import com.ruoyi.common.core.core.text.Convert; import com.ruoyi.common.core.exception.ServiceException; @@ -52,6 +51,8 @@ public class SysDeptServiceImpl extends BaseServiceImpl private SysDeptMapper deptMapper; @Resource private ISysRoleService sysRoleService; + @Resource + private ISysDataScopeService dataScopeService; @Override public QueryWrapper query() { @@ -93,7 +94,7 @@ public class SysDeptServiceImpl extends BaseServiceImpl */ @Override public List selectDeptList(SysDeptBo deptBo) { - QueryWrapper queryWrapper = buildQueryWrapper(deptBo); + QueryWrapper queryWrapper = dataScopeService.addCondition(buildQueryWrapper(deptBo)); return this.listAs(queryWrapper, SysDeptVo.class); }