From b512f75bfc22de4f370d3e42f8bd2c599c860fdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenzo=20Tilve=20=C3=81lvaro?= Date: Wed, 19 Jun 2013 13:37:39 +0200 Subject: [PATCH] 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. --- .../planner/order/PlanningStateCreator.java | 36 ------------------- 1 file changed, 36 deletions(-) diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/planner/order/PlanningStateCreator.java b/libreplan-webapp/src/main/java/org/libreplan/web/planner/order/PlanningStateCreator.java index 9440c41c9..20a49e16c 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/planner/order/PlanningStateCreator.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/planner/order/PlanningStateCreator.java @@ -39,12 +39,6 @@ import org.libreplan.business.common.IAdHocTransactionService; import org.libreplan.business.common.IOnTransaction; import org.libreplan.business.common.daos.IEntitySequenceDAO; 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.orders.daos.IOrderDAO; import org.libreplan.business.orders.entities.HoursGroup; @@ -174,12 +168,6 @@ public class PlanningStateCreator { @Autowired private IEntitySequenceDAO entitySequenceDAO; - @Autowired - private ICostCategoryDAO costCategoryDAO; - - @Autowired - private IHourCostDAO hourCostDAO; - @Autowired private TaskElementAdapter taskElementAdapterCreator; @@ -284,17 +272,6 @@ public class PlanningStateCreator { final List allResources = resourceDAO.list(Resource.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); TaskGroup rootTask = orderReloaded.getAssociatedTaskElement(); 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 (CriterionRequirement requirement : hours .getCriterionRequirements()) { - // attach cost categories - if (requirement.getCriterion().getCostCategory() != null) { - requirement.getCriterion().getCostCategory() - .getHourCosts().size(); - requirement.ensureDataLoaded(); } hours.getValidCriterions().size(); } } - } } private void forceLoadDayAssignments(Set resources) {