Browse Source

完善通讯录用户获取

LuChongMei 1 năm trước cách đây
mục cha
commit
88640602d9

+ 1 - 3
jp-console/jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/controller/UserController.java

@@ -82,9 +82,7 @@ public class UserController {
     @GetMapping("list")
     public ResponseEntity list(UserDTO userDTO, Page <UserDTO> page) throws Exception {
         QueryWrapper <UserDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( userDTO, UserDTO.class );
-        if ( userDTO.getTenantDTO ( ) != null && StrUtil.isNotBlank ( userDTO.getTenantDTO ( ).getId ( ) ) ) {
-            queryWrapper.eq ( "a.tenant_id", userDTO.getTenantDTO ( ).getId ( ) );
-        }
+
         IPage <UserDTO> result = userService.findPage ( page, queryWrapper );
         return ResponseEntity.ok ( result );
     }

+ 4 - 0
jp-console/jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/service/UserService.java

@@ -87,6 +87,10 @@ public class UserService extends ServiceImpl <UserMapper, User> {
      * @return
      */
     public IPage <UserDTO> findPage(Page <UserDTO> page, QueryWrapper queryWrapper) {
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        if ( userDTO.getTenantDTO ( ) != null && StrUtil.isNotBlank ( userDTO.getTenantDTO ( ).getId ( ) ) ) {
+            queryWrapper.eq ( "a.tenant_id", userDTO.getTenantDTO ( ).getId ( ) );
+        }
         queryWrapper.eq ( "a.del_flag", CommonConstants.NOT_DELETED ); // 排除已经删除
         return baseMapper.findList ( page, queryWrapper );