java.lang.Object | +--CacheableCommandImpl | +--com.ibm.commerce.command.AbstractECTargetableCommand | +--com.ibm.commerce.command.TaskCommandImpl | +--com.ibm.commerce.command.BusinessPolicyCommandImpl | +--com.ibm.commerce.order.calculation.CalculationCmdImpl | +--com.ibm.commerce.couponredemption.commands.CalculateDiscountAmtCmdImpl
The purpose of the task command is to computes the discount amount for each eCoupon that satisfy the purchase order conditions of the of the eCoupon.
First the orderItems for a order are found out and for each cpwalletId,
corresponding promoId is found out from the
CouponWalletAccessBean
. The corresponding calcodeId are found out
from PromoDiscAccessBean
by using the obtained promoId. A mapping
is computed between OrderItemAccessBean
(corresponding to the
items qualified for this cpwalletId) and the Categorized MonetaryAmount(Set to
zero). The task command CalculationCodeCalculate
command with
usage type as eCoupons and the mapping created above are called and the
discount amounts are stored in TempCouponItemMapAccessBean
. These
above steps are performed for each cpwalletId.
Field Summary | |
---|---|
protected
java.util.Vector[] |
appItems The nth element of this array contains the IDs of applicable items for the nth coupon. |
protected
java.lang.Long[] |
bcIds The IDs of the coupons to be applied to this order |
protected
java.lang.Long |
orderId ID of the order |
protected
CommandContext |
processingContext The command context holder |
protected
TypedProperty |
reqProp The request properties |
protected
java.util.Hashtable |
returnTable This tables stores the discount amounts computed by this command. |
protected
TypedProperty |
rspProp The response properties |
Fields inherited from class com.ibm.commerce.order.calculation. CalculationCmdImpl |
COPYRIGHT |
Fields inherited from class com.ibm.commerce.command. BusinessPolicyCommandImpl |
policyId,
requestProperties |
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
commandContext |
Fields inherited from interface com.ibm.commerce.couponredemption.commands. CalculateDiscountAmtCmd |
COPYRIGHT,
defaultCommandClassName,
Name |
Fields inherited from interface com.ibm.commerce.order.calculation. CalculationCmd |
NAME |
Fields inherited from interface com.ibm.commerce.command. ECCommand |
defaultCommandClassName |
Constructor Summary | |
---|---|
CalculateDiscountAmtCmdImpl() CouponDSSCmdImpl constructor, call super. |
Method Summary | |
---|---|
boolean |
checkParentCatEntryIds(java.lang.Long oiCatEntryId,
java.lang.Long walletCatEntryId) Checks the parent catalog entry. |
java.util.Vector[] |
getAppItems() Gets the applicable items. |
static java.lang.String |
getIClassName() Gets the class name. |
java.lang.Long |
getOrderId() Gets the orderId. |
CommandContext |
getProcessingContext() Gets the processing context. |
TypedProperty |
getReqProp() Gets request properties. |
TypedProperty |
getResponseProperties() Gets the response properties. |
java.util.Hashtable |
getReturnTable() Gets the return table. |
TypedProperty |
getRspProp() Gets the response properties. |
boolean |
isReadyToCallExecute() It always returns true. |
void |
performExecute() First the orderItems for a order are found out and for each cpwalletId, corresponding promoId is found out from the CouponWalletAccessBean . |
void |
setAppItems(java.util.Vector[] newAppItems) Sets the applied items. |
void |
setBcIds(java.lang.Long[] paramBcIds) Sets the eCouponIds. |
void |
setOrderId(java.lang.Long newOrderId) Sets the order IDs. |
void |
setProcessingContext(
CommandContext newProcessingContext) Sets the processing context. |
void |
setReqProp(
TypedProperty newReqProp) Sets the request properties. |
void |
setRequestProperties(
TypedProperty paramReqProp) Sets the request properties. |
void |
setReturnTable(java.util.Hashtable newReturnTable) Sets the return table. |
void |
setRspProp(
TypedProperty newRspProp) Sets the responce properties. |
Methods inherited from class com.ibm.commerce.order.calculation. CalculationCmdImpl |
createCommand,
getCurrency,
getCustomProperties,
getCustomProperty,
getTimestamp,
getUsageId,
reset,
setCurrency,
setCustomProperties,
setCustomProperty,
setTimestamp,
setUsageId |
Methods inherited from class com.ibm.commerce.command. BusinessPolicyCommandImpl |
getPolicyId,
getRequestProperties,
setPolicyId |
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
accessControlCheck,
checkIsAllowed,
checkParameters,
checkResourcePermission,
createCommandExecutionEvent,
execute,
finalize,
getAccCheck,
getCommandContext,
getCommandIfName,
getCommandName,
getCommandStoreId,
getDefaultProperties,
getResources,
getStoreId,
getUser,
getUserId,
setAccCheck,
setCommandContext,
setCommandIfName,
setCommandStoreId,
setDefaultProperties,
validateParameters |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait,
wait, wait |
Methods inherited from interface com.ibm.commerce.command. BusinessPolicyCommand |
getPolicyId,
getRequestProperties,
setPolicyId |
Field Detail |
---|
protected java.lang.Long[] bcIds
protected java.lang.Long orderId
protected CommandContext processingContext
protected TypedProperty reqProp
protected TypedProperty rspProp
protected java.util.Vector[] appItems
protected java.util.Hashtable returnTable
Constructor Detail |
---|
public CalculateDiscountAmtCmdImpl()
Method Detail |
---|
public boolean checkParentCatEntryIds(java.lang.Long oiCatEntryId, java.lang.Long walletCatEntryId) throws ECSystemException
oiCatEntryId
- The child catalog entry ID.walletCatEntryId
- The parent catalog entry ID.
ECSystemException
public java.util.Vector[] getAppItems()
public static final java.lang.String getIClassName()
public java.lang.Long getOrderId()
public CommandContext getProcessingContext()
public TypedProperty getReqProp()
public TypedProperty getResponseProperties()
getResponseProperties
in interface
CalculateDiscountAmtCmd
public java.util.Hashtable getReturnTable()
getReturnTable
in interface
CalculateDiscountAmtCmd
public TypedProperty getRspProp()
getRspProp
in interface
CalculateDiscountAmtCmd
public boolean isReadyToCallExecute()
isReadyToCallExecute
in class
AbstractECTargetableCommand
public void performExecute() throws ECException
First the orderItems for a order are found out and for each cpwalletId,
corresponding promoId is found out from the
CouponWalletAccessBean
. The corresponding calcodeId are found out
from PromoDiscAccessBean
by using the obtained promoId. A mapping
is computed between OrderItemAccessBean
(corresponding to the
items qualified for this cpwalletId) and the Categorized MonetaryAmount(Set to
zero). The task command CalculationCodeCalculate
command with
usage type as eCoupons and the mapping created above are called and the
discount amounts are stored in TempCouponItemMapAccessBean
. These
above steps are performed for each cpwalletId.
performExecute
in interface
ECCommand
performExecute
in class
AbstractECTargetableCommand
ECException
public void setAppItems(java.util.Vector[] newAppItems)
setAppItems
in interface
CalculateDiscountAmtCmd
newAppItems
- the applicable items to be
set.public void setBcIds(java.lang.Long[] paramBcIds)
setBcIds
in interface
CalculateDiscountAmtCmd
paramBcIds
- the couponIds to be used on this
order.public void setOrderId(java.lang.Long newOrderId)
setOrderId
in interface
CalculateDiscountAmtCmd
newOrderId
- the orderIdpublic void setProcessingContext(CommandContext newProcessingContext)
setProcessingContext
in interface
CalculateDiscountAmtCmd
newProcessingContext
- the new command context to be
used.public void setReqProp(TypedProperty newReqProp)
setReqProp
in interface
CalculateDiscountAmtCmd
newReqProp
- the new request propertiespublic void setRequestProperties(TypedProperty paramReqProp)
setRequestProperties
in interface
CalculateDiscountAmtCmd
setRequestProperties
in class
BusinessPolicyCommandImpl
paramReqProp
- the new request propertiespublic void setReturnTable(java.util.Hashtable newReturnTable)
newReturnTable
- the hashtable containing discount
informationpublic void setRspProp(TypedProperty newRspProp)
newRspProp
- the new response properties