From 6316230a2a907a3d4b4313e2be03242cdaaf4023 Mon Sep 17 00:00:00 2001 From: Melina Gutierrez Date: Fri, 4 Oct 2024 13:26:10 -0400 Subject: [PATCH] #4 Perfil de Empleado - Detalles para formulario de Empleado --- .../primefactorsolutions/model/Employee.java | 6 +++--- .../views/EmployeeView.java | 3 +++ src/main/resources/reports/ficha.html | 19 +++++++++++++++---- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/primefactorsolutions/model/Employee.java b/src/main/java/com/primefactorsolutions/model/Employee.java index c25cb1c..1399c8b 100644 --- a/src/main/java/com/primefactorsolutions/model/Employee.java +++ b/src/main/java/com/primefactorsolutions/model/Employee.java @@ -25,6 +25,7 @@ private String age; private String residenceAddress; + private String localAddress; private String phoneNumber; private String personalEmail; private String position; @@ -34,7 +35,6 @@ private String emergencyCPhone; private String emergencyCEmail; private String numberOfChildren; - private String departmentAndProvinceResidence; private String ci; private String issuedIn; @@ -66,8 +66,8 @@ private LocalDate dateOfExit; private String contractType; - private Integer seniority; - private Double salary; + private String seniority; + private String salary; private String bankName; private String accountNumber; diff --git a/src/main/java/com/primefactorsolutions/views/EmployeeView.java b/src/main/java/com/primefactorsolutions/views/EmployeeView.java index 55b43b5..bdf5a82 100644 --- a/src/main/java/com/primefactorsolutions/views/EmployeeView.java +++ b/src/main/java/com/primefactorsolutions/views/EmployeeView.java @@ -173,6 +173,7 @@ public class EmployeeView extends BeanValidationForm implements HasUrl int birthYear = birthday.getValue().getYear(); int ages = currentYear - birthYear; age.setValue(String.valueOf(ages)); + System.out.println(age); } } @@ -285,6 +286,8 @@ public class EmployeeView extends BeanValidationForm implements HasUrl if (validateForm()) { Employee employee = getEntity(); employee.setStatus(status.getValue()); + employee.setAge(age.getValue()); + employeeService.createOrUpdate(employee); Notification.show(NOTIFICATION_SAVE_SUCCESS); getUI().ifPresent(ui -> ui.navigate(EmployeesListView.class)); diff --git a/src/main/resources/reports/ficha.html b/src/main/resources/reports/ficha.html index de59090..1211bf0 100644 --- a/src/main/resources/reports/ficha.html +++ b/src/main/resources/reports/ficha.html @@ -28,6 +28,7 @@
+

FICHA DE CONTRATACIÓN

Información General

@@ -55,10 +56,14 @@ + + + + @@ -66,13 +71,11 @@ -
${maritalStatus!""} Nro. CI: ${ci!""}Expedido en:${issuedIn!""}
Nro. Hijos: ${numberOfChildren!""}
Nro. Celular: ${phoneNumber!""}
Email: ${personalEmail!""}
- -

Información de Contratación

- + + @@ -80,9 +83,15 @@ +
Código de Empleado: ${cod!""}
Cargo: ${position!""}
Equipo: ${team!""}
+ +

Información de Contratación

+ + + @@ -97,6 +106,8 @@ + +
Fecha de Ingreso: ${dateOfEntry!""}
Tipo de Contrato: ${contractType!""}
Banco: ${bankName!""}
Nro. Cuenta: ${accountNumber!""}