From 860b45313860e92a3283fadea073903a3ff68ac1 Mon Sep 17 00:00:00 2001 From: ricardo051199 Date: Wed, 30 Oct 2024 14:46:51 -0400 Subject: [PATCH] #37 Perfil de Personal Administrativo - Listado General de Vacaciones (Correccion filtrado) --- .../primefactorsolutions/views/RequestsListView.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/primefactorsolutions/views/RequestsListView.java b/src/main/java/com/primefactorsolutions/views/RequestsListView.java index fe61116..43edf84 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestsListView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestsListView.java @@ -51,7 +51,7 @@ public class RequestsListView extends Main { this.vacationService = vacationService; this.employees = employeeService.findAllEmployees(); initializeView(); - refreshGeneralRequestGrid(null, null, null, null); + refreshGeneralRequestGrid(null, null, null); } private void initializeView() { @@ -97,7 +97,6 @@ public class RequestsListView extends Main { private void refreshGeneralRequestGrid(final Employee employee, final Team team, - final TimeOffRequestType category, final Status state) { requestGrid.setPagingDataProvider((page, pageSize) -> { int start = (int) (page * requestGrid.getPageSize()); @@ -110,7 +109,7 @@ public class RequestsListView extends Main { final int pageSize, final Employee employee, final Team team, - final Status employeeState) { + final Status state) { List filteredEmployees = employeeService.findAllEmployees(); if (employee != null && !"ALL".equals(employee.getFirstName())) { @@ -125,12 +124,12 @@ public class RequestsListView extends Main { .collect(Collectors.toList()); } - if (employeeState != null && employeeState != Status.ALL) { + if (state != null && state != Status.ALL) { filteredEmployees = filteredEmployees.stream() .filter(emp -> { Optional request = requestService .findByEmployeeAndState(emp.getId(), TimeOffRequestStatus.TAKEN); - return employeeState == Status.IDLE ? request.isPresent() : request.isEmpty(); + return state == Status.IDLE ? request.isPresent() : request.isEmpty(); }) .collect(Collectors.toList()); } @@ -197,7 +196,6 @@ public class RequestsListView extends Main { refreshGeneralRequestGrid( event.getValue(), teamFilter.getValue(), - categoryFilter.getValue(), stateFilter.getValue() ) ); @@ -215,7 +213,6 @@ public class RequestsListView extends Main { refreshGeneralRequestGrid( employeeFilter.getValue(), event.getValue(), - categoryFilter.getValue(), stateFilter.getValue() ) ); @@ -230,7 +227,6 @@ public class RequestsListView extends Main { refreshGeneralRequestGrid( employeeFilter.getValue(), teamFilter.getValue(), - categoryFilter.getValue(), event.getValue() ) );