From b2ecc6e059208fe4f38fd21aaa5e2c28d5871cea Mon Sep 17 00:00:00 2001 From: Melina Gutierrez Date: Thu, 28 Nov 2024 08:21:55 -0400 Subject: [PATCH] arreglar formato maven compile --- .../com/primefactorsolutions/service/ReportService.java | 2 +- .../primefactorsolutions/views/EmployeeReportView.java | 8 ++++---- .../java/com/primefactorsolutions/views/EmployeeView.java | 3 ++- .../com/primefactorsolutions/views/HoursWorkedView.java | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/primefactorsolutions/service/ReportService.java b/src/main/java/com/primefactorsolutions/service/ReportService.java index e3d4ef6..3c27d78 100644 --- a/src/main/java/com/primefactorsolutions/service/ReportService.java +++ b/src/main/java/com/primefactorsolutions/service/ReportService.java @@ -176,7 +176,7 @@ public class ReportService { return cfg; } - public byte[] generateExcelReport(Employee employee) { + public byte[] generateExcelReport(final Employee employee) { try (Workbook workbook = new XSSFWorkbook()) { Sheet sheet = workbook.createSheet("Empleado"); Row titleRow = sheet.createRow(0); diff --git a/src/main/java/com/primefactorsolutions/views/EmployeeReportView.java b/src/main/java/com/primefactorsolutions/views/EmployeeReportView.java index 4500aff..4dbfaf9 100644 --- a/src/main/java/com/primefactorsolutions/views/EmployeeReportView.java +++ b/src/main/java/com/primefactorsolutions/views/EmployeeReportView.java @@ -21,7 +21,7 @@ public class EmployeeReportView extends VerticalLayout implements HasUrlParamete private final EmployeeService employeeService; private final ReportService reportService; - public EmployeeReportView(EmployeeService employeeService, ReportService reportService) { + public EmployeeReportView(final EmployeeService employeeService, final ReportService reportService) { this.employeeService = employeeService; this.reportService = reportService; Button backButton = new Button("Volver al Reporte de Empleados", event -> @@ -31,7 +31,7 @@ public class EmployeeReportView extends VerticalLayout implements HasUrlParamete } @Override - public void setParameter(BeforeEvent event, @OptionalParameter String employeeId) { + public void setParameter(final BeforeEvent event, @OptionalParameter final String employeeId) { if (employeeId != null) { UUID id = UUID.fromString(employeeId); Employee employee = employeeService.getEmployee(id); @@ -43,9 +43,9 @@ public class EmployeeReportView extends VerticalLayout implements HasUrlParamete } } - private void generateExcelReport(Employee employee) { + private void generateExcelReport(final Employee employee) { try { - byte[] excelContent = reportService.generateExcelReport(employee); // Implementa esta lógica en tu `ReportService`. + byte[] excelContent = reportService.generateExcelReport(employee); StreamResource resource = new StreamResource( employee.getFirstName() + "_" + employee.getLastName() + "_report.xlsx", () -> new ByteArrayInputStream(excelContent) diff --git a/src/main/java/com/primefactorsolutions/views/EmployeeView.java b/src/main/java/com/primefactorsolutions/views/EmployeeView.java index 8e18f43..21ca7a1 100644 --- a/src/main/java/com/primefactorsolutions/views/EmployeeView.java +++ b/src/main/java/com/primefactorsolutions/views/EmployeeView.java @@ -127,7 +127,8 @@ public class EmployeeView extends BeanValidationForm implements HasUrl private final Button reportButton = new Button("Generar Ficha de Contratación"); private final Dialog dialog = new Dialog(); private final PdfViewer pdfViewer = new PdfViewer(); - private final Button excelReportButton = new Button("Información General del Empleado Excel", VaadinIcon.FILE_TABLE.create()); + private final Button excelReportButton = new Button("Información General del Empleado Excel", + VaadinIcon.FILE_TABLE.create()); private final H2 infoPer = new H2("Información Personal"); private final H3 infoGenr = new H3("Información General"); private final H5 imagenSub = new H5("Insertar una imagen .jpg:"); diff --git a/src/main/java/com/primefactorsolutions/views/HoursWorkedView.java b/src/main/java/com/primefactorsolutions/views/HoursWorkedView.java index e05b001..4df236e 100644 --- a/src/main/java/com/primefactorsolutions/views/HoursWorkedView.java +++ b/src/main/java/com/primefactorsolutions/views/HoursWorkedView.java @@ -150,7 +150,7 @@ public class HoursWorkedView extends BeanValidationForm implements }); } - private void updateEmployeeField(Team selectedTeam) { + private void updateEmployeeField(final Team selectedTeam) { if (selectedTeam != null) { List employeesInTeam = employeeService.findAllEmployees().stream() .filter(employee -> employee.getTeam() != null && employee.getTeam().equals(selectedTeam))