ItEr59S04ValidacionEProbasFuncionaisItEr58S04: [Bug #497] Resources are reloaded in order to show the load chart.
While allocating DayAssignments are resources are changed, but Order.getResources() still returns the old resources with the original DayAssignments. This list of resources is reloaded in order to get just the new DayAssignments.
This commit is contained in:
parent
5aba8ae2bb
commit
75017c9fe8
1 changed files with 12 additions and 1 deletions
|
|
@ -1092,7 +1092,7 @@ public abstract class OrderPlanningModel implements IOrderPlanningModel {
|
|||
SortedMap<LocalDate, Map<Resource, Integer>> orderDayAssignmentsGrouped = groupDayAssignmentsByDayAndResource(orderDayAssignments);
|
||||
|
||||
List<DayAssignment> resourcesDayAssignments = new ArrayList<DayAssignment>();
|
||||
for (Resource resource : order.getResources()) {
|
||||
for (Resource resource : reloadResources(order.getResources())) {
|
||||
resourcesDayAssignments.addAll(resource.getAssignments());
|
||||
}
|
||||
SortedMap<LocalDate, Map<Resource, Integer>> resourceDayAssignmentsGrouped = groupDayAssignmentsByDayAndResource(resourcesDayAssignments);
|
||||
|
|
@ -1145,6 +1145,17 @@ public abstract class OrderPlanningModel implements IOrderPlanningModel {
|
|||
chart.setHeight("150px");
|
||||
}
|
||||
|
||||
private List<Resource> reloadResources(
|
||||
Collection<? extends Resource> resources) {
|
||||
List<Resource> result = new ArrayList<Resource>();
|
||||
for (Resource each : resources) {
|
||||
Resource reloaded = resourceDAO
|
||||
.findExistingEntity(each.getId());
|
||||
result.add(reloaded);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void resetMaps() {
|
||||
mapOrderLoad.clear();
|
||||
mapOrderOverload.clear();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue