WorkEffortServices.java getWorkEffortEventsByPeriod(...) method fixed to return assigned fixed assets.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@703701 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrian Crum
2008-10-11 18:05:58 +00:00
parent 900e45c98b
commit fbb85e937e
2 changed files with 13 additions and 12 deletions
@@ -181,16 +181,14 @@ under the License.
<view-link entity-alias="WE" rel-entity-alias="WEFAA">
<key-map field-name="workEffortId"/>
</view-link>
<relation type="one-nofk" rel-entity-name="WorkEffort">
<key-map field-name="workEffortId"/>
</relation>
<relation type="one-nofk" rel-entity-name="WorkEffortFixedAssetAssign">
<key-map field-name="workEffortId"/>
<relation type="one-nofk" rel-entity-name="FixedAsset">
<key-map field-name="fixedAssetId"/>
<key-map field-name="fromDate"/>
</relation>
<relation type="one-nofk" rel-entity-name="WorkEffortType">
<key-map field-name="workEffortTypeId"/>
<relation type="one-nofk" rel-entity-name="StatusItem">
<key-map field-name="statusId"/>
</relation>
<relation type="one-nofk" rel-entity-name="StatusItem" title="Availability">
<key-map field-name="availabilityStatusId" rel-field-name="statusId"/>
</relation>
</view-entity>
<view-entity entity-name="WorkEffortAndPartyAssign"
@@ -362,7 +362,7 @@ public class WorkEffortServices {
}
if (UtilValidate.isNotEmpty(fixedAssetId)) {
entityExprList.add(EntityCondition.makeCondition("fixedAssetId", EntityOperator.EQUALS, fixedAssetId));
typesList.add(EntityCondition.makeCondition("workEffortTypeId", EntityOperator.EQUALS, "PROD_ORDER_TASK"));
// typesList.add(EntityCondition.makeCondition("workEffortTypeId", EntityOperator.EQUALS, "PROD_ORDER_TASK"));
entityExprList.add(EntityCondition.makeCondition("currentStatusId", EntityOperator.NOT_EQUAL, "PRUN_CREATED"));
entityExprList.add(EntityCondition.makeCondition("currentStatusId", EntityOperator.NOT_EQUAL, "PRUN_COMPLETED"));
entityExprList.add(EntityCondition.makeCondition("currentStatusId", EntityOperator.NOT_EQUAL, "PRUN_CLOSED"));
@@ -488,13 +488,16 @@ public class WorkEffortServices {
entityExprList.add(EntityCondition.makeCondition("currentStatusId", EntityOperator.NOT_EQUAL, "EVENT_CANCELLED"));
}
EntityConditionList<EntityCondition> ecl = EntityCondition.makeCondition(entityExprList);
// Use the View Entity
List<String> orderByList = UtilMisc.toList("estimatedStartDate");
if (partyIdsToUse.size() > 0 || UtilValidate.isNotEmpty(facilityId) || UtilValidate.isNotEmpty(fixedAssetId)) {
try {
List<GenericValue> tempWorkEfforts = null;
if (UtilValidate.isNotEmpty(partyIds)) {
tempWorkEfforts = EntityUtil.filterByDate(delegator.findList("WorkEffortAndPartyAssign", ecl, null, UtilMisc.toList("estimatedStartDate"), null, false));
tempWorkEfforts = EntityUtil.filterByDate(delegator.findList("WorkEffortAndPartyAssign", ecl, null, orderByList, null, false));
} else if (UtilValidate.isNotEmpty(fixedAssetId)) {
// Get "old style" work efforts and "new style" work efforts
tempWorkEfforts = delegator.findList("WorkEffort", ecl, null, orderByList, null, false);
tempWorkEfforts.addAll(EntityUtil.filterByDate(delegator.findList("WorkEffortAndFixedAssetAssign", ecl, null, orderByList, null, false)));
} else {
tempWorkEfforts = delegator.findList("WorkEffort", ecl, null, UtilMisc.toList("estimatedStartDate"), null, false);
}