diff --git a/src/main/java/com/primefactorsolutions/repositories/EmployeeRepository.java b/src/main/java/com/primefactorsolutions/repositories/EmployeeRepository.java index d57397f..8c58a64 100644 --- a/src/main/java/com/primefactorsolutions/repositories/EmployeeRepository.java +++ b/src/main/java/com/primefactorsolutions/repositories/EmployeeRepository.java @@ -11,7 +11,7 @@ public interface EmployeeRepository extends JpaRepository { Optional findByUsername(String username); Optional findByPersonalEmail(String personalEmail); - Optional findByTeamId(UUID teamId); + Optional findByTeamIdAndLeadManagerTrue(UUID teamId); List findByTeamName(String teamName); -} +} \ No newline at end of file diff --git a/src/main/java/com/primefactorsolutions/service/EmployeeService.java b/src/main/java/com/primefactorsolutions/service/EmployeeService.java index 52c15dd..dd3c179 100644 --- a/src/main/java/com/primefactorsolutions/service/EmployeeService.java +++ b/src/main/java/com/primefactorsolutions/service/EmployeeService.java @@ -50,7 +50,7 @@ public class EmployeeService { public String getTeamLeadName(final UUID teamId) { // Encuentra al empleado con el rol de lead_manager en el equipo especificado - Optional leadManager = employeeRepository.findByTeamId(teamId); + Optional leadManager = employeeRepository.findByTeamIdAndLeadManagerTrue(teamId); return leadManager.map(employee -> employee.getFirstName() + " " + employee.getLastName()) .orElse("No asignado"); @@ -126,6 +126,4 @@ public class EmployeeService { public List findEmployeesByTeam(final String teamName) { return employeeRepository.findByTeamName(teamName); } - - } \ No newline at end of file diff --git a/src/main/java/com/primefactorsolutions/views/ReporteView.java b/src/main/java/com/primefactorsolutions/views/ReporteView.java index e1a962b..2922de9 100644 --- a/src/main/java/com/primefactorsolutions/views/ReporteView.java +++ b/src/main/java/com/primefactorsolutions/views/ReporteView.java @@ -87,8 +87,6 @@ public class ReporteView extends VerticalLayout { add(headerLayout); updateHeaderLayout(null, null); - grid.addColumn(map -> map.get("ID")).setHeader("ID").getElement().getStyle().set("font-weight", "bold"); - grid.addColumn(map -> map.get("Employee ID")).setHeader("Employee ID"); grid.addColumn(map -> map.get("Empleado")).setHeader("Empleado"); grid.addColumn(map -> map.get("Horas Trabajadas")).setHeader("Horas Trabajadas"); grid.addColumn(map -> map.get("Horas Pendientes")).setHeader("Horas Pendientes"); @@ -208,7 +206,7 @@ public class ReporteView extends VerticalLayout { private void generateExcelDownloadLink(final List> data, final int weekNumber) { try { - List headers = List.of("ID", "Employee ID", "Empleado", + List headers = List.of("Empleado", "Horas Trabajadas", "Horas Pendientes", "Observaciones"); String selectedTeam = equipoComboBox.getValue().getName(); byte[] excelBytes = reportService.writeAsExcel(