From 21d5327f94e5c213ca1e2d7563064f6aefc93a83 Mon Sep 17 00:00:00 2001 From: Denis Natusch Date: Fri, 8 Dec 2023 19:42:39 +0100 Subject: [PATCH] What the fuck --- src/main/java/catering/staff/StaffController.java | 1 + src/main/java/catering/staff/StaffManagement.java | 3 +++ src/main/resources/templates/staff.html | 3 ++- .../catering/staff/StaffControllerIntegrationTests.java | 6 +++--- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/catering/staff/StaffController.java b/src/main/java/catering/staff/StaffController.java index c965dff..d291425 100644 --- a/src/main/java/catering/staff/StaffController.java +++ b/src/main/java/catering/staff/StaffController.java @@ -38,6 +38,7 @@ public class StaffController { model.addAttribute("form", form); model.addAttribute("month", month); model.addAttribute("management", staffManagement); + model.addAttribute("fucking", staffManagement.getWorkingHoursByEmployee(staffManagement.findAll().stream().filter(e -> e.getName().equals("Tyler Baum")).findFirst().get(), YearMonth.of(2023,12))); return "staff"; } diff --git a/src/main/java/catering/staff/StaffManagement.java b/src/main/java/catering/staff/StaffManagement.java index 2f48528..689fd94 100644 --- a/src/main/java/catering/staff/StaffManagement.java +++ b/src/main/java/catering/staff/StaffManagement.java @@ -106,6 +106,9 @@ public class StaffManagement { } public double getWorkingHoursByEmployee(Employee e, YearMonth month) { + if (e.getName() == "Tyler Baum") { + System.out.println(orderManagement.findAll(Pageable.unpaged()).stream().filter(order -> order.getStaff().contains(e)).count()); + } return orderManagement.findAll(Pageable.unpaged()).stream() .filter(order -> order.getStaff().contains(e)) .map(order -> order.getDurationInSecondsDuringMonth(month)) diff --git a/src/main/resources/templates/staff.html b/src/main/resources/templates/staff.html index 075b502..1a38fbb 100644 --- a/src/main/resources/templates/staff.html +++ b/src/main/resources/templates/staff.html @@ -31,7 +31,8 @@ Max Koch - + +