full groups statistics
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package com.plannaplan.services;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
@ -153,4 +154,22 @@ public class GroupService {
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return amount of groups with full capacity taken
|
||||
*/
|
||||
public Integer getFullgroupsAmmount() {
|
||||
Integer response = 0;
|
||||
final Iterator<Groups> groups = this.repo.findAll().iterator();
|
||||
|
||||
while (groups.hasNext()) {
|
||||
final Groups group = groups.next();
|
||||
if (group.getCapacity() <= group.getRegisteredStudents().size()) {
|
||||
response += 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user