From c93b309f431cd55cff006332f665e2446eb40a75 Mon Sep 17 00:00:00 2001 From: ricardo051199 Date: Tue, 26 Nov 2024 16:16:32 -0400 Subject: [PATCH 1/7] Restringir la creacion del roporte de vacaciones del empleado a la gestion actual --- package.json | 60 ++++++++++--------- .../views/RequestEmployeeView.java | 10 +++- src/main/resources/data.sql | 2 +- 3 files changed, 41 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index 3395e11..209a580 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "type": "module", "dependencies": { "@f0rce/ace-widget": "1.0.2", - "@polymer/polymer": "3.5.1", + "@polymer/polymer": "3.5.2", "@vaadin-component-factory/vcf-pdf-viewer": "2.0.1", "@vaadin/bundles": "24.5.1", "@vaadin/common-frontend": "0.0.19", @@ -19,29 +19,30 @@ "@vaadin/vaadin-usage-statistics": "2.1.3", "construct-style-sheets-polyfill": "3.1.0", "date-fns": "2.29.3", - "lit": "3.1.4", + "lit": "3.2.1", "print-js": "1.6.0", "proj4": "2.12.1", "react": "18.3.1", "react-dom": "18.3.1", - "react-router-dom": "6.23.1" + "react-router-dom": "6.26.2" }, "devDependencies": { - "@babel/preset-react": "7.24.7", - "@rollup/plugin-replace": "5.0.7", - "@rollup/pluginutils": "5.1.0", - "@types/react": "18.3.3", - "@types/react-dom": "18.3.0", - "@vitejs/plugin-react": "4.3.1", - "async": "3.2.5", - "glob": "10.4.1", + "@babel/preset-react": "7.25.7", + "@preact/signals-react-transform": "0.4.0", + "@rollup/plugin-replace": "6.0.1", + "@rollup/pluginutils": "5.1.2", + "@types/react": "18.3.11", + "@types/react-dom": "18.3.1", + "@vitejs/plugin-react": "4.3.3", + "async": "3.2.6", + "glob": "10.4.5", "rollup-plugin-brotli": "3.1.0", "rollup-plugin-visualizer": "5.12.0", "strip-css-comments": "5.0.0", "transform-ast": "2.4.4", - "typescript": "5.4.5", - "vite": "5.3.3", - "vite-plugin-checker": "0.6.4", + "typescript": "5.6.3", + "vite": "5.4.9", + "vite-plugin-checker": "0.8.0", "workbox-build": "7.1.1", "workbox-core": "7.1.0", "workbox-precaching": "7.1.0" @@ -49,7 +50,7 @@ "vaadin": { "dependencies": { "@f0rce/ace-widget": "1.0.2", - "@polymer/polymer": "3.5.1", + "@polymer/polymer": "3.5.2", "@vaadin-component-factory/vcf-pdf-viewer": "2.0.1", "@vaadin/bundles": "24.5.1", "@vaadin/common-frontend": "0.0.19", @@ -64,34 +65,35 @@ "@vaadin/vaadin-usage-statistics": "2.1.3", "construct-style-sheets-polyfill": "3.1.0", "date-fns": "2.29.3", - "lit": "3.1.4", + "lit": "3.2.1", "print-js": "1.6.0", "proj4": "2.12.1", "react": "18.3.1", "react-dom": "18.3.1", - "react-router-dom": "6.23.1" + "react-router-dom": "6.26.2" }, "devDependencies": { - "@babel/preset-react": "7.24.7", - "@rollup/plugin-replace": "5.0.7", - "@rollup/pluginutils": "5.1.0", - "@types/react": "18.3.3", - "@types/react-dom": "18.3.0", - "@vitejs/plugin-react": "4.3.1", - "async": "3.2.5", - "glob": "10.4.1", + "@babel/preset-react": "7.25.7", + "@preact/signals-react-transform": "0.4.0", + "@rollup/plugin-replace": "6.0.1", + "@rollup/pluginutils": "5.1.2", + "@types/react": "18.3.11", + "@types/react-dom": "18.3.1", + "@vitejs/plugin-react": "4.3.3", + "async": "3.2.6", + "glob": "10.4.5", "rollup-plugin-brotli": "3.1.0", "rollup-plugin-visualizer": "5.12.0", "strip-css-comments": "5.0.0", "transform-ast": "2.4.4", - "typescript": "5.4.5", - "vite": "5.3.3", - "vite-plugin-checker": "0.6.4", + "typescript": "5.6.3", + "vite": "5.4.9", + "vite-plugin-checker": "0.8.0", "workbox-build": "7.1.1", "workbox-core": "7.1.0", "workbox-precaching": "7.1.0" }, - "hash": "1a0f17d48b329307b5862bc57499307d1b89f7d89260121c2b7189f76957c436" + "hash": "2dc40a4f634ae025081ca2239cba00b14a35fe94ab78ac0a4dd3023d882081d5" }, "overrides": { "@vaadin/bundles": "$@vaadin/bundles", diff --git a/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java b/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java index 15c207d..a1677f2 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java @@ -40,6 +40,7 @@ import java.io.IOException; import java.io.UncheckedIOException; import java.time.LocalDate; import java.time.Period; +import java.time.Year; import java.util.*; import java.util.stream.Collectors; @@ -511,9 +512,16 @@ public class RequestEmployeeView extends BaseView implements HasUrlParameter filteredRequests = requests.stream() + .filter(request -> + (request.getStartDate() == null || Year.from(request.getStartDate()).equals(Year.now())) || + request.getCategory() == TimeOffRequestType.VACACION_GESTION_ACTUAL || + request.getCategory() == TimeOffRequestType.VACACION_GESTION_ANTERIOR) + .toList(); + contentStream.setFont(PDType1Font.TIMES_ROMAN, 10); float currentY = tableTopY - cellHeight; - for (TimeOffRequest request : requests) { + for (TimeOffRequest request : filteredRequests) { String startDate = getDateString(request.getStartDate()); String endDate = getDateString(request.getEndDate()); diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql index 5cb7a98..a7e185b 100644 --- a/src/main/resources/data.sql +++ b/src/main/resources/data.sql @@ -78,7 +78,7 @@ values ('9c6f12ba-e333-4e7a-b8a6-caa0982bd8c3', 1, '5c6f11fe-c341-4be7-a9a6-bba0 insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance) values ('9d6f12ba-e444-4e7a-b8a6-caa0982bd8d4', 1, '5c6f11fe-c341-4be7-a9a6-bba0081ad7c6', 'VIERNES_SANTO', 'APROBADO', 1, '2024-03-29', '2024-03-29', '2024-03-29', 1, 0); insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance) -values ('9e6f12ba-e555-4e7a-b8a6-caa0982bd8e5', 1, '5c6f11fe-c341-4be7-a9a6-bba0081ad7c6', 'VACACION_GESTION_ANTERIOR', 'APROBADO', 20, '2024-11-01', '2022-11-01', '2022-11-30', 20, 0); +values ('9e6f12ba-e555-4e7a-b8a6-caa0982bd8e5', 1, '5c6f11fe-c341-4be7-a9a6-bba0081ad7c6', 'VACACION_GESTION_ANTERIOR', 'APROBADO', 20, '2024-11-01', '2023-11-01', '2023-11-30', 20, 0); insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance) values ('8c653f2a-f9a3-4d67-b3b6-12ad98fe0983', 1, 'f6ab3c6d-7078-45f6-9b22-4e37637bfec6', 'DIA_DEL_TRABAJADOR', 'APROBADO', 1, '2024-05-01', '2024-05-01', '2024-05-01', 1, 0); From f2b24a26a46325ca38f294ba0c04d0e9fa6dd67d Mon Sep 17 00:00:00 2001 From: ricardo051199 Date: Tue, 26 Nov 2024 23:52:49 -0400 Subject: [PATCH 2/7] Agregar resumen al reporte de vacaciones del empleado --- .../views/RequestEmployeeView.java | 50 +++++++++++++++---- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java b/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java index a1677f2..4504eba 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java @@ -62,6 +62,10 @@ public class RequestEmployeeView extends BaseView implements HasUrlParameter categoryFilter; private ComboBox stateFilter; private UUID employeeId; + private double remainingHolidayDays; + private double remainingPersonalDays; + private double remainingVacationDays; + public RequestEmployeeView(final TimeOffRequestService requestService, final EmployeeService employeeService, @@ -178,20 +182,20 @@ public class RequestEmployeeView extends BaseView implements HasUrlParameter filteredRequests = requests.stream() + .filter(request -> + (request.getStartDate() == null || Year.from(request.getStartDate()).equals(Year.now())) || + request.getCategory() == TimeOffRequestType.VACACION_GESTION_ACTUAL || + request.getCategory() == TimeOffRequestType.VACACION_GESTION_ANTERIOR) + .toList(); PDPageContentStream contentStream = null; try { @@ -512,13 +523,6 @@ public class RequestEmployeeView extends BaseView implements HasUrlParameter filteredRequests = requests.stream() - .filter(request -> - (request.getStartDate() == null || Year.from(request.getStartDate()).equals(Year.now())) || - request.getCategory() == TimeOffRequestType.VACACION_GESTION_ACTUAL || - request.getCategory() == TimeOffRequestType.VACACION_GESTION_ANTERIOR) - .toList(); - contentStream.setFont(PDType1Font.TIMES_ROMAN, 10); float currentY = tableTopY - cellHeight; for (TimeOffRequest request : filteredRequests) { @@ -553,6 +557,30 @@ public class RequestEmployeeView extends BaseView implements HasUrlParameter Date: Wed, 27 Nov 2024 00:08:26 -0400 Subject: [PATCH 3/7] Agregar mensaje de advertencia de tipo de documento --- .../java/com/primefactorsolutions/views/DocumentView.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/primefactorsolutions/views/DocumentView.java b/src/main/java/com/primefactorsolutions/views/DocumentView.java index b1bbad9..5033966 100644 --- a/src/main/java/com/primefactorsolutions/views/DocumentView.java +++ b/src/main/java/com/primefactorsolutions/views/DocumentView.java @@ -8,6 +8,7 @@ import com.primefactorsolutions.service.EmployeeService; import com.vaadin.flow.component.Component; import com.vaadin.flow.component.button.Button; import com.vaadin.flow.component.combobox.ComboBox; +import com.vaadin.flow.component.html.Span; import com.vaadin.flow.component.notification.Notification; import com.vaadin.flow.component.orderedlayout.HorizontalLayout; import com.vaadin.flow.component.textfield.TextField; @@ -42,6 +43,7 @@ public class DocumentView extends BeanValidationForm implements HasUrl private final TextField fileName = new TextField("Nombre del documento"); private final ComboBox documentType = new ComboBox<>("Tipo de documento"); private final ComboBox employeeComboBox = new ComboBox<>("Empleado"); + private final Span pdfOnlyMessage = new Span("Únicamente se permite la carga de archivos en formato PDF."); private final MemoryBuffer buffer = new MemoryBuffer(); private final Upload uploadButton = new Upload(buffer); private final DocumentService documentService; @@ -268,6 +270,6 @@ public class DocumentView extends BeanValidationForm implements HasUrl HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.add(uploadButton, createViewDocumentButton()); buttonLayout.setSpacing(true); - return List.of(fileName, documentType, employeeComboBox, buttonLayout, createCloseButton()); + return List.of(fileName, documentType, employeeComboBox, pdfOnlyMessage, buttonLayout, createCloseButton()); } } From d53792f3802b3e1fee0368ed949b9f31813ccdc6 Mon Sep 17 00:00:00 2001 From: ricardo051199 Date: Wed, 27 Nov 2024 21:03:39 -0400 Subject: [PATCH 4/7] #37 Perfil de Personal Administrativo - Listado General de Vacaciones(Agregar filtro de categoria) --- .../views/DocumentView.java | 1 - .../views/RequestsListView.java | 43 ++++++++++++++++++- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/primefactorsolutions/views/DocumentView.java b/src/main/java/com/primefactorsolutions/views/DocumentView.java index 5033966..3e738fd 100644 --- a/src/main/java/com/primefactorsolutions/views/DocumentView.java +++ b/src/main/java/com/primefactorsolutions/views/DocumentView.java @@ -53,7 +53,6 @@ public class DocumentView extends BeanValidationForm implements HasUrl private Button saveButton; private Button viewDocumentButton; - public DocumentView(final DocumentService documentService, final EmployeeService employeeService, final AuthenticationContext authContext) { diff --git a/src/main/java/com/primefactorsolutions/views/RequestsListView.java b/src/main/java/com/primefactorsolutions/views/RequestsListView.java index 1c9c1d3..24bd3e0 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestsListView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestsListView.java @@ -55,6 +55,7 @@ public class RequestsListView extends BaseView { private ComboBox employeeFilter; private ComboBox teamFilter; + private ComboBox categoryFilter; private ComboBox stateFilter; public RequestsListView(final TimeOffRequestService requestService, @@ -66,7 +67,7 @@ public class RequestsListView extends BaseView { this.teamService = teamService; this.vacationService = vacationService; initializeView(); - refreshGeneralRequestGrid(null, null, null); + refreshGeneralRequestGrid(null, null, null, null); } private void initializeView() { @@ -82,6 +83,7 @@ public class RequestsListView extends BaseView { final HorizontalLayout hl = new HorizontalLayout(); hl.add(createEmployeeFilter()); hl.add(createTeamFilter()); + hl.add(createCategoryFilter()); hl.add(createStateFilter()); getCurrentPageLayout().add(hl); } @@ -90,6 +92,7 @@ public class RequestsListView extends BaseView { requestGrid.addColumn(this::getEmployeeFullName).setHeader("Empleado"); requestGrid.addColumn(this::getTeamName).setHeader("Equipo"); requestGrid.addColumn(this::getEmployeeStatus).setHeader("Estado del empleado"); + requestGrid.addColumn(this::getCategory).setHeader("Categoria"); requestGrid.addColumn(this::getGeneralTotal).setHeader("Total general"); requestGrid.addComponentColumn((ValueProvider) employee -> { final MenuBar menuBar = new MenuBar(); @@ -107,10 +110,11 @@ public class RequestsListView extends BaseView { 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()); - return fetchFilteredEmployees(start, pageSize, employee, team, state); + return fetchFilteredEmployees(start, pageSize, employee, team, category, state); }); requestGrid.getDataProvider().refreshAll(); } @@ -119,6 +123,7 @@ public class RequestsListView extends BaseView { final int pageSize, final Employee employee, final Team team, + final TimeOffRequestType category, final Status state) { List filteredEmployees = employeeService.findAllEmployees(); @@ -134,6 +139,16 @@ public class RequestsListView extends BaseView { .collect(Collectors.toList()); } + if (category != null && category != TimeOffRequestType.values()[0]) { + filteredEmployees = filteredEmployees.stream() + .filter(emp -> { + Optional request = requestService + .findByEmployeeAndState(emp.getId(), TimeOffRequestStatus.EN_USO); + return request.isPresent() && request.get().getCategory() == category; + }) + .collect(Collectors.toList()); + } + if (state != null && state != Status.TODOS) { filteredEmployees = filteredEmployees.stream() .filter(emp -> { @@ -168,6 +183,12 @@ public class RequestsListView extends BaseView { return activeRequest.isPresent() ? "EN_DESCANSO" : "EN_FUNCIONES"; } + private String getCategory(final Employee employee) { + Optional activeRequest = requestService + .findByEmployeeAndState(employee.getId(), TimeOffRequestStatus.EN_USO); + return activeRequest.map(request -> request.getCategory().toString()).orElse(""); + } + private String getGeneralTotal(final Employee employee) { List employeeRequests = requestService.findRequestsByEmployeeId(employee.getId()); List vacations = vacationService.findVacations(); @@ -363,6 +384,7 @@ public class RequestsListView extends BaseView { refreshGeneralRequestGrid( event.getValue(), teamFilter.getValue(), + categoryFilter.getValue(), stateFilter.getValue() ) ); @@ -380,12 +402,28 @@ public class RequestsListView extends BaseView { refreshGeneralRequestGrid( employeeFilter.getValue(), event.getValue(), + categoryFilter.getValue(), stateFilter.getValue() ) ); return teamFilter; } + private ComboBox createCategoryFilter() { + categoryFilter = new ComboBox<>("Category"); + categoryFilter.setItems(TimeOffRequestType.values()); + categoryFilter.setValue(TimeOffRequestType.values()[0]); + categoryFilter.addValueChangeListener(event -> + refreshGeneralRequestGrid( + employeeFilter.getValue(), + teamFilter.getValue(), + event.getValue(), + stateFilter.getValue() + ) + ); + return categoryFilter; + } + private ComboBox createStateFilter() { stateFilter = new ComboBox<>("Estado del empleado"); stateFilter.setItems(Status.values()); @@ -394,6 +432,7 @@ public class RequestsListView extends BaseView { refreshGeneralRequestGrid( employeeFilter.getValue(), teamFilter.getValue(), + categoryFilter.getValue(), event.getValue() ) ); From e8152308fe901cf85ac8e4ff1f0aedc9dd3a0cc9 Mon Sep 17 00:00:00 2001 From: ricardo051199 Date: Thu, 28 Nov 2024 01:30:17 -0400 Subject: [PATCH 5/7] #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) { From 6ac9d4c305f37bc408122cf7f5ffde9c973fc8bb Mon Sep 17 00:00:00 2001 From: ricardo051199 Date: Thu, 28 Nov 2024 01:58:06 -0400 Subject: [PATCH 6/7] Implementar funcionalidad para descargar reporte de las solicitudes de vacaciones rechazadas --- .../views/PendingRequestsListView.java | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/src/main/java/com/primefactorsolutions/views/PendingRequestsListView.java b/src/main/java/com/primefactorsolutions/views/PendingRequestsListView.java index cc74f94..abb096a 100644 --- a/src/main/java/com/primefactorsolutions/views/PendingRequestsListView.java +++ b/src/main/java/com/primefactorsolutions/views/PendingRequestsListView.java @@ -8,6 +8,8 @@ import com.primefactorsolutions.views.util.MenuBarUtils; import com.vaadin.flow.component.ClickEvent; import com.vaadin.flow.component.Component; import com.vaadin.flow.component.ComponentEventListener; +import com.vaadin.flow.component.UI; +import com.vaadin.flow.component.button.Button; import com.vaadin.flow.component.combobox.ComboBox; import com.vaadin.flow.component.contextmenu.MenuItem; import com.vaadin.flow.component.icon.VaadinIcon; @@ -17,11 +19,23 @@ import com.vaadin.flow.component.orderedlayout.HorizontalLayout; import com.vaadin.flow.function.ValueProvider; import com.vaadin.flow.router.PageTitle; import com.vaadin.flow.router.Route; +import com.vaadin.flow.server.StreamRegistration; +import com.vaadin.flow.server.StreamResource; import com.vaadin.flow.spring.annotation.SpringComponent; import jakarta.annotation.security.PermitAll; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.springframework.context.annotation.Scope; import org.vaadin.firitin.components.grid.PagingGrid; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.time.LocalDate; import java.util.*; import java.util.stream.Collectors; @@ -54,6 +68,8 @@ public class PendingRequestsListView extends BaseView { } private void initializeView() { + Button downloadButton = new Button("Descargar reporte de rechazos", event -> downloadReport()); + getCurrentPageLayout().add(downloadButton); setupFilters(); setupPendingRequestsGrid(); } @@ -221,4 +237,50 @@ public class PendingRequestsListView extends BaseView { allTeamsOption.setName("TODOS"); return allTeamsOption; } + + private void downloadReport() { + StreamResource resource = generateGeneralVacationReport(); + getUI().ifPresent(ui -> openDocumentStream(resource, ui)); + } + + private StreamResource generateGeneralVacationReport() { + List requests = requestService.findAllTimeOffRequests().stream() + .filter(request -> request.getState() == TimeOffRequestStatus.RECHAZADO) + .collect(Collectors.toList()); + ByteArrayInputStream excelStream = generateExcelReport(requests); + return new StreamResource("reporte_de_solicitudes_rechazadas_" + LocalDate.now() + ".xlsx", + () -> excelStream); + } + + private void openDocumentStream(final StreamResource resource, final UI ui) { + StreamRegistration registration = ui.getSession().getResourceRegistry().registerResource(resource); + ui.getPage().open(registration.getResourceUri().toString()); + } + + private ByteArrayInputStream generateExcelReport(final List requests) { + try (Workbook workbook = new XSSFWorkbook()) { + Sheet sheet = workbook.createSheet("REPORTE_DE_SOLICITUDES_DE_VACACIONES_RECHAZADAS"); + Row headerRow = sheet.createRow(0); + + String[] headers = {"Empleado", "Categoria", "Observaciones"}; + for (int i = 0; i < headers.length; i++) { + Cell cell = headerRow.createCell(i); + cell.setCellValue(headers[i]); + } + + int rowIndex = 1; + for (TimeOffRequest request : requests) { + Row row = sheet.createRow(rowIndex++); + row.createCell(0).setCellValue(getEmployeeFullName(request)); + row.createCell(1).setCellValue(getCategory(request)); + } + + try (ByteArrayOutputStream out = new ByteArrayOutputStream()) { + workbook.write(out); + return new ByteArrayInputStream(out.toByteArray()); + } + } catch (IOException e) { + throw new UncheckedIOException("Error al generar el archivo Excel", e); + } + } } \ No newline at end of file From 9e92dc534274f7ff43014c1d124a91ad493572b3 Mon Sep 17 00:00:00 2001 From: ricardo051199 Date: Thu, 28 Nov 2024 02:10:22 -0400 Subject: [PATCH 7/7] Resolver errores de checkstyle --- .../views/RequestEmployeeView.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java b/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java index 4504eba..b0a5d07 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java @@ -477,9 +477,9 @@ public class RequestEmployeeView extends BaseView implements HasUrlParameter filteredRequests = requests.stream() .filter(request -> - (request.getStartDate() == null || Year.from(request.getStartDate()).equals(Year.now())) || - request.getCategory() == TimeOffRequestType.VACACION_GESTION_ACTUAL || - request.getCategory() == TimeOffRequestType.VACACION_GESTION_ANTERIOR) + (request.getStartDate() == null || Year.from(request.getStartDate()).equals(Year.now())) + || request.getCategory() == TimeOffRequestType.VACACION_GESTION_ACTUAL + || request.getCategory() == TimeOffRequestType.VACACION_GESTION_ANTERIOR) .toList(); PDPageContentStream contentStream = null; @@ -577,8 +577,8 @@ public class RequestEmployeeView extends BaseView implements HasUrlParameter