From a52adc6783fdda0f0ccc8c52b75734062ed20bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Gonz=C3=A1lez=20Fern=C3=A1ndez?= Date: Thu, 28 Oct 2010 13:30:15 +0200 Subject: [PATCH] The start date when merging the allocation is defined by the task In the future the start will be defined by the aggregate of resource allocations if the task is planned backwards. FEA: ItEr62OTS04PlanificacionHaciaAtras --- .../business/planner/entities/Task.java | 17 +---------------- .../planner/allocation/AllocationResult.java | 7 ++++++- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/navalplanner-business/src/main/java/org/navalplanner/business/planner/entities/Task.java b/navalplanner-business/src/main/java/org/navalplanner/business/planner/entities/Task.java index 4282473cc..c6bdb4035 100644 --- a/navalplanner-business/src/main/java/org/navalplanner/business/planner/entities/Task.java +++ b/navalplanner-business/src/main/java/org/navalplanner/business/planner/entities/Task.java @@ -359,22 +359,7 @@ public class Task extends TaskElement implements ITaskLeafConstraint { } - public void mergeAllocation(Scenario scenario, - CalculatedValue calculatedValue, - AggregateOfResourceAllocations aggregate, - List> newAllocations, - List modifications, - Collection> toRemove) { - if (aggregate.isEmpty()) { - return; - } - final IntraDayDate start = aggregate.getStart(); - final IntraDayDate end = aggregate.getEnd(); - mergeAllocation(scenario, start, end, calculatedValue, newAllocations, - modifications, toRemove); - } - - private void mergeAllocation(Scenario scenario, final IntraDayDate start, + public void mergeAllocation(Scenario scenario, final IntraDayDate start, final IntraDayDate end, CalculatedValue calculatedValue, List> newAllocations, diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationResult.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationResult.java index 07d094fc7..c1fc8fee5 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationResult.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationResult.java @@ -130,7 +130,12 @@ public class AllocationResult { public void applyTo(Scenario scenario, Task task) { List modified = getModified(); - task.mergeAllocation(scenario, getCalculatedValue(), aggregate, + if (aggregate.isEmpty()) { + return; + } + final IntraDayDate start = task.getIntraDayStartDate(); + final IntraDayDate end = aggregate.getEnd(); + task.mergeAllocation(scenario, start, end, getCalculatedValue(), getNew(), modified, getNotModified(originals(modified))); }