From dea394a93de20987bfef6e9c8c51eaffaca36f21 Mon Sep 17 00:00:00 2001 From: RACSU Date: Mon, 29 Jul 2019 22:23:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=95=B0=E6=8D=AE=E6=9D=83?= =?UTF-8?q?=E9=99=90=E5=8F=AA=E6=9C=89=E6=9C=AC=E9=83=A8=E9=97=A8=E5=8F=8A?= =?UTF-8?q?=E4=BB=A5=E4=B8=8B=E6=97=B6=E5=80=99=EF=BC=8C=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90=E8=B6=8A?= =?UTF-8?q?=E7=95=8C=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/framework/aspectj/DataScopeAspect.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java index 977ed9e96..edf9a1849 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java @@ -118,10 +118,9 @@ public class DataScopeAspect } else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) { - String deptChild = user.getDept().getParentId() + "," + user.getDeptId(); sqlString.append(StringUtils.format( - " OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or ancestors LIKE '%{}%' )", - deptAlias, user.getDeptId(), deptChild)); + " OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )", + deptAlias, user.getDeptId(), user.getDeptId())); } else if (DATA_SCOPE_SELF.equals(dataScope)) {