Class PackingSession
- java.lang.Object
-
- org.apache.ofbiz.shipment.packing.PackingSession
-
- All Implemented Interfaces:
java.io.Serializable
public class PackingSession extends java.lang.Object implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.math.BigDecimal
additionalShippingCharge
protected java.lang.String
delegatorName
protected java.lang.String
dispatcherName
protected java.lang.String
facilityId
protected java.lang.String
instructions
protected java.util.List<org.apache.ofbiz.shipment.packing.PackingSession.ItemDisplay>
itemInfos
static java.lang.String
module
protected int
packageSeq
protected java.util.Map<java.lang.Integer,java.math.BigDecimal>
packageWeights
protected java.util.List<PackingEvent>
packEvents
protected java.util.List<PackingSessionLine>
packLines
protected java.lang.String
pickerPartyId
protected java.lang.String
picklistBinId
protected java.lang.String
primaryOrderId
protected java.lang.String
primaryShipGrp
protected java.lang.String
shipmentBoxTypeId
protected java.util.Map<java.lang.Integer,java.lang.String>
shipmentBoxTypes
protected java.lang.String
shipmentId
protected int
status
protected GenericValue
userLogin
protected java.lang.String
weightUomId
-
Constructor Summary
Constructors Constructor Description PackingSession(LocalDispatcher dispatcher, GenericValue userLogin)
PackingSession(LocalDispatcher dispatcher, GenericValue userLogin, java.lang.String facilityId)
PackingSession(LocalDispatcher dispatcher, GenericValue userLogin, java.lang.String facilityId, java.lang.String binId, java.lang.String orderId, java.lang.String shipGrp)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addItemInfo(java.util.List<GenericValue> infos)
void
addOrIncreaseLine(java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId, java.lang.String productId, java.math.BigDecimal quantity, int packageSeqId, java.math.BigDecimal weight, boolean update)
void
addOrIncreaseLine(java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId, java.math.BigDecimal quantity, int packageSeqId)
void
addOrIncreaseLine(java.lang.String productId, java.math.BigDecimal quantity, int packageSeqId)
void
addToPackageWeight(int packageSeqId, java.math.BigDecimal weight)
protected void
applyItemsToPackages()
protected void
checkEmptyLines()
protected boolean
checkLine(java.util.List<PackingSessionLine> processedLines, PackingSessionLine line)
protected int
checkLineForAdd(GenericValue res, java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId, java.lang.String productId, java.math.BigDecimal quantity, int packageSeqId, boolean update)
protected void
checkReservations(boolean ignore)
void
clear()
void
clearAllLines()
void
clearItemInfos()
int
clearLastPackage()
void
clearLine(PackingSessionLine line)
java.lang.String
complete(boolean force)
protected void
createPackages()
protected void
createPackLineItem(int checkCode, GenericValue res, java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId, java.lang.String productId, java.math.BigDecimal quantity, java.math.BigDecimal weight, int packageSeqId)
protected void
createShipment()
PackingSessionLine
findLine(java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId, java.lang.String productId, java.lang.String inventoryItemId, int packageSeq)
protected java.lang.String
findOrderItemSeqId(java.lang.String productId, java.lang.String orderId, java.lang.String shipGroupSeqId, java.math.BigDecimal quantity)
java.math.BigDecimal
getAdditionalShippingCharge()
int
getCurrentPackageSeq()
java.math.BigDecimal
getCurrentReservedQuantity(java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId, java.lang.String productId)
java.util.List<java.lang.String>
getCurrentShipmentIds(java.lang.String orderId, java.lang.String shipGroupSeqId)
java.util.List<java.lang.String>
getCurrentShipmentIds(java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId)
java.math.BigDecimal
getCurrentShippedQuantity(java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId)
Delegator
getDelegator()
LocalDispatcher
getDispatcher()
java.lang.String
getFacilityId()
java.lang.String
getHandlingInstructions()
java.util.List<org.apache.ofbiz.shipment.packing.PackingSession.ItemDisplay>
getItemInfos()
protected java.util.List<GenericValue>
getItemIssuances(java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId)
java.util.List<PackingSessionLine>
getLines()
java.util.List<java.lang.Integer>
getPackageSeqIds()
java.math.BigDecimal
getPackageWeight(int packageSeqId)
java.math.BigDecimal
getPackedQuantity(int packageSeq)
java.math.BigDecimal
getPackedQuantity(java.lang.String productId)
java.math.BigDecimal
getPackedQuantity(java.lang.String productId, int packageSeq)
java.math.BigDecimal
getPackedQuantity(java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId, java.lang.String productId)
java.math.BigDecimal
getPackedQuantity(java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId, java.lang.String productId, int packageSeq)
java.math.BigDecimal
getPackedQuantity(java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId, java.lang.String productId, java.lang.String inventoryItemId, int packageSeq)
java.util.Map<java.lang.Object,java.lang.Object>
getPackingSessionLinesByPackage()
Delivers all the packing lines grouped by package.java.lang.String
getPickerPartyId()
java.lang.String
getPicklistBinId()
java.lang.String
getPrimaryOrderId()
java.lang.String
getPrimaryShipGroupSeqId()
java.lang.String
getShipmentBoxType(int packageSeqId)
java.math.BigDecimal
getShipmentCostEstimate(java.lang.String shippingContactMechId, java.lang.String shipmentMethodTypeId, java.lang.String carrierPartyId, java.lang.String carrierRoleTypeId, java.lang.String productStoreId, java.util.List<GenericValue> shippableItemInfo, java.math.BigDecimal shippableTotal, java.math.BigDecimal shippableWeight, java.math.BigDecimal shippableQuantity)
java.math.BigDecimal
getShipmentCostEstimate(GenericValue orderItemShipGroup, java.lang.String productStoreId)
java.math.BigDecimal
getShipmentCostEstimate(GenericValue orderItemShipGroup, java.lang.String productStoreId, java.util.List<GenericValue> shippableItemInfo, java.math.BigDecimal shippableTotal, java.math.BigDecimal shippableWeight, java.math.BigDecimal shippableQuantity)
java.lang.String
getShipmentId()
int
getStatus()
java.math.BigDecimal
getTotalWeight()
GenericValue
getUserLogin()
java.lang.String
getWeightUomId()
protected void
issueItemsToShipment()
int
nextPackageSeq()
void
registerEvent(PackingEvent event)
protected void
runEvents(int eventCode)
void
setAdditionalShippingCharge(java.math.BigDecimal additionalShippingCharge)
void
setFacilityId(java.lang.String facilityId)
void
setHandlingInstructions(java.lang.String instructions)
void
setPackageWeight(int packageSeqId, java.math.BigDecimal packageWeight)
protected void
setPickerOnPicklist()
void
setPickerPartyId(java.lang.String partyId)
void
setPicklistBinId(java.lang.String binId)
protected void
setPicklistToPicked()
void
setPrimaryOrderId(java.lang.String orderId)
void
setPrimaryShipGroupSeqId(java.lang.String shipGroupSeqId)
void
setShipmentBoxType(int packageSeqId, java.lang.String shipmentBoxType)
void
setShipmentBoxTypeId(java.lang.String shipmentBoxTypeId)
protected void
setShipmentToPacked()
void
setWeightUomId(java.lang.String weightUomId)
protected void
updateShipmentRouteSegments()
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
userLogin
protected GenericValue userLogin
-
pickerPartyId
protected java.lang.String pickerPartyId
-
primaryOrderId
protected java.lang.String primaryOrderId
-
primaryShipGrp
protected java.lang.String primaryShipGrp
-
dispatcherName
protected java.lang.String dispatcherName
-
delegatorName
protected java.lang.String delegatorName
-
picklistBinId
protected java.lang.String picklistBinId
-
facilityId
protected java.lang.String facilityId
-
shipmentId
protected java.lang.String shipmentId
-
instructions
protected java.lang.String instructions
-
weightUomId
protected java.lang.String weightUomId
-
shipmentBoxTypeId
protected java.lang.String shipmentBoxTypeId
-
additionalShippingCharge
protected java.math.BigDecimal additionalShippingCharge
-
packageWeights
protected java.util.Map<java.lang.Integer,java.math.BigDecimal> packageWeights
-
packEvents
protected java.util.List<PackingEvent> packEvents
-
packLines
protected java.util.List<PackingSessionLine> packLines
-
itemInfos
protected java.util.List<org.apache.ofbiz.shipment.packing.PackingSession.ItemDisplay> itemInfos
-
packageSeq
protected int packageSeq
-
status
protected int status
-
shipmentBoxTypes
protected java.util.Map<java.lang.Integer,java.lang.String> shipmentBoxTypes
-
-
Constructor Detail
-
PackingSession
public PackingSession(LocalDispatcher dispatcher, GenericValue userLogin, java.lang.String facilityId, java.lang.String binId, java.lang.String orderId, java.lang.String shipGrp)
-
PackingSession
public PackingSession(LocalDispatcher dispatcher, GenericValue userLogin, java.lang.String facilityId)
-
PackingSession
public PackingSession(LocalDispatcher dispatcher, GenericValue userLogin)
-
-
Method Detail
-
addOrIncreaseLine
public void addOrIncreaseLine(java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId, java.lang.String productId, java.math.BigDecimal quantity, int packageSeqId, java.math.BigDecimal weight, boolean update) throws GeneralException
- Throws:
GeneralException
-
addOrIncreaseLine
public void addOrIncreaseLine(java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId, java.math.BigDecimal quantity, int packageSeqId) throws GeneralException
- Throws:
GeneralException
-
addOrIncreaseLine
public void addOrIncreaseLine(java.lang.String productId, java.math.BigDecimal quantity, int packageSeqId) throws GeneralException
- Throws:
GeneralException
-
findLine
public PackingSessionLine findLine(java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId, java.lang.String productId, java.lang.String inventoryItemId, int packageSeq)
-
createPackLineItem
protected void createPackLineItem(int checkCode, GenericValue res, java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId, java.lang.String productId, java.math.BigDecimal quantity, java.math.BigDecimal weight, int packageSeqId) throws GeneralException
- Throws:
GeneralException
-
findOrderItemSeqId
protected java.lang.String findOrderItemSeqId(java.lang.String productId, java.lang.String orderId, java.lang.String shipGroupSeqId, java.math.BigDecimal quantity) throws GeneralException
- Throws:
GeneralException
-
checkLineForAdd
protected int checkLineForAdd(GenericValue res, java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId, java.lang.String productId, java.math.BigDecimal quantity, int packageSeqId, boolean update)
-
addItemInfo
public void addItemInfo(java.util.List<GenericValue> infos)
-
getItemInfos
public java.util.List<org.apache.ofbiz.shipment.packing.PackingSession.ItemDisplay> getItemInfos()
-
getPackingSessionLinesByPackage
public java.util.Map<java.lang.Object,java.lang.Object> getPackingSessionLinesByPackage()
Delivers all the packing lines grouped by package.
Output map:- packageMap - a Map of type
Map<Integer, List<PackingSessionLine>>
that maps package sequence ids to the lines that belong in that package - sortedKeys - a List of type List<Integer> with the sorted package sequence numbers to index the packageMap
- Returns:
- result Map with packageMap and sortedKeys
- packageMap - a Map of type
-
clearItemInfos
public void clearItemInfos()
-
getShipmentId
public java.lang.String getShipmentId()
-
getLines
public java.util.List<PackingSessionLine> getLines()
-
nextPackageSeq
public int nextPackageSeq()
-
getCurrentPackageSeq
public int getCurrentPackageSeq()
-
getPackedQuantity
public java.math.BigDecimal getPackedQuantity(java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId, java.lang.String productId)
-
getPackedQuantity
public java.math.BigDecimal getPackedQuantity(java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId, java.lang.String productId, int packageSeq)
-
getPackedQuantity
public java.math.BigDecimal getPackedQuantity(java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId, java.lang.String productId, java.lang.String inventoryItemId, int packageSeq)
-
getPackedQuantity
public java.math.BigDecimal getPackedQuantity(java.lang.String productId, int packageSeq)
-
getPackedQuantity
public java.math.BigDecimal getPackedQuantity(int packageSeq)
-
getPackedQuantity
public java.math.BigDecimal getPackedQuantity(java.lang.String productId)
-
getCurrentReservedQuantity
public java.math.BigDecimal getCurrentReservedQuantity(java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId, java.lang.String productId)
-
getCurrentShippedQuantity
public java.math.BigDecimal getCurrentShippedQuantity(java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId)
-
getCurrentShipmentIds
public java.util.List<java.lang.String> getCurrentShipmentIds(java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId)
-
getCurrentShipmentIds
public java.util.List<java.lang.String> getCurrentShipmentIds(java.lang.String orderId, java.lang.String shipGroupSeqId)
-
registerEvent
public void registerEvent(PackingEvent event)
-
getDispatcher
public LocalDispatcher getDispatcher()
-
getDelegator
public Delegator getDelegator()
-
getUserLogin
public GenericValue getUserLogin()
-
getStatus
public int getStatus()
-
getFacilityId
public java.lang.String getFacilityId()
-
setFacilityId
public void setFacilityId(java.lang.String facilityId)
-
getPrimaryOrderId
public java.lang.String getPrimaryOrderId()
-
setPrimaryOrderId
public void setPrimaryOrderId(java.lang.String orderId)
-
getPrimaryShipGroupSeqId
public java.lang.String getPrimaryShipGroupSeqId()
-
setPrimaryShipGroupSeqId
public void setPrimaryShipGroupSeqId(java.lang.String shipGroupSeqId)
-
setPicklistBinId
public void setPicklistBinId(java.lang.String binId)
-
getPicklistBinId
public java.lang.String getPicklistBinId()
-
getHandlingInstructions
public java.lang.String getHandlingInstructions()
-
setHandlingInstructions
public void setHandlingInstructions(java.lang.String instructions)
-
setPickerPartyId
public void setPickerPartyId(java.lang.String partyId)
-
getPickerPartyId
public java.lang.String getPickerPartyId()
-
clearLastPackage
public int clearLastPackage()
-
clearLine
public void clearLine(PackingSessionLine line)
-
clearAllLines
public void clearAllLines()
-
clear
public void clear()
-
complete
public java.lang.String complete(boolean force) throws GeneralException
- Throws:
GeneralException
-
checkReservations
protected void checkReservations(boolean ignore) throws GeneralException
- Throws:
GeneralException
-
checkEmptyLines
protected void checkEmptyLines() throws GeneralException
- Throws:
GeneralException
-
runEvents
protected void runEvents(int eventCode)
-
getItemIssuances
protected java.util.List<GenericValue> getItemIssuances(java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId)
-
createShipment
protected void createShipment() throws GeneralException
- Throws:
GeneralException
-
issueItemsToShipment
protected void issueItemsToShipment() throws GeneralException
- Throws:
GeneralException
-
checkLine
protected boolean checkLine(java.util.List<PackingSessionLine> processedLines, PackingSessionLine line)
-
createPackages
protected void createPackages() throws GeneralException
- Throws:
GeneralException
-
applyItemsToPackages
protected void applyItemsToPackages() throws GeneralException
- Throws:
GeneralException
-
updateShipmentRouteSegments
protected void updateShipmentRouteSegments() throws GeneralException
- Throws:
GeneralException
-
setShipmentToPacked
protected void setShipmentToPacked() throws GeneralException
- Throws:
GeneralException
-
setPicklistToPicked
protected void setPicklistToPicked() throws GeneralException
- Throws:
GeneralException
-
setPickerOnPicklist
protected void setPickerOnPicklist() throws GeneralException
- Throws:
GeneralException
-
getAdditionalShippingCharge
public java.math.BigDecimal getAdditionalShippingCharge()
-
setAdditionalShippingCharge
public void setAdditionalShippingCharge(java.math.BigDecimal additionalShippingCharge)
-
getTotalWeight
public java.math.BigDecimal getTotalWeight()
-
getShipmentCostEstimate
public java.math.BigDecimal getShipmentCostEstimate(GenericValue orderItemShipGroup, java.lang.String productStoreId, java.util.List<GenericValue> shippableItemInfo, java.math.BigDecimal shippableTotal, java.math.BigDecimal shippableWeight, java.math.BigDecimal shippableQuantity)
-
getShipmentCostEstimate
public java.math.BigDecimal getShipmentCostEstimate(GenericValue orderItemShipGroup, java.lang.String productStoreId)
-
getShipmentCostEstimate
public java.math.BigDecimal getShipmentCostEstimate(java.lang.String shippingContactMechId, java.lang.String shipmentMethodTypeId, java.lang.String carrierPartyId, java.lang.String carrierRoleTypeId, java.lang.String productStoreId, java.util.List<GenericValue> shippableItemInfo, java.math.BigDecimal shippableTotal, java.math.BigDecimal shippableWeight, java.math.BigDecimal shippableQuantity)
-
getWeightUomId
public java.lang.String getWeightUomId()
-
setWeightUomId
public void setWeightUomId(java.lang.String weightUomId)
-
setShipmentBoxTypeId
public void setShipmentBoxTypeId(java.lang.String shipmentBoxTypeId)
-
getPackageSeqIds
public java.util.List<java.lang.Integer> getPackageSeqIds()
-
setPackageWeight
public void setPackageWeight(int packageSeqId, java.math.BigDecimal packageWeight)
-
getPackageWeight
public java.math.BigDecimal getPackageWeight(int packageSeqId)
-
addToPackageWeight
public void addToPackageWeight(int packageSeqId, java.math.BigDecimal weight)
-
setShipmentBoxType
public void setShipmentBoxType(int packageSeqId, java.lang.String shipmentBoxType)
-
getShipmentBoxType
public java.lang.String getShipmentBoxType(int packageSeqId)
-
-