arreglar formato maven compile
All checks were successful
PR Builder / Build-PR (pull_request) Successful in 2m47s
All checks were successful
PR Builder / Build-PR (pull_request) Successful in 2m47s
This commit is contained in:
parent
63e10144ac
commit
b2ecc6e059
@ -176,7 +176,7 @@ public class ReportService {
|
|||||||
return cfg;
|
return cfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] generateExcelReport(Employee employee) {
|
public byte[] generateExcelReport(final Employee employee) {
|
||||||
try (Workbook workbook = new XSSFWorkbook()) {
|
try (Workbook workbook = new XSSFWorkbook()) {
|
||||||
Sheet sheet = workbook.createSheet("Empleado");
|
Sheet sheet = workbook.createSheet("Empleado");
|
||||||
Row titleRow = sheet.createRow(0);
|
Row titleRow = sheet.createRow(0);
|
||||||
|
@ -21,7 +21,7 @@ public class EmployeeReportView extends VerticalLayout implements HasUrlParamete
|
|||||||
private final EmployeeService employeeService;
|
private final EmployeeService employeeService;
|
||||||
private final ReportService reportService;
|
private final ReportService reportService;
|
||||||
|
|
||||||
public EmployeeReportView(EmployeeService employeeService, ReportService reportService) {
|
public EmployeeReportView(final EmployeeService employeeService, final ReportService reportService) {
|
||||||
this.employeeService = employeeService;
|
this.employeeService = employeeService;
|
||||||
this.reportService = reportService;
|
this.reportService = reportService;
|
||||||
Button backButton = new Button("Volver al Reporte de Empleados", event ->
|
Button backButton = new Button("Volver al Reporte de Empleados", event ->
|
||||||
@ -31,7 +31,7 @@ public class EmployeeReportView extends VerticalLayout implements HasUrlParamete
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setParameter(BeforeEvent event, @OptionalParameter String employeeId) {
|
public void setParameter(final BeforeEvent event, @OptionalParameter final String employeeId) {
|
||||||
if (employeeId != null) {
|
if (employeeId != null) {
|
||||||
UUID id = UUID.fromString(employeeId);
|
UUID id = UUID.fromString(employeeId);
|
||||||
Employee employee = employeeService.getEmployee(id);
|
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 {
|
try {
|
||||||
byte[] excelContent = reportService.generateExcelReport(employee); // Implementa esta lógica en tu `ReportService`.
|
byte[] excelContent = reportService.generateExcelReport(employee);
|
||||||
StreamResource resource = new StreamResource(
|
StreamResource resource = new StreamResource(
|
||||||
employee.getFirstName() + "_" + employee.getLastName() + "_report.xlsx",
|
employee.getFirstName() + "_" + employee.getLastName() + "_report.xlsx",
|
||||||
() -> new ByteArrayInputStream(excelContent)
|
() -> new ByteArrayInputStream(excelContent)
|
||||||
|
@ -127,7 +127,8 @@ public class EmployeeView extends BeanValidationForm<Employee> implements HasUrl
|
|||||||
private final Button reportButton = new Button("Generar Ficha de Contratación");
|
private final Button reportButton = new Button("Generar Ficha de Contratación");
|
||||||
private final Dialog dialog = new Dialog();
|
private final Dialog dialog = new Dialog();
|
||||||
private final PdfViewer pdfViewer = new PdfViewer();
|
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 H2 infoPer = new H2("Información Personal");
|
||||||
private final H3 infoGenr = new H3("Información General");
|
private final H3 infoGenr = new H3("Información General");
|
||||||
private final H5 imagenSub = new H5("Insertar una imagen .jpg:");
|
private final H5 imagenSub = new H5("Insertar una imagen .jpg:");
|
||||||
|
@ -150,7 +150,7 @@ public class HoursWorkedView extends BeanValidationForm<HoursWorked> implements
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateEmployeeField(Team selectedTeam) {
|
private void updateEmployeeField(final Team selectedTeam) {
|
||||||
if (selectedTeam != null) {
|
if (selectedTeam != null) {
|
||||||
List<Employee> employeesInTeam = employeeService.findAllEmployees().stream()
|
List<Employee> employeesInTeam = employeeService.findAllEmployees().stream()
|
||||||
.filter(employee -> employee.getTeam() != null && employee.getTeam().equals(selectedTeam))
|
.filter(employee -> employee.getTeam() != null && employee.getTeam().equals(selectedTeam))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user