Disabled loading of HourCosts associated to Criterion CostCategory
FEA: ItEr77S17AutomaticBudgeting As a method has been added to HourCostDAO to provide the PricePerHour associated to a category, for an specific WorkHourType, the loading and attachment of these objects is not longer needed here.
This commit is contained in:
parent
902ad00b80
commit
b512f75bfc
1 changed files with 0 additions and 36 deletions
|
|
@ -39,12 +39,6 @@ import org.libreplan.business.common.IAdHocTransactionService;
|
||||||
import org.libreplan.business.common.IOnTransaction;
|
import org.libreplan.business.common.IOnTransaction;
|
||||||
import org.libreplan.business.common.daos.IEntitySequenceDAO;
|
import org.libreplan.business.common.daos.IEntitySequenceDAO;
|
||||||
import org.libreplan.business.common.entities.EntityNameEnum;
|
import org.libreplan.business.common.entities.EntityNameEnum;
|
||||||
import org.libreplan.business.common.exceptions.InstanceNotFoundException;
|
|
||||||
import org.libreplan.business.costcategories.daos.CostCategoryDAO;
|
|
||||||
import org.libreplan.business.costcategories.daos.ICostCategoryDAO;
|
|
||||||
import org.libreplan.business.costcategories.daos.IHourCostDAO;
|
|
||||||
import org.libreplan.business.costcategories.entities.CostCategory;
|
|
||||||
import org.libreplan.business.costcategories.entities.HourCost;
|
|
||||||
import org.libreplan.business.labels.entities.Label;
|
import org.libreplan.business.labels.entities.Label;
|
||||||
import org.libreplan.business.orders.daos.IOrderDAO;
|
import org.libreplan.business.orders.daos.IOrderDAO;
|
||||||
import org.libreplan.business.orders.entities.HoursGroup;
|
import org.libreplan.business.orders.entities.HoursGroup;
|
||||||
|
|
@ -174,12 +168,6 @@ public class PlanningStateCreator {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IEntitySequenceDAO entitySequenceDAO;
|
private IEntitySequenceDAO entitySequenceDAO;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ICostCategoryDAO costCategoryDAO;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IHourCostDAO hourCostDAO;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TaskElementAdapter taskElementAdapterCreator;
|
private TaskElementAdapter taskElementAdapterCreator;
|
||||||
|
|
||||||
|
|
@ -284,17 +272,6 @@ public class PlanningStateCreator {
|
||||||
final List<Resource> allResources = resourceDAO.list(Resource.class);
|
final List<Resource> allResources = resourceDAO.list(Resource.class);
|
||||||
criterionDAO.list(Criterion.class);
|
criterionDAO.list(Criterion.class);
|
||||||
|
|
||||||
// Attaching cost categories with their hourcosts and types
|
|
||||||
for (CostCategory costCategory : costCategoryDAO
|
|
||||||
.list(CostCategory.class)) {
|
|
||||||
if (costCategory.getHourCosts() != null) {
|
|
||||||
for (HourCost hourCost : costCategory.getHourCosts()) {
|
|
||||||
hourCost.getPriceCost();
|
|
||||||
hourCost.getType().getDefaultPrice();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
forceLoadOfOrderAssociatedData(orderReloaded);
|
forceLoadOfOrderAssociatedData(orderReloaded);
|
||||||
TaskGroup rootTask = orderReloaded.getAssociatedTaskElement();
|
TaskGroup rootTask = orderReloaded.getAssociatedTaskElement();
|
||||||
if (rootTask != null) {
|
if (rootTask != null) {
|
||||||
|
|
@ -340,28 +317,15 @@ public class PlanningStateCreator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (CriterionRequirement requirement : each
|
|
||||||
.getCriterionRequirements()) {
|
|
||||||
if (requirement.getCriterion().getCostCategory() != null) {
|
|
||||||
requirement.getCriterion().getCostCategory().getHourCosts()
|
|
||||||
.size();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (HoursGroup hours : each.getHoursGroups()) {
|
for (HoursGroup hours : each.getHoursGroups()) {
|
||||||
for (CriterionRequirement requirement : hours
|
for (CriterionRequirement requirement : hours
|
||||||
.getCriterionRequirements()) {
|
.getCriterionRequirements()) {
|
||||||
|
|
||||||
// attach cost categories
|
|
||||||
if (requirement.getCriterion().getCostCategory() != null) {
|
|
||||||
requirement.getCriterion().getCostCategory()
|
|
||||||
.getHourCosts().size();
|
|
||||||
|
|
||||||
requirement.ensureDataLoaded();
|
requirement.ensureDataLoaded();
|
||||||
}
|
}
|
||||||
hours.getValidCriterions().size();
|
hours.getValidCriterions().size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void forceLoadDayAssignments(Set<Resource> resources) {
|
private void forceLoadDayAssignments(Set<Resource> resources) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue