he2802 3 vuotta sitten
vanhempi
commit
f1caca01e3

+ 7 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/aspectj/DataScopeAspect.java

@@ -109,8 +109,10 @@ public class DataScopeAspect
     {
         StringBuilder sqlString = new StringBuilder();
         System.out.println("角色"+businessAlias);
+
         for (SysRole role : user.getRoles())
         {
+            System.out.println(role);
             String dataScope = role.getDataScope();
             if (DATA_SCOPE_ALL.equals(dataScope))
             {
@@ -147,10 +149,15 @@ public class DataScopeAspect
             }
             else if (DATA_SCOPE_BUSINESS.equals(dataScope))
             {
+                System.out.println(DATA_SCOPE_BUSINESS+"54545"+dataScope);
                 sqlString.append(StrUtil.format(
                         " OR {}.id IN ( SELECT business_id FROM sys_role_business WHERE role_id = {} ) ", businessAlias,
                         role.getRoleId()));
             }
+            System.out.println(DATA_SCOPE_BUSINESS+"54545"+dataScope);
+            System.out.println("CCC角色"+StrUtil.format(
+                    " OR {}.id IN ( SELECT business_id FROM sys_role_business WHERE role_id = {} ) ", businessAlias,
+                    role.getRoleId()));
             System.out.println("CCC角色"+sqlString.toString());
         }