public class PromotionEngineOrderCalculateCmdImpl extends ControllerCommandImpl implements OrderCalculateCmd
Name | Description |
---|---|
orderId | The reference number of the order to be displayed. If this parameter is omitted, this command behaves as if all of the customer's orders with the specified status for the specified store were specified. Abbreviations may be used, but only with pending orders (status is P for standard orders or NEW for advanced orders). This parameter can be repeated. |
calculationUsageId | Predefined codes for calculation of discounts (-1), shipping (-2), sales tax (-3), shipping tax (-4), coupons (-5), surcharge (-6), shipping adjustment (-7). This parameter can be repeated. |
outOrderName | Specifies the names of name-value pairs to be passed to a JSP. The value of each added name-value pair is the reference number of the order to be displayed. If the name is not provided, the default name orderId is used. This parameter can be repeated. |
calculationUsageId | Predefined codes for calculation of discounts (-1), shipping (-2), sales tax (-3), shipping tax (-4), coupons (-5), surcharge (-6), shipping adjustment (-7). This parameter can be repeated. |
updatePrices | This flag indicates whether the prices of order items will be refreshed in this command. If the value of the flag is set to "0" (default value), then the prices will not be refreshed. If the value of the flag is set to "1", then the prices will be updated. |
keepAutoAddedOrderItemsBeforeCalculate | This flag indicates whether the freegift item should be kept in the order before calculating discounts. If the value of the flag is "0" (default value), the freegift item will be removed before calculating discounts and then re-added. If the value of the flag is "1", the freegift item will be kept as is. |
Name | Description |
---|---|
istrOutOrderNames | the order IDs to be displayed |
outOfInventoryCatalogEntryId | the catalog entrys which are intended to add to the order as freegift but has no inventory now. |
nonBuyableCatalogEntryId | the catalog entrys which are intended to add to the order as freegift but are non-buyable now. |
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
The IBM copyright notice field.
|
Constructor and Description |
---|
PromotionEngineOrderCalculateCmdImpl()
Constructor for PromotionEngineOrderCalculateCmdImpl.
|
Modifier and Type | Method and Description |
---|---|
protected void | addCatalogEntriesToOrder(OrderAccessBean aabOrder, java.util.Map mapCatalogEntryQuantitiesToAdd)
This method calls OrderItemAddCmd to add the specified Map of CatalogEntries and their quantities to the specified Order.
|
protected void | copyFreeGiftAttributes(java.lang.String[] targetItemIds, java.util.ArrayList originalAutoAddedOrderItems)
This method is to copy the attributes of the original free gift to the new free gift item.
|
protected java.util.Map | getCatalogEntryQuantitiesToAdd(OrderAccessBean aabOrder, java.util.HashMap ahshCustomProperties)
This method invokes Promotion Engine and returns the CatalogEntries to add to the Order and their quantities.
|
java.util.HashMap | getCustomProperties()
This method returns the customer properties.
|
protected java.util.Map | getFreebies(Adjustment[] adjustments)
This method returns the freebies in the specified adjustments.
|
protected OrderItemAccessBean[] | getOrderItems(OrderAccessBean aabOrder)
This method returns the OrderItems of the specified Order.
|
protected OrderAccessBean[] | getOrders()
This method returns the Orders specified to be processed by this command.
|
java.lang.Long[] | getOutOfInventoryCatalogEntryIds()
This method returns the CatalogEntry identifiers of catalog items that could not be added to the Order due to insufficient inventory.
|
protected java.util.Set | getOutOfInventoryCatalogEntryIds(java.util.Map mapCatalogEntryQuantitiesToAdd)
This method returns a Set of CatalogEntryIds that are out of inventory in the specified Map of freebies ( CatalogEntries/quantities )
|
protected boolean | getRemoveOutOfInventoryFreeGift()
Get the settings for if out-of-inventory free gifts should be removed from cart.
|
AccessVector | getResources()
This method returns an AccessVector containing the OrderAccessBeans to be processed.
|
protected java.util.Date | getTime()
This method returns appropriate date.
|
protected java.lang.Integer[] | getUsageIds()
This method returns the CalculationUsages specified to be recalculated by this command.
|
protected PromotionArgument | invokePromotionEngine(java.lang.String template, java.lang.Long orderId, boolean discardPreviousResult, boolean saveCurrentResult, java.util.Hashtable nameValuePair)
This method returns the PromotionArgument as a result of invoking the Promotions Engine.
|
void | performExecute()
This method executes the main business logic of the command implementation.
|
protected OrderItemAccessBean[] | removeAutoAddedOrderItems(OrderItemAccessBean[] abOrderItems)
This method removes the auto-added order items.
|
void | reset()
This method resets instance variables to their initial values.
|
void | setCustomProperties(java.util.HashMap newhshCustomProperties)
This method sets the customer properties.
|
void | setOrders(OrderAccessBean[] aabOrders)
This method sets the orders to be calculated.
|
protected void | setOutOfInventoryCatalogEntryIds(java.lang.Long[] anOutOfInventoryCatalogEntryIds)
This method sets the CatalogEntries that are out of inventory.
|
void | setRequestProperties(TypedProperty aRequestProperties)
This method sets the request properties to the command.
|
protected void | setResponseProperties()
This method sets the response properties:
For each name that was specified by the outOrderName request property, add a response property with that name.
|
void | setUsageIds(java.lang.Integer[] anUsageIds)
This method sets the calculation usage ids.
|
protected void | updateOrderItemProductTotal(OrderItemAccessBean aabOrderItem, java.lang.String astrCurrency)
This method updates the product total of the specified OrderItem.
|
protected void | updateOrderProductTotal(OrderAccessBean aabOrder, OrderItemAccessBean[] aabOrderItems)
This method calls ResolveOrderItemPriceCmd to calculate prices and update the product total of the specified Order and OrderItems.
|
void | validateParameters()
This method calls ResolveOrdersCmd to resolve the orders to be processed from the request.
|
public static final java.lang.String COPYRIGHT
public PromotionEngineOrderCalculateCmdImpl()
public void performExecute() throws ECException
protected java.util.Map getCatalogEntryQuantitiesToAdd(OrderAccessBean aabOrder, java.util.HashMap ahshCustomProperties) throws ECException
public void setOrders(OrderAccessBean[] aabOrders)
public void setUsageIds(java.lang.Integer[] anUsageIds)
protected void setOutOfInventoryCatalogEntryIds(java.lang.Long[] anOutOfInventoryCatalogEntryIds)
public void setCustomProperties(java.util.HashMap newhshCustomProperties)
protected OrderAccessBean[] getOrders()
protected java.lang.Integer[] getUsageIds()
public java.lang.Long[] getOutOfInventoryCatalogEntryIds()
public java.util.HashMap getCustomProperties()
public void setRequestProperties(TypedProperty aRequestProperties) throws ECException
protected OrderItemAccessBean[] getOrderItems(OrderAccessBean aabOrder) throws ECException
protected PromotionArgument invokePromotionEngine(java.lang.String template, java.lang.Long orderId, boolean discardPreviousResult, boolean saveCurrentResult, java.util.Hashtable nameValuePair) throws ECException
protected java.util.Map getFreebies(Adjustment[] adjustments) throws ECSystemException
protected java.util.Set getOutOfInventoryCatalogEntryIds(java.util.Map mapCatalogEntryQuantitiesToAdd) throws ECException
protected void addCatalogEntriesToOrder(OrderAccessBean aabOrder, java.util.Map mapCatalogEntryQuantitiesToAdd) throws ECException
protected void updateOrderItemProductTotal(OrderItemAccessBean aabOrderItem, java.lang.String astrCurrency) throws ECException
protected void updateOrderProductTotal(OrderAccessBean aabOrder, OrderItemAccessBean[] aabOrderItems) throws ECException
public void validateParameters() throws ECException
public AccessVector getResources() throws ECException
protected void setResponseProperties() throws ECException
public void reset()
protected java.util.Date getTime()
protected OrderItemAccessBean[] removeAutoAddedOrderItems(OrderItemAccessBean[] abOrderItems) throws ECException
protected void copyFreeGiftAttributes(java.lang.String[] targetItemIds, java.util.ArrayList originalAutoAddedOrderItems) throws ECException
protected boolean getRemoveOutOfInventoryFreeGift() throws ECException