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.ApplyCouponUsageCmdImpl
This task command is called from OrderPrepare command to incorporate the eCoupon discount onto the Adjustments in ORDERS and ORDERITEMS table. The command is invoked when user asks to redeem the eCoupons before preparing order.
The eCoupons which are to be applied to an order are found out from
OrderCouponMapAccessBean
. They are removed from
OrderCouponMapAccessBean
and CouponItemMapAccessBean
.
The eCoupons are checked for expiry by calling
CheckValidityTaskCmd
command. The eCoupons that are not expired
are checked for applicability by calling CheckApplicabilityTaskCmd
command. The CalculateDiscountAmountCmd
task command is called on
the applicable coupons to find the discount amount to be incorporated in the
currect order.
Field Summary | |
---|---|
protected
java.lang.Long |
orderId The ID of the order which is being prepared. |
protected
CommandContext |
processingContext The command context is kept in this. |
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. ApplyCouponUsageCmd |
COPYRIGHT,
defaultCommandClassName,
NAME |
Fields inherited from interface com.ibm.commerce.command. ECCommand |
defaultCommandClassName |
Constructor Summary | |
---|---|
ApplyCouponUsageCmdImpl() Constructor for ApplyCouponUsageCmdImpl call super. |
Method Summary | |
---|---|
protected
void |
callCodeApply(
Group aGroup) This method is called by performExecute() to invoke the CalculationCodeApply calculation method. |
void |
checkAppliedItems() It checks applied items. |
java.util.Set |
getAppliedItems() Gets the applied items. |
protected
Item[] |
getItems() Gets the items. |
java.lang.Long |
getOrderId() Gets the orderId. |
CommandContext |
getProcessingContext() Gets the processing context. |
protected
java.lang.Integer[] |
getTaxCategoryIds() Gets the tax categories. |
void |
insertIntoDB(java.lang.Long orderId,
java.util.Hashtable couponHashtable) It inserts data into database. |
void |
performExecute() The eCoupons which are to be applied to an order are found out from OrderCouponMapAccessBean . |
void |
removeOldEntries() It removes the old entries. |
void |
reset() Sets the various variables to their default values (null). |
void |
setItems(
Item[] aItems) Sets the items. |
void |
setOrderId(java.lang.Long newOrderId) Sets the order IDs. |
void |
setProcessingContext(
CommandContext newProcessingContext) Sets the processing context. |
void |
setTaxCategoryIds(java.lang.Integer[] anTaxCategoryIds) Sets the tax category.. |
void |
validateParameters() Checks the parameters. |
Methods inherited from class com.ibm.commerce.order.calculation. CalculationCmdImpl |
createCommand,
getCurrency,
getCustomProperties,
getCustomProperty,
getTimestamp,
getUsageId,
setCurrency,
setCustomProperties,
setCustomProperty,
setTimestamp,
setUsageId |
Methods inherited from class com.ibm.commerce.command. BusinessPolicyCommandImpl |
getPolicyId,
getRequestProperties,
setPolicyId,
setRequestProperties |
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,
isReadyToCallExecute,
setAccCheck,
setCommandContext,
setCommandIfName,
setCommandStoreId,
setDefaultProperties |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait,
wait, wait |
Methods inherited from interface com.ibm.commerce.order.calculation. CalculationCmd |
getCurrency,
getCustomProperties,
getCustomProperty,
getTimestamp,
getUsageId,
setCurrency,
setCustomProperties,
setCustomProperty,
setTimestamp,
setUsageId |
Methods inherited from interface com.ibm.commerce.command. BusinessPolicyCommand |
getPolicyId,
getRequestProperties,
setPolicyId,
setRequestProperties |
Field Detail |
---|
protected CommandContext processingContext
protected java.lang.Long orderId
Constructor Detail |
---|
public ApplyCouponUsageCmdImpl()
Method Detail |
---|
protected void callCodeApply(Group aGroup) throws ECException
:
- com.ibm.commerce.exception.ECException.ECException
public void checkAppliedItems() throws ECException
checkAppliedItems
in interface
ApplyCalculationUsageCmd
:
- com.ibm.commerce.exception.ECException.ECException
public java.util.Set getAppliedItems()
getAppliedItems
in interface
ApplyCalculationUsageCmd
protected Item[] getItems()
public java.lang.Long getOrderId()
public CommandContext getProcessingContext()
protected java.lang.Integer[] getTaxCategoryIds()
public void insertIntoDB(java.lang.Long orderId, java.util.Hashtable couponHashtable) throws ECSystemException
ECSystemException
public void performExecute() throws ECException
The eCoupons which are to be applied to an order are found out from
OrderCouponMapAccessBean
. They are removed from
OrderCouponMapAccessBean
and CouponItemMapAccessBean
.
The eCoupons are checked for expiry by calling
CheckValidityTaskCmd
command. The eCoupons that are not expired
are checked for applicability by calling CheckApplicabilityTaskCmd
command. The CalculateDiscountAmountCmd
task command is called on
the applicable coupons to find the discount amount to be incorporated in the
currect order.
performExecute
in interface
ECCommand
performExecute
in class
AbstractECTargetableCommand
:
- com.ibm.commerce.exception.ECException.ECException
public void removeOldEntries() throws ECSystemException
:
- com.ibm.commerce.exception.ECException.
ECSystemException
public void reset()
reset
in class
CalculationCmdImpl
com.ibm.websphere.command.Command#reset()
public void setItems(Item[] aItems)
setItems
in interface
ApplyCalculationUsageCmd
aItems
- the items.public void setOrderId(java.lang.Long newOrderId)
newOrderId
- java.lang.Longpublic void setProcessingContext(CommandContext newProcessingContext)
newProcessingContext
-
com.ibm.commerce.command.CommandContextpublic void setTaxCategoryIds(java.lang.Integer[] anTaxCategoryIds)
setTaxCategoryIds
in interface
ApplyCalculationUsageCmd
anTaxCategoryIds
- an Integer.public void validateParameters() throws ECException
validateParameters
in interface
ECCommand
validateParameters
in class
AbstractECTargetableCommand
:
- com.ibm.commerce.exception.ECException.ECException