Added taken place in course response (needs refactor later)

This commit is contained in:
Filip Izydorczyk
2020-12-07 23:32:11 +01:00
parent 48394d3583
commit c34d53d056
3 changed files with 47 additions and 2 deletions

View File

@ -14,7 +14,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Service of GroupService which can find(optional), get(By Course, Groups Ammount, Group By Id, find Not Existing Group), save, delete group.
* Service of GroupService which can find(optional), get(By Course, Groups
* Ammount, Group By Id, find Not Existing Group), save, delete group.
*/
@Service
@ -68,6 +69,10 @@ public class GroupService {
public HashMap<Long, Integer> getTakenPlaces(List<Groups> groups) {
HashMap<Long, Integer> response = new HashMap<>();
if (groups.size() == 0) {
return response;
}
List<Object[]> respoonses = this.repo
.getAssignedAmounts(groups.stream().filter(Objects::nonNull).map(new Function<Groups, Long>() {
@Override