new helper method to check if bin is complete
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@496779 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -29,8 +29,10 @@ import org.ofbiz.entity.condition.EntityConditionList;
|
||||
import org.ofbiz.entity.condition.EntityCondition;
|
||||
import org.ofbiz.entity.GenericDelegator;
|
||||
import org.ofbiz.entity.GenericEntityException;
|
||||
import org.ofbiz.entity.GenericValue;
|
||||
import org.ofbiz.base.util.UtilMisc;
|
||||
import org.ofbiz.base.util.Debug;
|
||||
import org.ofbiz.base.util.GeneralException;
|
||||
|
||||
public class PickListServices {
|
||||
|
||||
@@ -82,4 +84,28 @@ public class PickListServices {
|
||||
result.put("orderHeaderList", orderHeaderList);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static boolean isBinComplete(GenericDelegator delegator, String picklistBinId) throws GeneralException {
|
||||
// lookup the items in the bin
|
||||
List items;
|
||||
try {
|
||||
items = delegator.findByAnd("PicklistItem", UtilMisc.toMap("picklistBinId", picklistBinId));
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logError(e, module);
|
||||
throw e;
|
||||
}
|
||||
|
||||
if (items != null) {
|
||||
Iterator i = items.iterator();
|
||||
GenericValue v = (GenericValue) i.next();
|
||||
String itemStatus = v.getString("itemStatusId");
|
||||
if (itemStatus != null) {
|
||||
if (!"PICKITEM_COMPLETED".equals(itemStatus)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user