More cleanups of now deprecated constructors and what what

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@660844 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David E. Jones
2008-05-28 07:24:25 +00:00
parent f5d28fc7b7
commit 56eae1f8cf
14 changed files with 102 additions and 102 deletions
@@ -28,12 +28,13 @@ import java.util.Map;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilProperties;
import org.ofbiz.entity.condition.EntityConditionList;
import org.ofbiz.entity.condition.EntityExpr;
import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.entity.GenericDelegator;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.condition.EntityCondition;
import org.ofbiz.entity.condition.EntityConditionList;
import org.ofbiz.entity.condition.EntityExpr;
import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.product.product.ProductWorker;
import org.ofbiz.service.DispatchContext;
import org.ofbiz.service.GenericServiceException;
@@ -77,10 +78,10 @@ public class FixedAssetMaintServices {
return ServiceUtil.returnError
(UtilProperties.getMessage("AssetMaintUiLabels","AssetMaintLowPartInventoryError",UtilMisc.toMap("productId", productId , "quantity", Double.toString(atp)), locale));
}
EntityConditionList<EntityExpr> ecl = new EntityConditionList<EntityExpr>(UtilMisc.toList(
new EntityExpr("productId", EntityOperator.EQUALS, productId),
new EntityExpr("facilityId", EntityOperator.EQUALS, facilityId),
new EntityExpr("availableToPromiseTotal", EntityOperator.GREATER_THAN, "0")),
EntityConditionList<EntityExpr> ecl = EntityCondition.makeCondition(UtilMisc.toList(
EntityCondition.makeCondition("productId", EntityOperator.EQUALS, productId),
EntityCondition.makeCondition("facilityId", EntityOperator.EQUALS, facilityId),
EntityCondition.makeCondition("availableToPromiseTotal", EntityOperator.GREATER_THAN, "0")),
EntityOperator.AND);
List inventoryItems = delegator.findByAnd("InventoryItem", ecl, null, null, null, false); //&& inventoryItems.size() > 0
Iterator itr = inventoryItems.iterator();
@@ -81,11 +81,11 @@ if ("D".equals(viewMode)) {
globalContext.put("end", end);
}
List entityExprList = UtilMisc.toList(new EntityExpr("currentStatusId", EntityOperator.NOT_EQUAL, "CAL_CANCELLED"),
new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "TASK"), new EntityExpr("workEffortPurposeTypeId", EntityOperator.EQUALS, "WEPT_MAINTENANCE"));
List entityExprList = UtilMisc.toList(EntityCondition.makeCondition("currentStatusId", EntityOperator.NOT_EQUAL, "CAL_CANCELLED"),
EntityCondition.makeCondition("workEffortTypeId", EntityOperator.EQUALS, "TASK"), EntityCondition.makeCondition("workEffortPurposeTypeId", EntityOperator.EQUALS, "WEPT_MAINTENANCE"));
String fixedAssetId = parameters.get("fixedAssetId");
if (UtilValidate.isNotEmpty(fixedAssetId)) {
entityExprList.add(new EntityExpr("fixedAssetId", EntityOperator.EQUALS, fixedAssetId));
entityExprList.add(EntityCondition.makeCondition("fixedAssetId", EntityOperator.EQUALS, fixedAssetId));
globalContext.put("fixedAssetId", fixedAssetId);
globalContext.put("addlParam", "&fixedAssetId=" + fixedAssetId);
}
@@ -45,7 +45,7 @@ EntityFindOptions findOptions = null;
List records = FastList.newInstance();
//conditionList.add(...);
//condition = new EntityConditionList(conditionList, EntityOperator.AND);
//condition = EntityCondition.makeCondition(conditionList, EntityOperator.AND);
orderByFields = null;
@@ -1,4 +1,4 @@
/*******************************************************************************
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -15,7 +15,7 @@
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*******************************************************************************/
*/
package org.ofbiz.ebay;
import java.io.BufferedReader;
@@ -42,7 +42,7 @@ import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.base.util.UtilXml;
import org.ofbiz.entity.GenericDelegator;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.condition.EntityExpr;
import org.ofbiz.entity.condition.EntityCondition;
import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.service.DispatchContext;
import org.ofbiz.service.ServiceUtil;
@@ -172,7 +172,7 @@ public class ProductsExportToEbay {
List selectResult = (List)context.get("selectResult");
// Get the list of products to be exported to eBay
List productsList = delegator.findList("Product", new EntityExpr("productId", EntityOperator.IN, selectResult), null, null, null, false);
List productsList = delegator.findList("Product", EntityCondition.makeCondition("productId", EntityOperator.IN, selectResult), null, null, null, false);
try {
Document itemDocument = UtilXml.makeEmptyXmlDocument("AddItemRequest");
@@ -1,4 +1,4 @@
/*******************************************************************************
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -15,7 +15,7 @@
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*******************************************************************************/
*/
package org.ofbiz.googlebase;
import java.io.BufferedReader;
@@ -45,13 +45,12 @@ import org.ofbiz.base.util.UtilXml;
import org.ofbiz.entity.GenericDelegator;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.condition.EntityExpr;
import org.ofbiz.entity.condition.EntityCondition;
import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.service.DispatchContext;
import org.ofbiz.service.LocalDispatcher;
import org.ofbiz.service.ModelService;
import org.ofbiz.service.ServiceUtil;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -349,7 +348,7 @@ public class ProductsExportToGoogle {
return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToGoogle.invalidCountryCode", locale));
}
// Get the list of products to be exported to Google Base
List productsList = delegator.findList("Product", new EntityExpr("productId", EntityOperator.IN, selectResult), null, null, null, false);
List productsList = delegator.findList("Product", EntityCondition.makeCondition("productId", EntityOperator.IN, selectResult), null, null, null, false);
// Get the tracking code
if (UtilValidate.isEmpty(trackingCodeId) || "_NA_".equals(trackingCodeId)) {
@@ -182,11 +182,11 @@ public class OagisInventoryServices {
// only if looking for available inventory find the non-serialized QOH total
if (isAvailable) {
EntityCondition condition = new EntityConditionList(UtilMisc.toList(
new EntityExpr("effectiveDate", EntityOperator.LESS_THAN_EQUAL_TO, snapshotDate),
new EntityExpr("productId", EntityOperator.EQUALS, productId),
new EntityExpr("inventoryItemTypeId", EntityOperator.EQUALS, "NON_SERIAL_INV_ITEM"),
new EntityExpr("facilityId", EntityOperator.EQUALS, syncInventoryFacilityId)), EntityOperator.AND);
EntityCondition condition = EntityCondition.makeCondition(UtilMisc.toList(
EntityCondition.makeCondition("effectiveDate", EntityOperator.LESS_THAN_EQUAL_TO, snapshotDate),
EntityCondition.makeCondition("productId", EntityOperator.EQUALS, productId),
EntityCondition.makeCondition("inventoryItemTypeId", EntityOperator.EQUALS, "NON_SERIAL_INV_ITEM"),
EntityCondition.makeCondition("facilityId", EntityOperator.EQUALS, syncInventoryFacilityId)), EntityOperator.AND);
List invItemAndDetails = delegator.findList("InventoryItemDetailForSum", condition, UtilMisc.toSet("quantityOnHandSum"), null, null, false);
Iterator invItemAndDetailIter = invItemAndDetails.iterator();
while (invItemAndDetailIter.hasNext()) {
@@ -196,13 +196,13 @@ public class OagisInventoryServices {
}
// now regardless of AVAILABLE or NOTAVAILABLE check serialized inventory, just use the corresponding statusId as set above
EntityCondition serInvCondition = new EntityConditionList(UtilMisc.toList(
new EntityExpr("statusDatetime", EntityOperator.LESS_THAN_EQUAL_TO, snapshotDate),
new EntityExpr(new EntityExpr("statusEndDatetime", EntityOperator.GREATER_THAN, snapshotDate), EntityOperator.OR, new EntityExpr("statusEndDatetime", EntityOperator.EQUALS, null)),
new EntityExpr("productId", EntityOperator.EQUALS, productId),
new EntityExpr("statusId", EntityOperator.EQUALS, statusId),
new EntityExpr("inventoryItemTypeId", EntityOperator.EQUALS, "SERIALIZED_INV_ITEM"),
new EntityExpr("facilityId", EntityOperator.EQUALS, syncInventoryFacilityId)), EntityOperator.AND);
EntityCondition serInvCondition = EntityCondition.makeCondition(UtilMisc.toList(
EntityCondition.makeCondition("statusDatetime", EntityOperator.LESS_THAN_EQUAL_TO, snapshotDate),
EntityCondition.makeCondition(EntityCondition.makeCondition("statusEndDatetime", EntityOperator.GREATER_THAN, snapshotDate), EntityOperator.OR, EntityCondition.makeCondition("statusEndDatetime", EntityOperator.EQUALS, null)),
EntityCondition.makeCondition("productId", EntityOperator.EQUALS, productId),
EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, statusId),
EntityCondition.makeCondition("inventoryItemTypeId", EntityOperator.EQUALS, "SERIALIZED_INV_ITEM"),
EntityCondition.makeCondition("facilityId", EntityOperator.EQUALS, syncInventoryFacilityId)), EntityOperator.AND);
long invItemQuantCount = delegator.findCountByCondition("InventoryItemStatusForCount", serInvCondition, null, null);
quantityOnHandTotal += invItemQuantCount;
@@ -921,8 +921,8 @@ public class OagisInventoryServices {
Set productIdSet = ProductWorker.getRefurbishedProductIdSet(productId, delegator);
productIdSet.add(productId);
EntityCondition bySerialNumberCondition = new EntityExpr(new EntityExpr("serialNumber", EntityOperator.EQUALS, serialNum),
EntityOperator.AND, new EntityExpr("productId", EntityOperator.IN, productIdSet));
EntityCondition bySerialNumberCondition = EntityCondition.makeCondition(EntityCondition.makeCondition("serialNumber", EntityOperator.EQUALS, serialNum),
EntityOperator.AND, EntityCondition.makeCondition("productId", EntityOperator.IN, productIdSet));
List inventoryItemsBySerialNumber = delegator.findList("InventoryItem", bySerialNumberCondition, null, null, null, false);
if (OagisServices.requireSerialNumberExist != null) {
@@ -1393,8 +1393,8 @@ public class OagisInventoryServices {
Set productIdSet = ProductWorker.getRefurbishedProductIdSet(productId, delegator);
productIdSet.add(productId);
EntityCondition bySerialNumberCondition = new EntityExpr(new EntityExpr("serialNumber", EntityOperator.EQUALS, serialNum),
EntityOperator.AND, new EntityExpr("productId", EntityOperator.IN, productIdSet));
EntityCondition bySerialNumberCondition = EntityCondition.makeCondition(EntityCondition.makeCondition("serialNumber", EntityOperator.EQUALS, serialNum),
EntityOperator.AND, EntityCondition.makeCondition("productId", EntityOperator.IN, productIdSet));
List inventoryItemsBySerialNumber = delegator.findList("InventoryItem", bySerialNumberCondition, null, null, null, false);
// this is a status update, so referenced serial number MUST already exist
@@ -463,8 +463,8 @@ public class OagisShipmentServices {
Set productIdSet = ProductWorker.getRefurbishedProductIdSet(productId, delegator);
productIdSet.add(productId);
EntityCondition bySerialNumberCondition = new EntityExpr(new EntityExpr("serialNumber", EntityOperator.EQUALS, serialNumber),
EntityOperator.AND, new EntityExpr("productId", EntityOperator.IN, productIdSet));
EntityCondition bySerialNumberCondition = EntityCondition.makeCondition(EntityCondition.makeCondition("serialNumber", EntityOperator.EQUALS, serialNumber),
EntityOperator.AND, EntityCondition.makeCondition("productId", EntityOperator.IN, productIdSet));
List inventoryItemsBySerialNumber = delegator.findList("InventoryItem", bySerialNumberCondition, null, null, null, false);
if (OagisServices.requireSerialNumberExist.booleanValue()) {
if (inventoryItemsBySerialNumber.size() == 0) {
@@ -807,9 +807,9 @@ public class OagisShipmentServices {
if (Debug.infoOn()) Debug.logInfo("Saved OagisMessageInfo for oagisSendProcessShipment message for orderId [" + orderId + "]", module);
// check to see if there is already a Shipment for this order
EntityCondition findShipmentCondition = new EntityConditionList(UtilMisc.toList(
new EntityExpr("primaryOrderId", EntityOperator.EQUALS, orderId),
new EntityExpr("statusId", EntityOperator.NOT_EQUAL, "SHIPMENT_CANCELLED")
EntityCondition findShipmentCondition = EntityCondition.makeCondition(UtilMisc.toList(
EntityCondition.makeCondition("primaryOrderId", EntityOperator.EQUALS, orderId),
EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "SHIPMENT_CANCELLED")
), EntityOperator.AND);
List shipmentList = delegator.findList("Shipment", findShipmentCondition, null, null, null, false);
GenericValue shipment = EntityUtil.getFirst(shipmentList);
+25 -25
View File
@@ -1,4 +1,4 @@
/*******************************************************************************
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -15,45 +15,45 @@
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*******************************************************************************/
*/
package org.ofbiz.pos.event;
import java.util.List;
import java.util.HashMap;
import java.util.Map;
import java.sql.Timestamp;
import java.util.Locale;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import net.xoetrope.xui.XProjectManager;
import org.ofbiz.base.util.cache.UtilCache;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilFormatOut;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilProperties;
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.pos.device.DeviceLoader;
import org.ofbiz.pos.device.impl.Receipt;
import org.ofbiz.pos.screen.PosScreen;
import org.ofbiz.pos.screen.PaidInOut;
import org.ofbiz.base.util.cache.UtilCache;
import org.ofbiz.entity.GenericDelegator;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.condition.EntityCondition;
import org.ofbiz.entity.condition.EntityConditionList;
import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.entity.util.EntityListIterator;
import org.ofbiz.guiapp.xui.XuiSession;
import org.ofbiz.pos.PosTransaction;
import org.ofbiz.pos.adaptor.SyncCallbackAdaptor;
import org.ofbiz.pos.component.Input;
import org.ofbiz.pos.component.Output;
import org.ofbiz.entity.GenericDelegator;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.util.EntityListIterator;
import org.ofbiz.entity.condition.EntityExpr;
import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.entity.condition.EntityConditionList;
import org.ofbiz.service.LocalDispatcher;
import org.ofbiz.pos.device.DeviceLoader;
import org.ofbiz.pos.device.impl.Receipt;
import org.ofbiz.pos.screen.PaidInOut;
import org.ofbiz.pos.screen.PosScreen;
import org.ofbiz.service.GenericServiceException;
import org.ofbiz.service.LocalDispatcher;
import org.ofbiz.service.ServiceUtil;
import org.ofbiz.guiapp.xui.XuiSession;
import org.ofbiz.base.util.UtilProperties;
public class ManagerEvents {
@@ -475,12 +475,12 @@ public class ManagerEvents {
double total = 0.00;
GenericDelegator delegator = pos.getSession().getDelegator();
List exprs = UtilMisc.toList(new EntityExpr("originFacilityId", EntityOperator.EQUALS, trans.getFacilityId()),
new EntityExpr("terminalId", EntityOperator.EQUALS, trans.getTerminalId()));
List exprs = UtilMisc.toList(EntityCondition.makeCondition("originFacilityId", EntityOperator.EQUALS, trans.getFacilityId()),
EntityCondition.makeCondition("terminalId", EntityOperator.EQUALS, trans.getTerminalId()));
EntityListIterator eli = null;
try {
eli = delegator.find("OrderHeaderAndPaymentPref", new EntityConditionList(exprs, EntityOperator.AND), null, null, null, null);
eli = delegator.find("OrderHeaderAndPaymentPref", EntityCondition.makeCondition(exprs, EntityOperator.AND), null, null, null, null);
} catch (GenericEntityException e) {
Debug.logError(e, module);
}
@@ -47,25 +47,25 @@ userLogin = parameters.get("userLogin");
entryCondition = new LinkedList();
if (UtilValidate.isNotEmpty(fromDate)) {
if (fromDate.toString().length() == 10)
entryCondition.add(new EntityExpr("createdDate", EntityOperator.GREATER_THAN, fromDate + " 00:00:00.0"));
entryCondition.add(EntityCondition.makeCondition("createdDate", EntityOperator.GREATER_THAN, fromDate + " 00:00:00.0"));
else
entryCondition.add(new EntityExpr("createdDate", EntityOperator.GREATER_THAN, fromDate));
entryCondition.add(EntityCondition.makeCondition("createdDate", EntityOperator.GREATER_THAN, fromDate));
}
if (UtilValidate.isNotEmpty(workEffortName)) {
entryCondition.add(new EntityExpr("workEffortName", EntityOperator.LIKE, "%" + workEffortName + "%"));
entryCondition.add(EntityCondition.makeCondition("workEffortName", EntityOperator.LIKE, "%" + workEffortName + "%"));
}
// get subprojects for a project
if (UtilValidate.isNotEmpty(projectId)) {
entryCondition.add(new EntityExpr("workEffortParentId", EntityOperator.EQUALS, projectId));
entryCondition.add(EntityCondition.makeCondition("workEffortParentId", EntityOperator.EQUALS, projectId));
}
// create project list.
exprList = UtilMisc.toList(
new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "PROJECT"));
EntityCondition.makeCondition("workEffortTypeId", EntityOperator.EQUALS, "PROJECT"));
if (UtilValidate.isNotEmpty(entryCondition)) exprList.addAll(entryCondition);
condition = new EntityConditionList(exprList, EntityOperator.AND);
condition = EntityCondition.makeCondition(exprList, EntityOperator.AND);
projectIds = delegator.findList("WorkEffort", condition, UtilMisc.toSet("workEffortId", "workEffortName"), UtilMisc.toList("workEffortName DESC"), null, false);
// retrieve all project data with the service
@@ -108,10 +108,10 @@ if (filterTaskNotAssigned.equals("Y")) {
}else {
if(workEffortTypeId.equals("TASK")) {
if ( !(UtilValidate.isEmpty(fromDate) || UtilValidate.isEmpty(thruDate))) {
conditions = UtilMisc.toList(new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "TASK"));
conditions.add(new EntityExpr("createdStamp", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate ));
conditions.add(new EntityExpr("createdStamp", EntityOperator.LESS_THAN_EQUAL_TO, thruDate ));
allConditions = new EntityConditionList( conditions, EntityOperator.AND );
conditions = UtilMisc.toList(EntityCondition.makeCondition("workEffortTypeId", EntityOperator.EQUALS, "TASK"));
conditions.add(EntityCondition.makeCondition("createdStamp", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate ));
conditions.add(EntityCondition.makeCondition("createdStamp", EntityOperator.LESS_THAN_EQUAL_TO, thruDate ));
allConditions = EntityCondition.makeCondition( conditions, EntityOperator.AND );
orderBy = UtilMisc.toList("createdStamp DESC");
listProjects = delegator.findList("WorkEffort", allConditions, null, orderBy, null, true);
List projects = new LinkedList();
@@ -40,14 +40,14 @@ if (findAll == null) {
}
if(workEffortTypeId.equals("PROJECT")) {
if ( !UtilValidate.isEmpty(fromDate) || !UtilValidate.isEmpty(thruDate)) {
conditions = UtilMisc.toList(new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "PROJECT"));
conditions = UtilMisc.toList(EntityCondition.makeCondition("workEffortTypeId", EntityOperator.EQUALS, "PROJECT"));
if (!UtilValidate.isEmpty(fromDate)) {
conditions.add(new EntityExpr("createdStamp", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate ));
conditions.add(EntityCondition.makeCondition("createdStamp", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate ));
}
if (!UtilValidate.isEmpty(thruDate)) {
conditions.add(new EntityExpr("createdStamp", EntityOperator.LESS_THAN_EQUAL_TO, thruDate ));
conditions.add(EntityCondition.makeCondition("createdStamp", EntityOperator.LESS_THAN_EQUAL_TO, thruDate ));
}
allConditions = new EntityConditionList(conditions, EntityOperator.AND);
allConditions = EntityCondition.makeCondition(conditions, EntityOperator.AND);
orderBy = UtilMisc.toList("createdStamp DESC");
listProjects = delegator.findList("WorkEffort", allConditions, null, orderBy, null, true);
List projects = new LinkedList();
@@ -91,15 +91,15 @@ if(workEffortTypeId.equals("PROJECT")) {
} else {
if ( !UtilValidate.isEmpty(fromDate) || !UtilValidate.isEmpty(thruDate)) {
conditions = UtilMisc.toList(new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "TASK"));
conditions = UtilMisc.toList(EntityCondition.makeCondition("workEffortTypeId", EntityOperator.EQUALS, "TASK"));
if (!UtilValidate.isEmpty(fromDate)) {
conditions.add(new EntityExpr("createdStamp", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate ));
conditions.add(EntityCondition.makeCondition("createdStamp", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate ));
}
if (!UtilValidate.isEmpty(thruDate)) {
conditions.add(new EntityExpr("createdStamp", EntityOperator.LESS_THAN_EQUAL_TO, thruDate ));
conditions.add(EntityCondition.makeCondition("createdStamp", EntityOperator.LESS_THAN_EQUAL_TO, thruDate ));
}
allConditions = new EntityConditionList( conditions, EntityOperator.AND );
allConditions = EntityCondition.makeCondition( conditions, EntityOperator.AND );
orderBy = UtilMisc.toList("createdStamp DESC");
tasks = delegator.findList("WorkEffort", allConditions, null, orderBy, null, true);
List unAssignedTasks = new LinkedList();
@@ -37,9 +37,9 @@ if (findAll == null) {
List timeSheetList = new LinkedList();
if ( !(UtilValidate.isEmpty(fromDate) || UtilValidate.isEmpty(thruDate))) {
List conditions = new LinkedList();
conditions.add(new EntityExpr("createdStamp", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate));
conditions.add(new EntityExpr("createdStamp", EntityOperator.LESS_THAN_EQUAL_TO, thruDate));
allConditions = new EntityConditionList(conditions, EntityOperator.AND);
conditions.add(EntityCondition.makeCondition("createdStamp", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate));
conditions.add(EntityCondition.makeCondition("createdStamp", EntityOperator.LESS_THAN_EQUAL_TO, thruDate));
allConditions = EntityCondition.makeCondition(conditions, EntityOperator.AND);
orderBy = UtilMisc.toList("createdStamp DESC");
timeSheetList = delegator.findList("Timesheet", allConditions, null, orderBy, null, true);
context.put("timeSheetList", timeSheetList);
@@ -48,10 +48,10 @@ if (!UtilValidate.isEmpty(tasks)) {
timesheet = timeEntry.getRelatedOne("Timesheet");
// check the role of his part, if party is a provider
exprs = UtilMisc.toList(
new EntityExpr("workEffortId", EntityOperator.EQUALS, timeEntry.getString("workEffortId")),
new EntityExpr("partyId", EntityOperator.EQUALS, timeEntry.getString("partyId")),
new EntityExpr("roleTypeId", EntityOperator.LIKE, "PROVIDER_%"));
ecl = new EntityConditionList(exprs, EntityOperator.AND);
EntityCondition.makeCondition("workEffortId", EntityOperator.EQUALS, timeEntry.getString("workEffortId")),
EntityCondition.makeCondition("partyId", EntityOperator.EQUALS, timeEntry.getString("partyId")),
EntityCondition.makeCondition("roleTypeId", EntityOperator.LIKE, "PROVIDER_%"));
ecl = EntityCondition.makeCondition(exprs, EntityOperator.AND);
providerRoles = EntityUtil.filterByDate(delegator.findList("WorkEffortPartyAssignment", ecl, null, null, null, false));
if (!UtilValidate.isEmpty(providerRoles)) {
rates = EntityUtil.filterByDate(delegator.findByAnd("PartyRate",
@@ -45,34 +45,34 @@ userLogin = parameters.get("userLogin");
// entry conditions
entryCondition = new LinkedList();
if (UtilValidate.isNotEmpty(fromDate)) {
entryCondition.add(new EntityExpr("createdDate", EntityOperator.GREATER_THAN, fromDate + " 00:00:00.0"));
entryCondition.add(EntityCondition.makeCondition("createdDate", EntityOperator.GREATER_THAN, fromDate + " 00:00:00.0"));
}
if (UtilValidate.isNotEmpty(workEffortName)) {
entryCondition.add(new EntityExpr("workEffortName", EntityOperator.LIKE, "%" + workEffortName + "%"));
entryCondition.add(EntityCondition.makeCondition("workEffortName", EntityOperator.LIKE, "%" + workEffortName + "%"));
}
// create workEffort list for tasks with no phase.
exprList = UtilMisc.toList(
new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "TASK"),
new EntityExpr("workEffortParentId", EntityOperator.EQUALS, null),
new EntityExpr("createdByUserLogin", EntityOperator.EQUALS, userLogin.getString("userLoginId")));
EntityCondition.makeCondition("workEffortTypeId", EntityOperator.EQUALS, "TASK"),
EntityCondition.makeCondition("workEffortParentId", EntityOperator.EQUALS, null),
EntityCondition.makeCondition("createdByUserLogin", EntityOperator.EQUALS, userLogin.getString("userLoginId")));
if (UtilValidate.isNotEmpty(entryCondition)) exprList.addAll(entryCondition);
condition = new EntityConditionList(exprList, EntityOperator.AND);
condition = EntityCondition.makeCondition(exprList, EntityOperator.AND);
tasks = delegator.findList("WorkEffort", condition, null, null, null, false);
// create workEffort list in a project
exprList = UtilMisc.toList(
new EntityExpr("createdByUserLogin", EntityOperator.EQUALS, userLogin.getString("userLoginId")));
EntityCondition.makeCondition("createdByUserLogin", EntityOperator.EQUALS, userLogin.getString("userLoginId")));
if (UtilValidate.isNotEmpty(entryCondition)) exprList.addAll(entryCondition);
condition = new EntityConditionList(exprList, EntityOperator.AND);
condition = EntityCondition.makeCondition(exprList, EntityOperator.AND);
tasks.addAll(delegator.findList("ProjectAndPhaseAndTask", condition, null, null, null, false));
// add the timeEntry conditions
exprList = UtilMisc.toList(
new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "TASK"),
new EntityExpr("createdByUserLogin", EntityOperator.NOT_EQUAL, userLogin.getString("userLoginId"))); //already have these
EntityCondition.makeCondition("workEffortTypeId", EntityOperator.EQUALS, "TASK"),
EntityCondition.makeCondition("createdByUserLogin", EntityOperator.NOT_EQUAL, userLogin.getString("userLoginId"))); //already have these
if (UtilValidate.isNotEmpty(entryCondition)) exprList.addAll(entryCondition);
condition = new EntityConditionList(exprList, EntityOperator.AND);
condition = EntityCondition.makeCondition(exprList, EntityOperator.AND);
tasks.addAll(delegator.findList("WorkEffortAndTimeEntry", condition, null, null, null, false));
// add fields for planned and actual hours.