public class ResolveOrderItemPriceCmdImpl extends TaskCommandImpl implements ResolveOrderItemPriceCmd
ResolveOrderItemPriceCmd
task command. 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.
defaultCommandClassName, NAME
Constructor and Description |
---|
ResolveOrderItemPriceCmdImpl() |
Modifier and Type | Method and Description |
---|---|
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
|
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
|
java.util.Vector |
getUpdatedOrderItems()
This method returns the order items that are actually re-priced
|
void |
performExecute()
This method performs the main business logic of the command.
|
void |
reset()
This method resets instance variables to their initial values.
|
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
|
void |
validateParameters()
This method verifies the input parameters.
|
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
public void validateParameters() throws ECException
validateParameters
in interface ECCommand
validateParameters
in class AbstractECTargetableCommand
ECException
public java.util.Vector getUpdatedOrderItems()
getUpdatedOrderItems
in interface ResolveOrderItemPriceCmd
public void setForceRefresh(boolean forceRefresh)
setForceRefresh
in interface ResolveOrderItemPriceCmd
forceRefresh
- the boolean value of the flagpublic void setIsUnitPriceCommand(boolean unitPrice)
setIsUnitPriceCommand
in interface ResolveOrderItemPriceCmd
unitPrice
- the boolean value to indicate which interface to invoke
if true, GetContractUnitPriceCmd
is invoked, else
GetContractSpecialPriceCmd
is invokedpublic java.util.Map getMapConfigurationIdIn()
public void setOrderItemConfigurationIdIn(java.util.Map mapConfigurationId)
setOrderItemConfigurationIdIn
in interface ResolveOrderItemPriceCmd
mapConfigurationId
- the hash map of the configuration IDs:
<(String)orderItemId, (String)configurationId>public java.util.Vector getOrderItems()
public void setOrderItems(java.util.Vector orderItems)
setOrderItems
in interface ResolveOrderItemPriceCmd
orderItems
- the vector of the order item access beanspublic void setOrder(OrderAccessBean oab)
setOrder
in interface ResolveOrderItemPriceCmd
oab
- the order access bean to be passed in.public void setDoPrice(boolean doPrice)
setDoPrice
in interface ResolveOrderItemPriceCmd
doPrice
- the boolean value of the flagpublic boolean getDoPrice()
public java.util.Map getOrderItemTradingIdsIn()
public void setOrderItemTradingIdsIn(java.util.Map trading)
setOrderItemTradingIdsIn
in interface ResolveOrderItemPriceCmd
trading
- the hash map of the trading IDs:
<(String)orderItemId, (Long[])tradingIds>public java.util.Map getOrderItemOfferIdsIn()
public java.util.Map getCatEntryTradings()
public void setCatEntryTradings(java.util.Map catEntryTradings)
catEntryTradings
- <(String)catEntryId, (Long[])tradingIdsIn>public java.util.Map getGroupByCatEntry()
public void setGroupByCatEntry(java.util.Map groupByCatEntry)
groupByCatEntry
- <(CatEntryPricesGroupKey)catEntryPricesGroupKey, (catEntryPricesGroup)catEntryPricesGroup>public java.util.Map getGroupByTrading()
public void setGroupByTrading(java.util.Map groupByTrading)
groupByTrading
- <(CatEntryPricesGroupKey)catEntryPricesGroupKey, (catEntryPricesGroup)catEntryPricesGroup>public void setOrderItemOfferIdsIn(java.util.Map offer)
setOrderItemOfferIdsIn
in interface ResolveOrderItemPriceCmd
offer
- the hash map of the offer IDs:
<(String)orderItemId, (Long[])offerIds>public java.lang.String getCurrency()
public void setCurrency(java.lang.String currency)
setCurrency
in interface ResolveOrderItemPriceCmd
currency
- public void setOIComponents(java.util.Hashtable oiComps)
setOIComponents
in interface ResolveOrderItemPriceCmd
oiComps
- the vector of the order item components access beanspublic void performExecute() throws ECException
performExecute
in interface ECCommand
performExecute
in interface com.ibm.websphere.command.TargetableCommand
performExecute
in class AbstractECTargetableCommand
ECException
public void reset()
reset
in interface com.ibm.websphere.command.Command
reset
in class AbstractECTargetableCommand