Schedule taken places
This commit is contained in:
@ -7,6 +7,7 @@ import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.plannaplan.entities.Assignment;
|
||||
import com.plannaplan.entities.Groups;
|
||||
import com.plannaplan.repositories.GroupRepository;
|
||||
|
||||
@ -30,7 +31,7 @@ public class GroupService {
|
||||
return this.repo.find(time, room, capacity);
|
||||
}
|
||||
|
||||
public Optional<Groups> find(Integer zajCykId, Integer nrGr ) {
|
||||
public Optional<Groups> find(Integer zajCykId, Integer nrGr) {
|
||||
return this.repo.find(zajCykId, nrGr);
|
||||
}
|
||||
|
||||
@ -64,6 +65,16 @@ public class GroupService {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param assingemnts list of assingemnts you want to get taken places ammount
|
||||
* @return HashMap<Long, Integer> where Long is group id and Integer is how many
|
||||
* places in gorup is already taken
|
||||
*/
|
||||
public HashMap<Long, Integer> getTakenPlacesOfAssignments(List<Assignment> assignments) {
|
||||
return getTakenPlaces(assignments.stream().map(Assignment::getGroup).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param groups list of groups you want to get taken places ammount
|
||||
|
Reference in New Issue
Block a user