修复业务线分页问题

This commit is contained in:
钱涛 2025-03-18 11:10:27 +08:00
parent d672dd8d61
commit 4913398650
1 changed files with 5 additions and 4 deletions

View File

@ -65,7 +65,7 @@ public class AuthRoleServiceImpl extends Service implements AuthRoleService {
List<AuthRolePO> authRolePOS = getAuthRoleMapper().list(param);
int total = authRolePOS.size();
List<AuthRoleDTO> collect = SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), authRolePOS)
List<AuthRoleDTO> list = SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), authRolePOS)
.stream().map(po -> {
Long roleId = po.getId();
AuthMemberQueryParam roleQueryParam = AuthMemberQueryParam.builder().roleId(roleId).build();
@ -84,7 +84,8 @@ public class AuthRoleServiceImpl extends Service implements AuthRoleService {
.resources(authResources.size())
.build();
}).collect(Collectors.toList());
PageInfo<AuthRoleDTO> pageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), collect, AuthRoleDTO.class);
PageInfo<AuthRoleDTO> pageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), AuthRoleDTO.class);
pageInfo.setList(list);
pageInfo.setTotal(total);
return pageInfo;
}
@ -92,7 +93,7 @@ public class AuthRoleServiceImpl extends Service implements AuthRoleService {
@Override
public AuthRoleDTO getRole(Long id) {
AuthRolePO po = getAuthRoleMapper().getById(id);
if (po == null){
if (po == null) {
throw new SalaryRunTimeException("业务线不存在");
}
Long roleId = po.getId();
@ -244,6 +245,6 @@ public class AuthRoleServiceImpl extends Service implements AuthRoleService {
@Override
public List<AuthRolePO> listAll() {
return getAuthRoleMapper().listAll();
return getAuthRoleMapper().listAll();
}
}