he2802 3 tahun lalu
induk
melakukan
2270b3c41c

+ 2 - 1
zhongzheng-framework/src/main/java/com/zhongzheng/framework/aspectj/DataScopeAspect.java

@@ -108,7 +108,7 @@ public class DataScopeAspect
     public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String deptAlias, String userAlias, String businessAlias)
     {
         StringBuilder sqlString = new StringBuilder();
-
+        System.out.println("角色"+businessAlias);
         for (SysRole role : user.getRoles())
         {
             String dataScope = role.getDataScope();
@@ -151,6 +151,7 @@ public class DataScopeAspect
                         " OR {}.id IN ( SELECT business_id FROM sys_role_business WHERE role_id = {} ) ", businessAlias,
                         role.getRoleId()));
             }
+            System.out.println("CCC角色"+sqlString.toString());
         }
 
         if (StrUtil.isNotBlank(sqlString.toString()))

+ 4 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/bo/UserProfileQueryBo.java

@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.io.Serializable;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -22,7 +23,9 @@ import com.zhongzheng.common.core.domain.BaseEntity;
 @Data
 @EqualsAndHashCode(callSuper = true)
 @ApiModel("填写资料审核分页查询对象")
-public class UserProfileQueryBo extends BaseEntity {
+public class UserProfileQueryBo extends BaseEntity implements Serializable {
+
+	private static final long serialVersionUID = 1L;
 
 	/** 分页大小 */
 	@ApiModelProperty("分页大小")

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/mapper/UserProfileMapper.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.modules.base.mapper;
 
+import com.zhongzheng.common.annotation.DataScope;
 import com.zhongzheng.modules.base.bo.UserProfileQueryBo;
 import com.zhongzheng.modules.base.domain.UserProfile;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/UserProfileServiceImpl.java

@@ -123,8 +123,8 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
         return userProfileVo;
     }
 
-    @DataScope(businessAlias = "cb")
     @Override
+    @DataScope(businessAlias = "cb")
     public List<UserProfileVo> queryList(UserProfileQueryBo bo) {
         return baseMapper.selectUserProfile(bo);
     }

+ 1 - 1
zhongzheng-system/src/main/resources/mapper/modules/base/UserProfileMapper.xml

@@ -98,9 +98,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="realname != null and realname !='' ">
             AND (SELECT count(1) FROM `user` u where u.user_id = up.user_id and u.realname like concat('%', #{realname}, '%') )> 0
         </if>
+        order by up.create_time desc
         <!-- 数据范围过滤 -->
         ${params.dataScope}
-        order by up.create_time desc
     </select>
 
     <select id="getInfo" parameterType="com.zhongzheng.modules.base.bo.UserProfileQueryBo" resultMap="UserProfileVo">