com.ibm.commerce.orderitems.commands

Class ResolveOrderItemPriceCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, ResolveOrderItemPriceCmd, 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 ResolveOrderItemPriceCmdImpl
    extends TaskCommandImpl
    implements ResolveOrderItemPriceCmd
    This is implementation of the ResolveOrderItemPriceCmd task command.

    Behavior:

    This command calculates the best price for the input OrderItems. It calls GetContractUnitPriceCmd/GetContractSpecialPriceCmd task command to calculate the price. If GetContractUnitPriceCmd/GetContractSpecialPriceCmd is not available, it calls GetBaseUnitPriceCmd/GetBaseSpecialPriceCmd.

    If input trading agreements and/or offers are specified, they will be used providing they are valid. Otherwise, eligible trading agreements will be obtained.

    If price has been obtained previously, the price will be refreshed according to the Price Refresh Flag (PRICEREFFLAGS) in STORE as follows:

    0: Default, same as 1 except that it will not save the trading ID and the offer ID.

    1: This means useCurrentOnly. This uses the prices directly referenced by the OrderItems. Fail if they can no longer be used.

    2: This means useCurrentOrSearchAgain. This is the same as useCurrentOnly, but when they can no longer be used, it not failed. It searches the ones that were originally searched when the OrderItems were created or updated with new trading IDs or offer IDs specified.

    4: This means alwaysSearchAgain. This option always searches the prices that were originally searched when the OrderItems were created or updated with new trading IDs or offer IDs specified.

    8: Before calling price command, sum the quantity for the OrderItems with same catentry. It will resolve the best price and update the OrderItem offerId and tradingId. It will not save the tradingId and offerId in the table ORDITRD and ORDIOFFER.

    AccessBeans utilized:

    See Also:
    Serialized Form
    • Constructor Detail

      • ResolveOrderItemPriceCmdImpl

        public ResolveOrderItemPriceCmdImpl()
    • Method Detail

      • getUpdatedOrderItems

        public java.util.Vector getUpdatedOrderItems()
        This method returns the order items that are actually re-priced
        Specified by:
        getUpdatedOrderItems in interface ResolveOrderItemPriceCmd
        Returns:
        the vector of the updated order items access beans
      • setForceRefresh

        public void setForceRefresh(boolean forceRefresh)
        This method sets the flag forceRefresh, if true, all the order items needs to be refresh even if it's just refreshed
        Specified by:
        setForceRefresh in interface ResolveOrderItemPriceCmd
        Parameters:
        forceRefresh - the boolean value of the flag
      • setIsUnitPriceCommand

        public void setIsUnitPriceCommand(boolean unitPrice)
        This method sets the corresponding Price interface to invoke
        Specified by:
        setIsUnitPriceCommand in interface ResolveOrderItemPriceCmd
        Parameters:
        unitPrice - the boolean value to indicate which interface to invoke if true, GetContractUnitPriceCmd is invoked, else GetContractSpecialPriceCmd is invoked
      • getMapConfigurationIdIn

        public java.util.Map getMapConfigurationIdIn()
        This method returns the configuration IDs passed in for the order items
        Returns:
        <(String)orderItemId, (String)configurationId>
      • setOrderItemConfigurationIdIn

        public void setOrderItemConfigurationIdIn(java.util.Map mapConfigurationId)
        This method sets the configuration IDs passed in for the order items
        Specified by:
        setOrderItemConfigurationIdIn in interface ResolveOrderItemPriceCmd
        Parameters:
        mapConfigurationId - the hash map of the configuration IDs: <(String)orderItemId, (String)configurationId>
      • getOrderItems

        public java.util.Vector getOrderItems()
        This method returns the order items that needs to be re-priced
        Returns:
        orderItems the vector of the order item access beans
      • setOrderItems

        public void setOrderItems(java.util.Vector orderItems)
        This method sets the order items that needs to be re-priced
        Specified by:
        setOrderItems in interface ResolveOrderItemPriceCmd
        Parameters:
        orderItems - the vector of the order item access beans
      • setOrder

        public void setOrder(OrderAccessBean oab)
        This method passes in the Order Access Bean that the order items belong to. If the order items are not set, get all the order items in this order to resolve price.
        Specified by:
        setOrder in interface ResolveOrderItemPriceCmd
        Parameters:
        oab - the order access bean to be passed in.
      • setDoPrice

        public void setDoPrice(boolean doPrice)
        This method sets the flag of doPrice, if false, some of the order items might skip re-pricing if just refreshed before
        Specified by:
        setDoPrice in interface ResolveOrderItemPriceCmd
        Parameters:
        doPrice - the boolean value of the flag
      • getDoPrice

        public boolean getDoPrice()
        This method returns the flag of doPrice, if false, some of the order items might skip re-pricing if just refreshed before
        Returns:
        the boolean value of the flag
      • getOrderItemTradingIdsIn

        public java.util.Map getOrderItemTradingIdsIn()
        This method returns the trading IDs passed in for the order items
        Returns:
        trading the hash map of the trading IDs: <(String)orderItemId, (Long[])tradingIds>
      • setOrderItemTradingIdsIn

        public void setOrderItemTradingIdsIn(java.util.Map trading)
        This method sets the trading IDs passed in for the order items
        Specified by:
        setOrderItemTradingIdsIn in interface ResolveOrderItemPriceCmd
        Parameters:
        trading - the hash map of the trading IDs: <(String)orderItemId, (Long[])tradingIds>
      • getOrderItemOfferIdsIn

        public java.util.Map getOrderItemOfferIdsIn()
        This method returns the offer IDs passed in for the order items
        Returns:
        the hash map of the offer IDs: <(String)orderItemId, (Long[])offerIds>
      • getCatEntryTradings

        public java.util.Map getCatEntryTradings()
        This method returns trading IDs as per catalog entry id
        Returns:
        the hash map of the catalog entry IDs and trading IDs: <(String)catEntryId, (Long[])tradingIdsIn>
      • setCatEntryTradings

        public void setCatEntryTradings(java.util.Map catEntryTradings)
        This method sets the catalog entry id and trading IDs
        Parameters:
        catEntryTradings - <(String)catEntryId, (Long[])tradingIdsIn>
      • getGroupByCatEntry

        public java.util.Map getGroupByCatEntry()
        This method returns the catEntryPricesGroup as per catEntryPricesGroupKey(catalog entry id and trading IDs)
        Returns:
        the hash map of catEntryPricesGroup: <(CatEntryPricesGroupKey)catEntryPricesGroupKey, (catEntryPricesGroup)catEntryPricesGroup>
      • setGroupByCatEntry

        public void setGroupByCatEntry(java.util.Map groupByCatEntry)
        This method sets the catEntryPricesGroup as per catEntryPricesGroupKey(catalog entry id and trading IDs)
        Parameters:
        groupByCatEntry - <(CatEntryPricesGroupKey)catEntryPricesGroupKey, (catEntryPricesGroup)catEntryPricesGroup>
      • getGroupByTrading

        public java.util.Map getGroupByTrading()
        This method returns the catEntryPricesGroup as per catEntryPricesGroupKey(trading IDs)
        Returns:
        the hash map of catEntryPricesGroup: <(CatEntryPricesGroupKey)catEntryPricesGroupKey, (catEntryPricesGroup)catEntryPricesGroup>
      • setGroupByTrading

        public void setGroupByTrading(java.util.Map groupByTrading)
        This method sets the catEntryPricesGroup as per catEntryPricesGroupKey(trading IDs)
        Parameters:
        groupByTrading - <(CatEntryPricesGroupKey)catEntryPricesGroupKey, (catEntryPricesGroup)catEntryPricesGroup>
      • setOrderItemOfferIdsIn

        public void setOrderItemOfferIdsIn(java.util.Map offer)
        This method sets the offer IDs passed in for the order items
        Specified by:
        setOrderItemOfferIdsIn in interface ResolveOrderItemPriceCmd
        Parameters:
        offer - the hash map of the offer IDs: <(String)orderItemId, (Long[])offerIds>
      • getCurrency

        public java.lang.String getCurrency()
        This method returns the currency that the order items need to be re-priced on
        Returns:
        currency
      • setCurrency

        public void setCurrency(java.lang.String currency)
        This method sets the currency that the order items need to be re-priced on
        Specified by:
        setCurrency in interface ResolveOrderItemPriceCmd
        Parameters:
        currency -
      • setOIComponents

        public void setOIComponents(java.util.Hashtable oiComps)
        This method sets the order item components of a dynamic kit that needs to refresh price.
        Specified by:
        setOIComponents in interface ResolveOrderItemPriceCmd
        Parameters:
        oiComps - the vector of the order item components access beans
      • reset

        public void reset()
        This method resets instance variables to their initial values.
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand