From e8152308fe901cf85ac8e4ff1f0aedc9dd3a0cc9 Mon Sep 17 00:00:00 2001 From: ricardo051199 Date: Thu, 28 Nov 2024 01:30:17 -0400 Subject: [PATCH] #7 Perfil de Personal Administrativo - Listado de empleados(Invertir orden desde el ultimo registro al primero) --- .../com/primefactorsolutions/service/EmployeeService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/primefactorsolutions/service/EmployeeService.java b/src/main/java/com/primefactorsolutions/service/EmployeeService.java index 1f374e8..dd07869 100644 --- a/src/main/java/com/primefactorsolutions/service/EmployeeService.java +++ b/src/main/java/com/primefactorsolutions/service/EmployeeService.java @@ -63,6 +63,7 @@ public class EmployeeService { public List findEmployees( final int start, final int pageSize, final String sortProperty, final boolean asc) { List employees = employeeRepository.findAll(); + Collections.reverse(employees); int end = Math.min(start + pageSize, employees.size()); employees.sort(new BeanComparator<>(sortProperty)); @@ -76,6 +77,7 @@ public class EmployeeService { public List findEmployees(final int start, final int pageSize) { List employees = employeeRepository.findAll(); + Collections.reverse(employees); int end = Math.min(start + pageSize, employees.size()); return employees.subList(start, end); @@ -125,7 +127,9 @@ public class EmployeeService { } public List findAllEmployees() { - return employeeRepository.findAll(); + List employees = employeeRepository.findAll(); + Collections.reverse(employees); + return employees; } public List findEmployeesByTeam(final String teamName) {