com.ibm.commerce.inventory.commands
Class GeneratePickBatchCmdImpl
java.lang.Object
CacheableCommandImpl
com.ibm.commerce.command.AbstractECTargetableCommand
com.ibm.commerce.command.TaskCommandImpl
com.ibm.commerce.inventory.commands.GeneratePickBatchCmdImpl
- All Implemented Interfaces:
- ECCommand, ECTargetableCommand, GeneratePickBatchCmd, TaskCommand
- public class GeneratePickBatchCmdImpl
- extends TaskCommandImpl
- implements GeneratePickBatchCmd
Default implementation of the GeneratePickBatchCmd interface. Generates a pick batch for specified fulfillment center and store.
This is a task command.
The order releases with 'SHIP' status for the specified fulfillment center and store will be included in the pick batch generation. If there are more than the maximum number of eligible order releases when a pick batch is generated, only the maximum number of order releases are picked up in this pick batch and the rest will be picked up by the next pick batch generation. A pack slip XML will be generated for each eligible order release and a pick ticket XML will be generated for the whole batch. An invoice XML may also be generated for each eligible order release.
Uses the following access beans:
- InventoryJDBCHelperAccessBean
- UserAccessBean
- PickBatchAccessBean
- StoreEntityDescriptionAccessBean
- FulfillmentCenterDescriptionAccessBean
- OrderReleaseAccessBean
- OrderItemAccessBean
- OrderAccessBean
- TradingAgreementAccessBean
- TermConditionAccessBean
- InvoiceTCAccessBean
- ShippingModeDescriptionAccessBean
- AddressAccessBean
- BaseItemDescriptionAccessBean
- CatalogEntryDescriptionAccessBean
- CurrencyAccessBean
- See Also:
- Serialized Form
Field Summary |
static java.lang.String |
COPYRIGHT
The internal copyright field. |
Method Summary |
java.lang.String |
generatePackslip(java.lang.String pickBatchId, java.lang.String store_name, java.lang.String ffmcenter_name, java.lang.String order_number, java.lang.String release_number, java.lang.String customer_number, java.lang.String order_date)
Generates the pack slip XML for an order release. |
void |
generatePickbatch(int maxOrderReleases)
generate a pick batch with no delay for select how age orders |
void |
generatePickbatch(int maxOrderReleases, int delayInMins)
Performs the generation of pick batch if there are any eligible order releases. |
java.lang.String |
generatePickticket(java.lang.String pickBatchId, java.lang.String store_name, java.lang.String ffmcenter_name)
Generates the pick ticket XML for the whole batch. |
java.lang.Integer |
getFfmcenterId()
Returns fulfillment center identifier. |
java.lang.Integer |
getLanguageId()
Returns language identifier. |
int |
getMaxOrdReleasesPerPickbatch()
Returns the maximum number of order releases included in a pick batch. |
java.lang.String |
getMoreOrderReleases()
Returns the flag to indicate if there are more eligible order releases not included in this pick batch. |
java.lang.Long |
getPickBatchId()
Returns the pick batch identifier. |
java.lang.Integer |
getStoreentId()
Returns the store entity identidier. |
boolean |
isReadyToCallExecute()
This command is ready to be executed. |
void |
performExecute()
Pulls the MaxOrdReleasesPerPickbatch |
void |
reset()
Resets the command local variable. |
void |
setFfmcenterId(java.lang.Integer newFfmcenterId)
Sets fulfillment center identifier. |
void |
setLanguageId(java.lang.Integer newLanguageId)
Sets language identifier. |
void |
setMaxOrdReleasesPerPickbatch(int newMaxOrdReleasesPerPickbatch)
Sets the maximum number of order releases included in a pick batch. |
void |
setMoreOrderReleases(java.lang.String newMoreOrderReleases)
Set the moreOrderReleases flag to indicate if there are more eligible order releases not included in this pick batch. |
void |
setPickBatchId(java.lang.Long newPickBatchId)
Sets the pick batch identifier. |
void |
setRequestProperties(TypedProperty newRequestProperties)
Pulls fulfillment center identifier from the input paramater and saves locally. |
void |
setStoreentId(java.lang.Integer newStoreentId)
Sets the store entity identifier. |
void |
validateParameters()
Checks the information needed for pick batch generation. |
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand |
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
COPYRIGHT
public static final java.lang.String COPYRIGHT
- The internal copyright field.
- See Also:
- Constant Field Values
GeneratePickBatchCmdImpl
public GeneratePickBatchCmdImpl()
getFfmcenterId
public java.lang.Integer getFfmcenterId()
- Description copied from interface: GeneratePickBatchCmd
- Returns fulfillment center identifier.
-
- Specified by:
- getFfmcenterId in interface GeneratePickBatchCmd
-
- Returns:
- Fulfillment center identifier.
- See Also:
- GeneratePickBatchCmd.getFfmcenterId(), setFfmcenterId(java.lang.Integer)
getLanguageId
public java.lang.Integer getLanguageId()
- Description copied from interface: GeneratePickBatchCmd
- Returns language identifier.
-
- Specified by:
- getLanguageId in interface GeneratePickBatchCmd
-
- Returns:
- Language identifier.
- See Also:
- GeneratePickBatchCmd.getLanguageId(), setLanguageId(java.lang.Integer)
getMaxOrdReleasesPerPickbatch
public int getMaxOrdReleasesPerPickbatch()
- Description copied from interface: GeneratePickBatchCmd
- Returns the maximum number of order releases included in a pick batch.
-
- Specified by:
- getMaxOrdReleasesPerPickbatch in interface GeneratePickBatchCmd
-
- Returns:
- Number of maximum allowed releases for this pick batch.
- See Also:
- GeneratePickBatchCmd.getMaxOrdReleasesPerPickbatch(), setMaxOrdReleasesPerPickbatch(int)
getMoreOrderReleases
public java.lang.String getMoreOrderReleases()
- Description copied from interface: GeneratePickBatchCmd
- Returns the flag to indicate if there are more eligible order releases not included in this pick batch.
-
- Specified by:
- getMoreOrderReleases in interface GeneratePickBatchCmd
-
- Returns:
- Flag to determine if there are more abailable releases.
- See Also:
- GeneratePickBatchCmd.getMoreOrderReleases(), setMoreOrderReleases(java.lang.String)
getPickBatchId
public java.lang.Long getPickBatchId()
- Description copied from interface: GeneratePickBatchCmd
- Returns the pick batch identifier.
-
- Specified by:
- getPickBatchId in interface GeneratePickBatchCmd
-
- Returns:
- Pick batch identifier.
- See Also:
- GeneratePickBatchCmd.getPickBatchId(), setPickBatchId(java.lang.Long)
getStoreentId
public java.lang.Integer getStoreentId()
- Description copied from interface: GeneratePickBatchCmd
- Returns the store entity identidier.
-
- Specified by:
- getStoreentId in interface GeneratePickBatchCmd
-
- Returns:
- Store entity identifier.
- See Also:
- GeneratePickBatchCmd.getStoreentId(), setStoreentId(java.lang.Integer)
setFfmcenterId
public void setFfmcenterId(java.lang.Integer newFfmcenterId)
- Description copied from interface: GeneratePickBatchCmd
- Sets fulfillment center identifier.
-
- Specified by:
- setFfmcenterId in interface GeneratePickBatchCmd
-
- Parameters:
- newFfmcenterId - fulfillment center identifier
- See Also:
- GeneratePickBatchCmd.setFfmcenterId(java.lang.Integer), getFfmcenterId()
setLanguageId
public void setLanguageId(java.lang.Integer newLanguageId)
- Description copied from interface: GeneratePickBatchCmd
- Sets language identifier.
-
- Specified by:
- setLanguageId in interface GeneratePickBatchCmd
-
- Parameters:
- newLanguageId - language identifier
- See Also:
- GeneratePickBatchCmd.setLanguageId(java.lang.Integer), getLanguageId()
setMaxOrdReleasesPerPickbatch
public void setMaxOrdReleasesPerPickbatch(int newMaxOrdReleasesPerPickbatch)
- Description copied from interface: GeneratePickBatchCmd
- Sets the maximum number of order releases included in a pick batch.
-
- Specified by:
- setMaxOrdReleasesPerPickbatch in interface GeneratePickBatchCmd
-
- Parameters:
- newMaxOrdReleasesPerPickbatch - maximum number of order releases
- See Also:
- GeneratePickBatchCmd.setMaxOrdReleasesPerPickbatch(int), getMaxOrdReleasesPerPickbatch()
setMoreOrderReleases
public void setMoreOrderReleases(java.lang.String newMoreOrderReleases)
- Set the moreOrderReleases flag to indicate if there are more eligible order releases not included in this pick batch. Values are "Yes" and "No"
-
- Specified by:
- setMoreOrderReleases in interface GeneratePickBatchCmd
-
- Parameters:
- newMoreOrderReleases - flag
- See Also:
- GeneratePickBatchCmd.setMoreOrderReleases(java.lang.String), getMoreOrderReleases()
setPickBatchId
public void setPickBatchId(java.lang.Long newPickBatchId)
- Description copied from interface: GeneratePickBatchCmd
- Sets the pick batch identifier.
-
- Specified by:
- setPickBatchId in interface GeneratePickBatchCmd
-
- Parameters:
- newPickBatchId - pick batch identifier
- See Also:
- GeneratePickBatchCmd.setPickBatchId(java.lang.Long), setPickBatchId(java.lang.Long)
setStoreentId
public void setStoreentId(java.lang.Integer newStoreentId)
- Description copied from interface: GeneratePickBatchCmd
- Sets the store entity identifier.
-
- Specified by:
- setStoreentId in interface GeneratePickBatchCmd
-
- Parameters:
- newStoreentId - store entity identifier
- See Also:
- GeneratePickBatchCmd.setStoreentId(java.lang.Integer), getStoreentId()
setRequestProperties
public void setRequestProperties(TypedProperty newRequestProperties)
throws ECApplicationException
- Pulls fulfillment center identifier from the input paramater and saves locally.
-
- Specified by:
- setRequestProperties in interface GeneratePickBatchCmd
-
- Parameters:
- newRequestProperties - request properties
- Throws:
- ECApplicationException
- See Also:
- setFfmcenterId(java.lang.Integer), GeneratePickBatchCmd.setRequestProperties(com.ibm.commerce.datatype.TypedProperty)
isReadyToCallExecute
public boolean isReadyToCallExecute()
- This command is ready to be executed.
-
- Overrides:
- isReadyToCallExecute in class AbstractECTargetableCommand
-
- Returns:
- Always true.
validateParameters
public void validateParameters()
throws ECException
- Checks the information needed for pick batch generation.
StoreId and language id must be set in the command context.
Also checking that fulfillment center id is not null.
-
- Specified by:
- validateParameters in interface ECCommand
- Overrides:
- validateParameters in class AbstractECTargetableCommand
-
- Throws:
- ECApplicationException - If mandatory parameters are not set, throw ECApplicationException.
- ECException
performExecute
public void performExecute()
throws ECException
- Pulls the MaxOrdReleasesPerPickbatchgeneratePickBatch() method to complete.
-
- Specified by:
- performExecute in interface ECCommand
- Overrides:
- performExecute in class AbstractECTargetableCommand
-
- Throws:
- ECException - If the MaxOrderReleasesPerPickbatch does not convert to a numeric, error specifies _ERR_CMD_INVALID_PARAM
- See Also:
- generatePickbatch(int)
generatePickbatch
public void generatePickbatch(int maxOrderReleases)
throws ECException
- generate a pick batch with no delay for select how age orders
-
- Parameters:
- maxOrderReleases - maximum number of order releases in a pick batch
- Throws:
- ECException -
- ECSystemException Naming error, _ERR_CREATE_EXCEPTION
- ECSystemException Finder error, _ERR_FINDER_EXCEPTION
- ECSystemException Naming error, _ERR_NAMING_EXCEPTION
- ECSystemException Remote error, _ERR_REMOTE_EXCEPTION
- See Also:
- #generatePickBatch(int,int)
generatePickbatch
public void generatePickbatch(int maxOrderReleases,
int delayInMins)
throws ECException
- Performs the generation of pick batch if there are any eligible order releases. The order releases with 'SHIP' status for the specified fulfillment center and store will be included in the pick batch. If there are more than the maximum number of eligible order releases when a pick batch is generated, only the maximum number of order releases are picked up in this pick batch and the rest will be picked up by the next pick batch generation. A pack slip XML will be generated by calling generatePackslip() method and an invoice XML may be prepared for each eligible order release. A pick ticket XML will be generated for the whole batch by calling generatePickticket() method.
Here is the flow of events, highlighting the use of access beans, commands and other methods.
- InventoryJDBCHelperAccessBean.findReadyToBeShippedReleaseListByStoreentIdAndFfmcenterId
- UserAccessBean to get member id.
- PickBatchAccessBean to insert a new row specifying member id and fulfillment center and generate a pick batch identifier.
- Calls setPickBatchId method.
- StoreEntityDescriptionAccessBean to retrieve store display name.
- FulfillmentCenterDescriptionAccessBean to retrieve fulfilment center name.
- Calls generatePackslip method for each order release.
- Updates OrderReleaseAccessBean with pack slip object.
- Calls PrepareInvoiceCmd.
- Calls generatePickticket method.
- Updates PickBatchAccessBean with pick batch object.
-
- Parameters:
- maxOrderReleases - maximum number of order releases in a pick batch
- delayInMins - number of minutes the past to use as a criteria for selecting orders in a pick batch orders.timeplaced < current time - delayInMins minutes
- Throws:
- ECException -
- ECSystemException Naming error, _ERR_CREATE_EXCEPTION
- ECSystemException Finder error, _ERR_FINDER_EXCEPTION
- ECSystemException Naming error, _ERR_NAMING_EXCEPTION
- ECSystemException Remote error, _ERR_REMOTE_EXCEPTION
- See Also:
- generatePackslip(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String), generatePickticket(java.lang.String, java.lang.String, java.lang.String), setPickBatchId(java.lang.Long)
generatePackslip
public java.lang.String generatePackslip(java.lang.String pickBatchId,
java.lang.String store_name,
java.lang.String ffmcenter_name,
java.lang.String order_number,
java.lang.String release_number,
java.lang.String customer_number,
java.lang.String order_date)
throws ECException
- Generates the pack slip XML for an order release.
- Uses OrderItemAccessBean and OrderAccessBean to check if InvoiceTC exists in Terms and Condition table. Proceed only if InvoiceTC is present.
- Then uses TradingAgreementAccessBean and InvoiceTCAccessBean to get the invoice delivery method.
- Gets shipping provider. Use InventoryJDBCHelperAccessBean() .findReleaseShipmodeIdByOrdersIdAndOrdreleaseNum to get the ship mode id.
- Gets the shipping provider name using ShippingModeDescriptionAccessBean.
- Gets ship to address using InventoryJDBCHelperAccessBean() .findReleaseAddressIdByOrdersIdAndOrdreleaseNum.
- Creates the XML output.
- Gets the list of order items, using InventoryJDBCHelperAccessBean() .findPackslipItemsListByOrdersIdAndOrdreleaseNum.
- Uses BaseItemDescriptionAccessBean to get the product description.
- Uses CatalogEntryDescriptionAccessBean to get the catalog entry description.
- Gets the component list for a dynamic or static kit using InventoryJDBCHelperAccessBean() .findPackslipComponentsListByOrderItemsId.
- Finalizes the XML output.
-
- Parameters:
- pickBatchId - pick batch identifier
- store_name - store entity name
- ffmcenter_name - fulfillment center name
- order_number - order number
- release_number - release number
- customer_number - customer number
- order_date - order date
- Returns:
- Pack slip XML for an order release.
- Throws:
- ECException -
- ECSystemException Naming error, _ERR_CREATE_EXCEPTION
- ECSystemException Finder error, _ERR_FINDER_EXCEPTION
- ECSystemException Naming error, _ERR_NAMING_EXCEPTION
- ECSystemException Remote error, _ERR_REMOTE_EXCEPTION
generatePickticket
public java.lang.String generatePickticket(java.lang.String pickBatchId,
java.lang.String store_name,
java.lang.String ffmcenter_name)
throws ECException
- Generates the pick ticket XML for the whole batch. Uses InventoryJDBCHelperAccessBean().findPickItemsListByPickbatchId to get the list of items and some of the descriptive information, partnum and quantity. Also uses BaseItemDescriptionAccessBean to retrieve the short and long item descriptions.
-
- Parameters:
- pickBatchId - pick batch identifier
- store_name - store name
- ffmcenter_name - fulfillment center name
- Returns:
- Pick ticket XML.
- Throws:
- ECException -
- ECSystemException Naming error, _ERR_CREATE_EXCEPTION
- ECSystemException Finder error, _ERR_FINDER_EXCEPTION
- ECSystemException Naming error, _ERR_NAMING_EXCEPTION
- ECSystemException Remote error, _ERR_REMOTE_EXCEPTION
reset
public void reset()
- Resets the command local variable.
-
- Overrides:
- reset in class AbstractECTargetableCommand
Feedback
(C) Copyright IBM Corporation 1996, 2005. All Rights Reserved.