com.ibm.commerce.inventory.commands

Class GeneratePackSlipCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, GeneratePackSlipCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    public class GeneratePackSlipCmdImpl
    extends TaskCommandImpl
    implements GeneratePackSlipCmd
    This is the default implementation of the GeneratePackSlipCmd task command.

    Behavior:

    • The pack slip is generated by pick batch for each specified order release.
    • The pack slip is organized by all eligible items,which are order,orderItem,ship address and release charge.
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        The IBM Copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • GeneratePackSlipCmdImpl

        public GeneratePackSlipCmdImpl()
    • Method Detail

      • setFfmcenterId

        public void setFfmcenterId(java.lang.Integer newFfmcenterId)
        This method sets fulfillment center identifier.
        Specified by:
        setFfmcenterId in interface GeneratePackSlipCmd
        Parameters:
        newFfmcenterId - fulfillment center id
        See Also:
        getFfmcenterId()
      • setLanguageId

        public void setLanguageId(java.lang.Integer newLanguageId)
        This method sets language identifier.
        Specified by:
        setLanguageId in interface GeneratePackSlipCmd
        Parameters:
        newLanguageId - language id
        See Also:
        getLanguageId()
      • setPickBatchId

        public void setPickBatchId(java.lang.String newPickBatchId)
        This method sets the pick batch identifier.
        Specified by:
        setPickBatchId in interface GeneratePackSlipCmd
        Parameters:
        newPickBatchId - pick batch id
        See Also:
        getPickBatchId()
      • setStoreentId

        public void setStoreentId(java.lang.Integer newStoreentId)
        This method sets the store entity identifier.
        Specified by:
        setStoreentId in interface GeneratePackSlipCmd
        Parameters:
        newStoreentId - store id
        See Also:
        getStoreentId()
      • getPickSlipData

        public java.util.HashMap getPickSlipData()
        This method returns the pack slip data
        Specified by:
        getPickSlipData in interface GeneratePackSlipCmd
        Returns:
        HashMap of pack slip data (PackSlipEntry instances)
      • validateParameters

        public void validateParameters()
                                throws ECException
        This method checks the information needed for pick slip 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:
        ECException - If mandatory parameters are not set, throw ECApplicationException.
      • reset

        public void reset()
        This method resets command state
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand
      • generatePackslip

        public java.lang.String generatePackslip(java.lang.String argPickBatchId,
                                                 java.lang.String argStoreName,
                                                 java.lang.String argFfmcenterName,
                                                 java.lang.String argOrderNumber,
                                                 java.lang.String argReleaseNumber,
                                                 java.lang.String argCustomerNumber,
                                                 java.lang.String argOrderDate)
                                          throws ECException
        This method 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:
        argPickBatchId - pick batch identifier
        argStoreName - store entity name
        argFfmcenterName - fulfillment center name
        argOrderNumber - order number
        argReleaseNumber - release number
        argCustomerNumber - customer number
        argOrderDate - 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
      • generatePackslip

        public java.lang.String generatePackslip()
                                          throws ECException
        This method generates the pack slip xml.
        Returns:
        the pack slip xml as a string
        Throws:
        ECException - for failures
      • getFfmcenterName

        public java.lang.String getFfmcenterName()
        This method returns the ffmcenterName.
        Returns:
        String
      • getStoreName

        public java.lang.String getStoreName()
        This method returns the storeName.
        Returns:
        String
      • setFfmcenterName

        public void setFfmcenterName(java.lang.String affmcenterName)
        This method sets the ffmcenterName.
        Parameters:
        affmcenterName - the ffmcenterName to set
      • setStoreName

        public void setStoreName(java.lang.String astoreName)
        This method sets the storeName.
        Parameters:
        astoreName - the storeName to set
      • getRequestProperties

        public TypedProperty getRequestProperties()
        This method returns the ihshRequestProperties.
        Returns:
        TypedProperty
      • getCustomerNumber

        public java.lang.String getCustomerNumber()
        This method returns the customerNumber.
        Returns:
        String
      • getOrderDate

        public java.lang.String getOrderDate()
        This method returns the orderDate.
        Returns:
        String
      • getReleaseNumber

        public java.lang.String getReleaseNumber()
        This method returns the releaseNumber.
        Specified by:
        getReleaseNumber in interface GeneratePackSlipCmd
        Returns:
        String
      • setCustomerNumber

        public void setCustomerNumber(java.lang.String acustomerNumber)
        This method sets the customerNumber.
        Parameters:
        acustomerNumber - the customerNumber to set
      • setOrderDate

        public void setOrderDate(java.lang.String anorderDate)
        This method sets the orderDate.
        Parameters:
        anorderDate - the orderDate to set
      • setReleaseNumber

        public void setReleaseNumber(java.lang.String areleaseNumber)
        This method sets the releaseNumber.
        Parameters:
        areleaseNumber - the releaseNumber to set
      • getBaseItemID

        public java.lang.Long getBaseItemID()
        This method returns the baseItemID.
        Specified by:
        getBaseItemID in interface GeneratePackSlipCmd
        Returns:
        Long
      • getOrderedQuantity

        public java.lang.Double getOrderedQuantity()
        This method returns the orderedQuantity.
        Specified by:
        getOrderedQuantity in interface GeneratePackSlipCmd
        Returns:
        Double
      • setBaseItemID

        public void setBaseItemID(java.lang.Long abaseItemID)
        This method sets the baseItemID.
        Parameters:
        abaseItemID - the baseItemID to set
      • setOrderedQuantity

        public void setOrderedQuantity(java.lang.Double anorderedQuantity)
        This method sets the orderedQuantity.
        Parameters:
        anorderedQuantity - the orderedQuantity to set
      • getLongDescription

        public java.lang.String getLongDescription()
        This method returns the longDescription.
        Specified by:
        getLongDescription in interface GeneratePackSlipCmd
        Returns:
        String
      • getShortDescription

        public java.lang.String getShortDescription()
        This method returns the shortDescription.
        Specified by:
        getShortDescription in interface GeneratePackSlipCmd
        Returns:
        String
      • getOrderItemId

        public java.lang.String getOrderItemId()
        This method returns the orderItemId
        Returns:
        orderItemId
      • setLongDescription

        public void setLongDescription(java.lang.String alongDescription)
        This method sets the longDescription.
        Parameters:
        alongDescription - the longDescription to set
      • setShortDescription

        public void setShortDescription(java.lang.String ashortDescription)
        This method sets the shortDescription.
        Parameters:
        ashortDescription - the shortDescription to set
      • generateXMLForNestedKit

        public void generateXMLForNestedKit(com.ibm.commerce.order.utils.NestedKitNode rootNode,
                                            java.io.PrintWriter output)
                                     throws ECException
        This method is top-level call to generate XML for the NestedKit tree
        Parameters:
        rootNode - instance of NestedKitNode class
        output - instance of PrintWriter class
        Throws:
        ECException
      • traverseNestedKit

        public void traverseNestedKit(com.ibm.commerce.order.utils.NestedKitNode node,
                                      int treeLevel,
                                      java.io.PrintWriter output)
                               throws ECException
        This method is recursive call that traverses through the nodes of the NestedKit tree
        Parameters:
        node - instance of NestedKitNode class
        treeLevel - the Integer number
        output - instance of PrintWriter class
        Throws:
        ECException
      • generateXMLForKitComponent

        public void generateXMLForKitComponent(com.ibm.commerce.order.utils.DynamicKitComponent component,
                                               int treeLevel,
                                               java.io.PrintWriter output)
                                        throws ECException
        This method generates the XML for a specified KitComponent node in the Nested Kit tree
        Parameters:
        component - instance of DynamicKitComponent class
        treeLevel - the Integer number
        output - instance of PrintWriter class
        Throws:
        ECException
      • generateXMLToCloseSubTree

        public void generateXMLToCloseSubTree(int treeLevel,
                                              java.io.PrintWriter output)
        The method generates XML to close the subtree tags
        Parameters:
        treeLevel - the Integer number
        output - instance of PrintWriter class