ItEr60S04ValidacionEProbasFuncionaisItEr59S04: [Bug #532] Fix bug, retrieve correctly the DayAssignments from the selected Criteria when in 'filter by criteria' mode.
This commit is contained in:
parent
3971221313
commit
f1bfed4b51
1 changed files with 21 additions and 3 deletions
|
|
@ -220,11 +220,15 @@ public class ResourceLoadModel implements IResourceLoadModel {
|
|||
if (filterByResources) {
|
||||
result.addAll(groupsFor(resourcesToShow()));
|
||||
} else {
|
||||
result.addAll(groupsFor(genericAllocationsByCriterion()));
|
||||
calculatedGenericAllocationsByCriterion =
|
||||
genericAllocationsByCriterion();
|
||||
result.addAll(groupsFor(calculatedGenericAllocationsByCriterion));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Map<Criterion, List<GenericResourceAllocation>> calculatedGenericAllocationsByCriterion;
|
||||
|
||||
private Map<Criterion, List<GenericResourceAllocation>> genericAllocationsByCriterion() {
|
||||
if (!criteriaToShowList.isEmpty()) {
|
||||
reattachCriteriaToShow();
|
||||
|
|
@ -856,8 +860,22 @@ public class ResourceLoadModel implements IResourceLoadModel {
|
|||
|
||||
@Transactional(readOnly = true)
|
||||
public List<DayAssignment> getDayAssignments() {
|
||||
return dayAssignmentDAO.findByResources(scenarioManager.getCurrent(),
|
||||
getResources());
|
||||
if(filterByResources) {
|
||||
return dayAssignmentDAO.findByResources(scenarioManager.getCurrent(),
|
||||
getResources());
|
||||
}
|
||||
else {
|
||||
List<DayAssignment> dayAssignments = new ArrayList<DayAssignment>();
|
||||
for(Entry<Criterion, List<GenericResourceAllocation>> entry :
|
||||
calculatedGenericAllocationsByCriterion.entrySet()) {
|
||||
|
||||
for(GenericResourceAllocation allocation : entry.getValue()) {
|
||||
dayAssignments.addAll(allocation.getAssignments());
|
||||
}
|
||||
}
|
||||
|
||||
return dayAssignments;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue