1.修改查询用户列表方法,修复分页查询失效问题

fengcang
x_z 3 years ago
parent b55f57bd40
commit 29a6539984

@ -64,19 +64,14 @@ public class AuthAdminController {
} }
authAdminQueryRequest.setIds(ids); authAdminQueryRequest.setIds(ids);
} }
authAdminQueryRequest.setNeUserName("admin");
List<AuthAdmin> authAdmins = authAdminService.listAdminPage(authAdminQueryRequest); List<AuthAdmin> authAdmins = authAdminService.listAdminPage(authAdminQueryRequest);
List<AuthAdmin> authAdminList = new ArrayList<>();
for (AuthAdmin authAdmin : authAdmins) {
if (!authAdmin.getUserName().equals("admin")) {
authAdminList.add(authAdmin);
}
}
// 查询所有的权限 // 查询所有的权限
List<Long> adminIds = authAdminList.stream().map(AuthAdmin::getId).collect(Collectors.toList()); List<Long> adminIds = authAdmins.stream().map(AuthAdmin::getId).collect(Collectors.toList());
List<AuthRoleAdmin> authRoleAdminList = authRoleAdminService.listByAdminIdIn(adminIds); List<AuthRoleAdmin> authRoleAdminList = authRoleAdminService.listByAdminIdIn(adminIds);
// 视图列表 // 视图列表
List<AuthAdminResponse> authAdminResponseList = authAdminList.stream().map(item -> { List<AuthAdminResponse> authAdminResponseList = authAdmins.stream().map(item -> {
AuthAdminResponse authAdminResponse = new AuthAdminResponse(); AuthAdminResponse authAdminResponse = new AuthAdminResponse();
BeanUtils.copyProperties(item, authAdminResponse); BeanUtils.copyProperties(item, authAdminResponse);
List<Long> roles = authRoleAdminList.stream() List<Long> roles = authRoleAdminList.stream()
@ -87,13 +82,11 @@ public class AuthAdminController {
return authAdminResponse; return authAdminResponse;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
PageInfo<AuthAdmin> authAdminPageInfo = new PageInfo<>(authAdminList); PageInfo<AuthAdmin> authAdminPageInfo = new PageInfo<>(authAdmins);
PageSimpleResponse<AuthAdminResponse> authAdminPageSimpleResponse = new PageSimpleResponse<>(); PageSimpleResponse<AuthAdminResponse> authAdminPageSimpleResponse = new PageSimpleResponse<>();
authAdminPageSimpleResponse.setTotal(authAdminPageInfo.getTotal()); authAdminPageSimpleResponse.setTotal(authAdminPageInfo.getTotal());
authAdminPageSimpleResponse.setList(authAdminResponseList); authAdminPageSimpleResponse.setList(authAdminResponseList);
return ResultVOUtils.success(authAdminPageSimpleResponse); return ResultVOUtils.success(authAdminPageSimpleResponse);
} }

@ -20,4 +20,7 @@ public class AuthAdminQueryRequest extends ListPageRequest {
private String lastUpdateTime; private String lastUpdateTime;
//用户名 !=
private String neUserName;
} }

@ -20,6 +20,9 @@
<if test="userName != null and '' != userName"> <if test="userName != null and '' != userName">
AND userName LIKE CONCAT(#{userName},'%') AND userName LIKE CONCAT(#{userName},'%')
</if> </if>
<if test="neUserName != null and '' != neUserName">
AND userName != #{neUserName}
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''"> <if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(lastModifyTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]> <![CDATA[ and DATE_FORMAT(lastModifyTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if> </if>

Loading…
Cancel
Save