1
0
mirror of https://github.com/FatttSnake/Pinnacle-OA.git synced 2026-04-06 07:21:24 +08:00

Fixed pagination in UserManagement

This commit is contained in:
2023-05-31 02:59:02 +08:00
parent f2f213d831
commit 167e762a13
3 changed files with 96 additions and 78 deletions

View File

@@ -20,6 +20,8 @@ import java.util.List;
public interface UserMapper extends BaseMapper<User> {
IPage<User> getAll(IPage<User> page);
List<User> getAllWithRoleAndGroup(@Param("userList") List<User> userList);
List<User> getAllAffairUser();
List<User> getAllDepartmentUser(@Param("departmentId")long departmentId);

View File

@@ -93,6 +93,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
public IPage<User> getAllUser(Long currentPage, Long pageSize) {
IPage<User> userPage = PageDTO.of(currentPage, pageSize);
userPage = userMapper.getAll(userPage);
userPage.setRecords(userMapper.getAllWithRoleAndGroup(userPage.getRecords()));
userPage.getRecords().forEach(user -> {
if (user.getId() == 1L) {
user.setRoles(List.of(new Role(0L, "超级管理员")));