public class ResolveOrderItemPriceCmdImpl extends TaskCommandImpl implements ResolveOrderItemPriceCmd
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.
Constructor and Description |
---|
ResolveOrderItemPriceCmdImpl() |
Modifier and Type | Method and Description |
---|---|
protected void | checkPriceNeedRefresh()
This method checks all the order items passed in this command to see whether it needs to refresh price again.
|
java.util.Map | getCatEntryTradings()
This method returns trading IDs as per catalog entry id
|
java.lang.String | getCurrency()
This method returns the currency that the order items need to be re-priced on
|
boolean | getDoPrice()
This method returns the flag of doPrice, if false, some of the order items might skip re-pricing if just refreshed before
|
java.util.Map | getGroupByCatEntry()
This method returns the catEntryPricesGroup as per catEntryPricesGroupKey(catalog entry id and trading IDs)
|
java.util.Map | getGroupByTrading()
This method returns the catEntryPricesGroup as per catEntryPricesGroupKey(trading IDs)
|
java.util.Map | getMapConfigurationIdIn()
This method returns the configuration IDs passed in for the order items
|
protected java.lang.Long[] | getOfferIdsIn(java.lang.String orderItemId)
This method returns the offer IDs passed in for the specified order item
|
java.util.Map | getOrderItemOfferIdsIn()
This method returns the offer IDs passed in for the order items
|
java.util.Vector | getOrderItems()
This method returns the order items that needs to be re-priced
|
java.util.Map | getOrderItemTradingIdsIn()
This method returns the trading IDs passed in for the order items
|
protected int | getRefreshFlag()
This method returns the store price refresh flags
|
protected java.lang.Long[] | getTradingIdsIn(java.lang.String orderItemId)
This method returns the trading IDs passed in for the specified order item
|
java.util.Vector | getUpdatedOrderItems()
This method returns the order items that are actually re-priced
|
protected void | handleBatchCatEntryPrice()
This method updates price for the order items in batch by calling Price command just once.
|
protected void | handleDynamicKitPrice(OrderItemAccessBean orderitemAB)
This method refreshes price for the order item that is a dynamic kit.
|
protected void | handleNullPriceException(OrderItemAccessBean abOrderItem)
This method handles the exception when price is null for the order item.
|
protected void | handleSingleCatEntryPrice(OrderItemAccessBean orderitemAB, java.lang.Long[] offerIds, java.lang.Long[] retryOfferIds, java.lang.Long[] tradingIds, java.lang.Long[] retryTradingIds)
This method updates price for the specified order item.
|
protected boolean | isOptimizedPath()
This method is used to check whether this command is configured to be executed in optimized path.
|
void | performExecute()
This method performs the main business logic of the command.
|
protected boolean | quoteIsStillGood(OrderItemAccessBean orderitemAB)
This method checks whether the specified order item is updated within the duration specified in STORE.QUOTEGOODFOR
|
void | reset()
This method resets instance variables to their initial values.
|
protected java.lang.Long[] | retrieveOfferIds(OrderItemAccessBean orderitemAB)
This method retrieves the offer IDs for the specified order item, which is to be set to the Price command.
|
protected java.lang.Long[] | retrieveRetryOfferIds(OrderItemAccessBean orderitemAB)
This method retrieves the retry offer IDs for the specified order item, which is to be set to the Price command in the second time
|
protected java.lang.Long[] | retrieveRetryTradingIds(OrderItemAccessBean orderitemAB)
This method retrieves the retry trading IDs for the specified order item, which is to be set to the Price command in the second time.
|
protected java.lang.Long[] | retrieveTradingIds(OrderItemAccessBean orderitemAB)
This method retrieves the trading IDs for the specified order item, which is to be set to the Price command.
|
void | setCatEntryTradings(java.util.Map catEntryTradings)
This method sets the catalog entry id and trading IDs
|
void | setCurrency(java.lang.String currency)
This method sets the currency that the order items need to be re-priced on
|
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
|
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
|
void | setGroupByCatEntry(java.util.Map groupByCatEntry)
This method sets the catEntryPricesGroup as per catEntryPricesGroupKey(catalog entry id and trading IDs)
|
void | setGroupByTrading(java.util.Map groupByTrading)
This method sets the catEntryPricesGroup as per catEntryPricesGroupKey(trading IDs)
|
void | setIsUnitPriceCommand(boolean unitPrice)
This method sets the corresponding Price interface to invoke
|
void | setOIComponents(java.util.Hashtable oiComps)
This method sets the order item components of a dynamic kit that needs to refresh price.
|
void | setOrder(OrderAccessBean oab)
This method passes in the Order Access Bean that the order items belong to.
|
void | setOrderItemConfigurationIdIn(java.util.Map mapConfigurationId)
This method sets the configuration IDs passed in for the order items
|
void | setOrderItemOfferIdsIn(java.util.Map offer)
This method sets the offer IDs passed in for the order items
|
void | setOrderItems(java.util.Vector orderItems)
This method sets the order items that needs to be re-priced
|
void | setOrderItemTradingIdsIn(java.util.Map trading)
This method sets the trading IDs passed in for the order items
|
protected boolean | skipPricing(OrderItemAccessBean orderitemAB)
This method checks whether the order item can skip the pricing.
|
protected void | updateOrderItemPrice(java.lang.Long nOfferId, java.lang.Long nTradingId, java.lang.Long nTermConditionId, MonetaryAmount basePrice, MonetaryAmount unitPrice, OrderItemAccessBean[] orderitemABs)
This method is used to update the price of order item
|
protected void | updateOrderItemTotalProduct(OrderItemAccessBean abOrderItem)
This method calculates and updates the total product for the specified order item.
|
protected void | updateOrderItemTrading(OrderItemAccessBean orderitemAB, java.lang.Long nTradingId)
This method updates the contract for the specified order item.
|
protected void | updateOrderTotalProduct()
This method calculates and updates the total product for the whole order.
|
void | validateParameters()
This method verifies the input parameters.
|
public void validateParameters() throws ECException
public java.util.Vector getUpdatedOrderItems()
public void setForceRefresh(boolean forceRefresh)
public void setIsUnitPriceCommand(boolean unitPrice)
public java.util.Map getMapConfigurationIdIn()
public void setOrderItemConfigurationIdIn(java.util.Map mapConfigurationId)
public java.util.Vector getOrderItems()
public void setOrderItems(java.util.Vector orderItems)
public void setOrder(OrderAccessBean oab)
public void setDoPrice(boolean doPrice)
public boolean getDoPrice()
public java.util.Map getOrderItemTradingIdsIn()
public void setOrderItemTradingIdsIn(java.util.Map trading)
public java.util.Map getOrderItemOfferIdsIn()
public java.util.Map getCatEntryTradings()
public void setCatEntryTradings(java.util.Map catEntryTradings)
public java.util.Map getGroupByCatEntry()
public void setGroupByCatEntry(java.util.Map groupByCatEntry)
public java.util.Map getGroupByTrading()
public void setGroupByTrading(java.util.Map groupByTrading)
public void setOrderItemOfferIdsIn(java.util.Map offer)
public java.lang.String getCurrency()
public void setCurrency(java.lang.String currency)
public void setOIComponents(java.util.Hashtable oiComps)
protected java.lang.Long[] getTradingIdsIn(java.lang.String orderItemId)
protected java.lang.Long[] getOfferIdsIn(java.lang.String orderItemId)
protected int getRefreshFlag()
public void performExecute() throws ECException
protected boolean skipPricing(OrderItemAccessBean orderitemAB) throws ECException
protected void handleBatchCatEntryPrice() throws ECException
protected void updateOrderItemPrice(java.lang.Long nOfferId, java.lang.Long nTradingId, java.lang.Long nTermConditionId, MonetaryAmount basePrice, MonetaryAmount unitPrice, OrderItemAccessBean[] orderitemABs) throws ECException
protected void handleNullPriceException(OrderItemAccessBean abOrderItem) throws ECException
protected void handleSingleCatEntryPrice(OrderItemAccessBean orderitemAB, java.lang.Long[] offerIds, java.lang.Long[] retryOfferIds, java.lang.Long[] tradingIds, java.lang.Long[] retryTradingIds) throws ECException
protected void updateOrderItemTrading(OrderItemAccessBean orderitemAB, java.lang.Long nTradingId) throws ECSystemException
protected void updateOrderItemTotalProduct(OrderItemAccessBean abOrderItem) throws ECException
protected void updateOrderTotalProduct() throws ECException
protected void handleDynamicKitPrice(OrderItemAccessBean orderitemAB) throws ECException
protected void checkPriceNeedRefresh() throws ECException
protected boolean quoteIsStillGood(OrderItemAccessBean orderitemAB) throws ECException
protected java.lang.Long[] retrieveOfferIds(OrderItemAccessBean orderitemAB) throws ECException
protected java.lang.Long[] retrieveTradingIds(OrderItemAccessBean orderitemAB) throws ECException
protected java.lang.Long[] retrieveRetryTradingIds(OrderItemAccessBean orderitemAB) throws ECException
protected java.lang.Long[] retrieveRetryOfferIds(OrderItemAccessBean orderitemAB) throws ECException
public void reset()
protected boolean isOptimizedPath() throws ECException