diff --git a/buisnesslogic/src/main/java/com/plannaplan/services/GroupService.java b/buisnesslogic/src/main/java/com/plannaplan/services/GroupService.java index 1cd4971..29673ec 100755 --- a/buisnesslogic/src/main/java/com/plannaplan/services/GroupService.java +++ b/buisnesslogic/src/main/java/com/plannaplan/services/GroupService.java @@ -5,6 +5,7 @@ import java.util.List; import java.util.Objects; import java.util.Optional; import java.util.stream.Collectors; +import java.util.function.Function; import com.plannaplan.entities.Groups; import com.plannaplan.repositories.GroupRepository; @@ -63,8 +64,18 @@ public class GroupService { public HashMap getTakenPlaces(List groups) { HashMap response = new HashMap<>(); - List respoonses = this.repo.getAssignedAmounts( - groups.stream().filter(Objects::nonNull).map(Groups::getId).collect(Collectors.toList())); + // List respoonses = this.repo.getAssignedAmounts( + // groups.stream().filter(Objects::nonNull).map(Groups::getId).collect(Collectors.toList())); + + List respoonses = this.repo + .getAssignedAmounts(groups.stream().filter(Objects::nonNull).map(new Function() { + @Override + public Long apply(Groups p) { + final Long id = p.getId(); + response.put(id, 0); + return id; + } + }).collect(Collectors.toList())); for (Object[] element : respoonses) { response.put(((Groups) element[0]).getId(), ((Long) element[1]).intValue());