Class PackingSession
java.lang.Object
org.apache.ofbiz.shipment.packing.PackingSession
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
ConstructorDescriptionPackingSession
(LocalDispatcher dispatcher, GenericValue userLogin) Instantiates a new Packing session.PackingSession
(LocalDispatcher dispatcher, GenericValue userLogin, String facilityId) Instantiates a new Packing session.PackingSession
(LocalDispatcher dispatcher, GenericValue userLogin, String facilityId, String binId, String orderId, String shipGrp) Instantiates a new Packing session. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addItemInfo
(List<GenericValue> infos) Add item info.void
addOrIncreaseLine
(String orderId, String orderItemSeqId, String shipGroupSeqId, String productId, BigDecimal quantity, int packageSeqId, BigDecimal weight, boolean update) Add or increase line.void
addOrIncreaseLine
(String orderId, String orderItemSeqId, String shipGroupSeqId, BigDecimal quantity, int packageSeqId) Add or increase line.void
addOrIncreaseLine
(String productId, BigDecimal quantity, int packageSeqId) Add or increase line.void
addToPackageWeight
(int packageSeqId, BigDecimal weight) Add to package weight.protected void
Apply items to packages.protected void
Check empty lines.protected boolean
checkLine
(List<PackingSessionLine> processedLines, PackingSessionLine line) Check line boolean.protected int
checkLineForAdd
(GenericValue res, String orderId, String orderItemSeqId, String shipGroupSeqId, String productId, BigDecimal quantity, int packageSeqId, boolean update) Check line for add int.protected void
checkReservations
(boolean ignore) Check reservations.void
clear()
Clear.void
Clear all lines.void
Clear item infos.int
Clear last package int.void
clearLine
(PackingSessionLine line) Clear line.complete
(boolean force) Complete string.protected void
Create packages.protected void
createPackLineItem
(int checkCode, GenericValue res, String orderId, String orderItemSeqId, String shipGroupSeqId, String productId, BigDecimal quantity, BigDecimal weight, int packageSeqId) Create pack line item.protected void
Create shipment.findLine
(String orderId, String orderItemSeqId, String shipGroupSeqId, String productId, String inventoryItemId, int packageSeq) Find line packing session line.findOrderItemSeqId
(String productId, String orderId, String shipGroupSeqId, BigDecimal quantity) Find order item seq id string.Gets additional shipping charge.int
Gets current package seq.getCurrentReservedQuantity
(String orderId, String orderItemSeqId, String shipGroupSeqId, String productId) Gets current reserved quantity.getCurrentShipmentIds
(String orderId, String shipGroupSeqId) Gets current shipment ids.getCurrentShipmentIds
(String orderId, String orderItemSeqId, String shipGroupSeqId) Gets current shipment ids.getCurrentShippedQuantity
(String orderId, String orderItemSeqId, String shipGroupSeqId) Gets current shipped quantity.Gets delegator.Gets dispatcher.Gets facility id.Gets handling instructions.List<org.apache.ofbiz.shipment.packing.PackingSession.ItemDisplay>
Gets item infos.protected List<GenericValue>
getItemIssuances
(String orderId, String orderItemSeqId, String shipGroupSeqId) Gets item issuances.getLines()
Gets lines.Gets package seq ids.getPackageWeight
(int packageSeqId) Gets package weight.getPackedQuantity
(int packageSeq) Gets packed quantity.getPackedQuantity
(String productId) Gets packed quantity.getPackedQuantity
(String productId, int packageSeq) Gets packed quantity.getPackedQuantity
(String orderId, String orderItemSeqId, String shipGroupSeqId, String productId) Gets packed quantity.getPackedQuantity
(String orderId, String orderItemSeqId, String shipGroupSeqId, String productId, int packageSeq) Gets packed quantity.getPackedQuantity
(String orderId, String orderItemSeqId, String shipGroupSeqId, String productId, String inventoryItemId, int packageSeq) Gets packed quantity.Delivers all the packing lines grouped by package.Gets picker party id.Gets picklist bin id.Gets primary order id.Gets primary ship group seq id.getShipmentBoxType
(int packageSeqId) Gets shipment box type.getShipmentCostEstimate
(String shippingContactMechId, String shipmentMethodTypeId, String carrierPartyId, String carrierRoleTypeId, String productStoreId, List<GenericValue> shippableItemInfo, BigDecimal shippableTotal, BigDecimal shippableWeight, BigDecimal shippableQuantity) Gets shipment cost estimate.getShipmentCostEstimate
(GenericValue orderItemShipGroup, String productStoreId) Gets shipment cost estimate.getShipmentCostEstimate
(GenericValue orderItemShipGroup, String productStoreId, List<GenericValue> shippableItemInfo, BigDecimal shippableTotal, BigDecimal shippableWeight, BigDecimal shippableQuantity) Gets shipment cost estimate.Gets shipment id.int
Gets status.Gets total weight.Gets user login.Gets weight uom id.protected void
Issue items to shipment.int
Next package seq int.void
registerEvent
(PackingEvent event) Register event.protected void
runEvents
(int eventCode) Run events.void
setAdditionalShippingCharge
(BigDecimal additionalShippingCharge) Sets additional shipping charge.void
setFacilityId
(String facilityId) Sets facility id.void
setHandlingInstructions
(String instructions) Sets handling instructions.void
setPackageWeight
(int packageSeqId, BigDecimal packageWeight) Sets package weight.protected void
Sets picker on picklist.void
setPickerPartyId
(String partyId) Sets picker party id.void
setPicklistBinId
(String binId) Sets picklist bin id.protected void
Sets picklist to picked.void
setPrimaryOrderId
(String orderId) Sets primary order id.void
setPrimaryShipGroupSeqId
(String shipGroupSeqId) Sets primary ship group seq id.void
setShipmentBoxType
(int packageSeqId, String shipmentBoxType) Sets shipment box type.protected void
Sets shipment to packed.void
setWeightUomId
(String weightUomId) Sets weight uom id.protected void
Update shipment route segments.
-
Constructor Details
-
PackingSession
public PackingSession(LocalDispatcher dispatcher, GenericValue userLogin, String facilityId, String binId, String orderId, String shipGrp) Instantiates a new Packing session.- Parameters:
dispatcher
- the dispatcheruserLogin
- the user loginfacilityId
- the facility idbinId
- the bin idorderId
- the order idshipGrp
- the ship grp
-
PackingSession
Instantiates a new Packing session.- Parameters:
dispatcher
- the dispatcheruserLogin
- the user loginfacilityId
- the facility id
-
PackingSession
Instantiates a new Packing session.- Parameters:
dispatcher
- the dispatcheruserLogin
- the user login
-
-
Method Details
-
addOrIncreaseLine
public void addOrIncreaseLine(String orderId, String orderItemSeqId, String shipGroupSeqId, String productId, BigDecimal quantity, int packageSeqId, BigDecimal weight, boolean update) throws GeneralException Add or increase line.- Parameters:
orderId
- the order idorderItemSeqId
- the order item seq idshipGroupSeqId
- the ship group seq idproductId
- the product idquantity
- the quantitypackageSeqId
- the package seq idweight
- the weightupdate
- the update- Throws:
GeneralException
- the general exception
-
addOrIncreaseLine
public void addOrIncreaseLine(String orderId, String orderItemSeqId, String shipGroupSeqId, BigDecimal quantity, int packageSeqId) throws GeneralException Add or increase line.- Parameters:
orderId
- the order idorderItemSeqId
- the order item seq idshipGroupSeqId
- the ship group seq idquantity
- the quantitypackageSeqId
- the package seq id- Throws:
GeneralException
- the general exception
-
addOrIncreaseLine
public void addOrIncreaseLine(String productId, BigDecimal quantity, int packageSeqId) throws GeneralException Add or increase line.- Parameters:
productId
- the product idquantity
- the quantitypackageSeqId
- the package seq id- Throws:
GeneralException
- the general exception
-
findLine
public PackingSessionLine findLine(String orderId, String orderItemSeqId, String shipGroupSeqId, String productId, String inventoryItemId, int packageSeq) Find line packing session line.- Parameters:
orderId
- the order idorderItemSeqId
- the order item seq idshipGroupSeqId
- the ship group seq idproductId
- the product idinventoryItemId
- the inventory item idpackageSeq
- the package seq- Returns:
- the packing session line
-
createPackLineItem
protected void createPackLineItem(int checkCode, GenericValue res, String orderId, String orderItemSeqId, String shipGroupSeqId, String productId, BigDecimal quantity, BigDecimal weight, int packageSeqId) throws GeneralException Create pack line item.- Parameters:
checkCode
- the check coderes
- the resorderId
- the order idorderItemSeqId
- the order item seq idshipGroupSeqId
- the ship group seq idproductId
- the product idquantity
- the quantityweight
- the weightpackageSeqId
- the package seq id- Throws:
GeneralException
- the general exception
-
findOrderItemSeqId
protected List<String> findOrderItemSeqId(String productId, String orderId, String shipGroupSeqId, BigDecimal quantity) throws GeneralException Find order item seq id string.- Parameters:
productId
- the product idorderId
- the order idshipGroupSeqId
- the ship group seq idquantity
- the quantity- Returns:
- the string
- Throws:
GeneralException
- the general exception
-
checkLineForAdd
protected int checkLineForAdd(GenericValue res, String orderId, String orderItemSeqId, String shipGroupSeqId, String productId, BigDecimal quantity, int packageSeqId, boolean update) Check line for add int.- Parameters:
res
- the resorderId
- the order idorderItemSeqId
- the order item seq idshipGroupSeqId
- the ship group seq idproductId
- the product idquantity
- the quantitypackageSeqId
- the package seq idupdate
- the update- Returns:
- the int
-
addItemInfo
Add item info.- Parameters:
infos
- the infos
-
getItemInfos
Gets item infos.- Returns:
- the item infos
-
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()Clear item infos. -
getShipmentId
Gets shipment id.- Returns:
- the shipment id
-
getLines
Gets lines.- Returns:
- the lines
-
nextPackageSeq
public int nextPackageSeq()Next package seq int.- Returns:
- the int
-
getCurrentPackageSeq
public int getCurrentPackageSeq()Gets current package seq.- Returns:
- the current package seq
-
getPackedQuantity
public BigDecimal getPackedQuantity(String orderId, String orderItemSeqId, String shipGroupSeqId, String productId) Gets packed quantity.- Parameters:
orderId
- the order idorderItemSeqId
- the order item seq idshipGroupSeqId
- the ship group seq idproductId
- the product id- Returns:
- the packed quantity
-
getPackedQuantity
public BigDecimal getPackedQuantity(String orderId, String orderItemSeqId, String shipGroupSeqId, String productId, int packageSeq) Gets packed quantity.- Parameters:
orderId
- the order idorderItemSeqId
- the order item seq idshipGroupSeqId
- the ship group seq idproductId
- the product idpackageSeq
- the package seq- Returns:
- the packed quantity
-
getPackedQuantity
public BigDecimal getPackedQuantity(String orderId, String orderItemSeqId, String shipGroupSeqId, String productId, String inventoryItemId, int packageSeq) Gets packed quantity.- Parameters:
orderId
- the order idorderItemSeqId
- the order item seq idshipGroupSeqId
- the ship group seq idproductId
- the product idinventoryItemId
- the inventory item idpackageSeq
- the package seq- Returns:
- the packed quantity
-
getPackedQuantity
Gets packed quantity.- Parameters:
productId
- the product idpackageSeq
- the package seq- Returns:
- the packed quantity
-
getPackedQuantity
Gets packed quantity.- Parameters:
packageSeq
- the package seq- Returns:
- the packed quantity
-
getPackedQuantity
Gets packed quantity.- Parameters:
productId
- the product id- Returns:
- the packed quantity
-
getCurrentReservedQuantity
public BigDecimal getCurrentReservedQuantity(String orderId, String orderItemSeqId, String shipGroupSeqId, String productId) Gets current reserved quantity.- Parameters:
orderId
- the order idorderItemSeqId
- the order item seq idshipGroupSeqId
- the ship group seq idproductId
- the product id- Returns:
- the current reserved quantity
-
getCurrentShippedQuantity
public BigDecimal getCurrentShippedQuantity(String orderId, String orderItemSeqId, String shipGroupSeqId) Gets current shipped quantity.- Parameters:
orderId
- the order idorderItemSeqId
- the order item seq idshipGroupSeqId
- the ship group seq id- Returns:
- the current shipped quantity
-
getCurrentShipmentIds
public List<String> getCurrentShipmentIds(String orderId, String orderItemSeqId, String shipGroupSeqId) Gets current shipment ids.- Parameters:
orderId
- the order idorderItemSeqId
- the order item seq idshipGroupSeqId
- the ship group seq id- Returns:
- the current shipment ids
-
getCurrentShipmentIds
Gets current shipment ids.- Parameters:
orderId
- the order idshipGroupSeqId
- the ship group seq id- Returns:
- the current shipment ids
-
registerEvent
Register event.- Parameters:
event
- the event
-
getDispatcher
Gets dispatcher.- Returns:
- the dispatcher
-
getDelegator
Gets delegator.- Returns:
- the delegator
-
getUserLogin
Gets user login.- Returns:
- the user login
-
getStatus
public int getStatus()Gets status.- Returns:
- the status
-
getFacilityId
Gets facility id.- Returns:
- the facility id
-
setFacilityId
Sets facility id.- Parameters:
facilityId
- the facility id
-
getPrimaryOrderId
Gets primary order id.- Returns:
- the primary order id
-
setPrimaryOrderId
Sets primary order id.- Parameters:
orderId
- the order id
-
getPrimaryShipGroupSeqId
Gets primary ship group seq id.- Returns:
- the primary ship group seq id
-
setPrimaryShipGroupSeqId
Sets primary ship group seq id.- Parameters:
shipGroupSeqId
- the ship group seq id
-
setPicklistBinId
Sets picklist bin id.- Parameters:
binId
- the bin id
-
getPicklistBinId
Gets picklist bin id.- Returns:
- the picklist bin id
-
getHandlingInstructions
Gets handling instructions.- Returns:
- the handling instructions
-
setHandlingInstructions
Sets handling instructions.- Parameters:
instructions
- the instructions
-
setPickerPartyId
Sets picker party id.- Parameters:
partyId
- the party id
-
getPickerPartyId
Gets picker party id.- Returns:
- the picker party id
-
clearLastPackage
public int clearLastPackage()Clear last package int.- Returns:
- the int
-
clearLine
Clear line.- Parameters:
line
- the line
-
clearAllLines
public void clearAllLines()Clear all lines. -
clear
public void clear()Clear. -
complete
Complete string.- Parameters:
force
- the force- Returns:
- the string
- Throws:
GeneralException
- the general exception
-
checkReservations
Check reservations.- Parameters:
ignore
- the ignore- Throws:
GeneralException
- the general exception
-
checkEmptyLines
Check empty lines.- Throws:
GeneralException
- the general exception
-
runEvents
protected void runEvents(int eventCode) Run events.- Parameters:
eventCode
- the event code
-
getItemIssuances
protected List<GenericValue> getItemIssuances(String orderId, String orderItemSeqId, String shipGroupSeqId) Gets item issuances.- Parameters:
orderId
- the order idorderItemSeqId
- the order item seq idshipGroupSeqId
- the ship group seq id- Returns:
- the item issuances
-
createShipment
Create shipment.- Throws:
GeneralException
- the general exception
-
issueItemsToShipment
Issue items to shipment.- Throws:
GeneralException
- the general exception
-
checkLine
Check line boolean.- Parameters:
processedLines
- the processed linesline
- the line- Returns:
- the boolean
-
createPackages
Create packages.- Throws:
GeneralException
- the general exception
-
applyItemsToPackages
Apply items to packages.- Throws:
GeneralException
- the general exception
-
updateShipmentRouteSegments
Update shipment route segments.- Throws:
GeneralException
- the general exception
-
setShipmentToPacked
Sets shipment to packed.- Throws:
GeneralException
- the general exception
-
setPicklistToPicked
Sets picklist to picked.- Throws:
GeneralException
- the general exception
-
setPickerOnPicklist
Sets picker on picklist.- Throws:
GeneralException
- the general exception
-
getAdditionalShippingCharge
Gets additional shipping charge.- Returns:
- the additional shipping charge
-
setAdditionalShippingCharge
Sets additional shipping charge.- Parameters:
additionalShippingCharge
- the additional shipping charge
-
getTotalWeight
Gets total weight.- Returns:
- the total weight
-
getShipmentCostEstimate
public BigDecimal getShipmentCostEstimate(GenericValue orderItemShipGroup, String productStoreId, List<GenericValue> shippableItemInfo, BigDecimal shippableTotal, BigDecimal shippableWeight, BigDecimal shippableQuantity) Gets shipment cost estimate.- Parameters:
orderItemShipGroup
- the order item ship groupproductStoreId
- the product store idshippableItemInfo
- the shippable item infoshippableTotal
- the shippable totalshippableWeight
- the shippable weightshippableQuantity
- the shippable quantity- Returns:
- the shipment cost estimate
-
getShipmentCostEstimate
Gets shipment cost estimate.- Parameters:
orderItemShipGroup
- the order item ship groupproductStoreId
- the product store id- Returns:
- the shipment cost estimate
-
getShipmentCostEstimate
public BigDecimal getShipmentCostEstimate(String shippingContactMechId, String shipmentMethodTypeId, String carrierPartyId, String carrierRoleTypeId, String productStoreId, List<GenericValue> shippableItemInfo, BigDecimal shippableTotal, BigDecimal shippableWeight, BigDecimal shippableQuantity) Gets shipment cost estimate.- Parameters:
shippingContactMechId
- the shipping contact mech idshipmentMethodTypeId
- the shipment method type idcarrierPartyId
- the carrier party idcarrierRoleTypeId
- the carrier role type idproductStoreId
- the product store idshippableItemInfo
- the shippable item infoshippableTotal
- the shippable totalshippableWeight
- the shippable weightshippableQuantity
- the shippable quantity- Returns:
- the shipment cost estimate
-
getWeightUomId
Gets weight uom id.- Returns:
- the weight uom id
-
setWeightUomId
Sets weight uom id.- Parameters:
weightUomId
- the weight uom id
-
getPackageSeqIds
Gets package seq ids.- Returns:
- the package seq ids
-
setPackageWeight
Sets package weight.- Parameters:
packageSeqId
- the package seq idpackageWeight
- the package weight
-
getPackageWeight
Gets package weight.- Parameters:
packageSeqId
- the package seq id- Returns:
- the package weight
-
addToPackageWeight
Add to package weight.- Parameters:
packageSeqId
- the package seq idweight
- the weight
-
setShipmentBoxType
Sets shipment box type.- Parameters:
packageSeqId
- the package seq idshipmentBoxType
- the shipment box type
-
getShipmentBoxType
Gets shipment box type.- Parameters:
packageSeqId
- the package seq id- Returns:
- the shipment box type
-