|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.commerce.command.AbstractECCommand | +--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 incorpurate 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 input to this command is :
The eCoupons which are to be applied to an order are found out from ORCPMAP table. They are removed from ORCPMAP table and CPITMAP table. The eCoupons are checked for expiry by calling CheckValidityTaskCmd command. The eCoupons those are not expired for applicability are checked by calling CheckApplicabilityTaskCmd command. The applicable eCoupons are called by the CalculateDiscountAmountCmd task command and discount amount in the current order is incorporated.
Field Summary | |
protected java.lang.Long |
orderId
|
protected CommandContext |
processingContext
|
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.AbstractECCommand |
commandContext |
Fields inherited from interface com.ibm.commerce.couponredemption.commands.ApplyCouponUsageCmd |
COPYRIGHT, defaultCommandClassName, NAME |
Constructor Summary | |
ApplyCouponUsageCmdImpl()
Conctructor 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 check applied items. |
java.util.Set |
getAppliedItems()
Get the applied items. |
protected Item[] |
getItems()
Gets the items. |
java.lang.Long |
getOrderId()
It get the orderids. |
CommandContext |
getProcessingContext()
Get the processing context. |
protected java.lang.Integer[] |
getTaxCategoryIds()
Gets the tax categories. |
void |
insertIntoDB(java.lang.Long orderId,
java.util.Hashtable couponHashtable)
It insert data into database. |
void |
performExecute()
This task command is called from OrderPrepare command to incorpurate the eCoupon discount onto the Adjustments in ORDERS and ORDERITEMS table. |
void |
removeOldEntries()
It remove the old entries. |
void |
reset()
This method is called after a command has been executed to reset its states variables. |
void |
setItems(Item[] aItems)
Set the items. |
void |
setOrderId(java.lang.Long newOrderId)
Set the order ids. |
void |
setProcessingContext(CommandContext newProcessingContext)
It set the processing context. |
void |
setTaxCategoryIds(java.lang.Integer[] anTaxCategoryIds)
It set the tax category.. |
void |
validateParameters()
It 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.AbstractECCommand |
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, 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 |
Methods inherited from interface com.ibm.commerce.command.ECCommand |
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties |
Field Detail |
protected java.lang.Long orderId
protected CommandContext processingContext
Constructor Detail |
public ApplyCouponUsageCmdImpl()
Method Detail |
protected void callCodeApply(Group aGroup) throws ECException
:
- com.ibm.commerce.exception.ECException.public void checkAppliedItems() throws ECException
checkAppliedItems
in interface ApplyCalculationUsageCmd
:
- com.ibm.commerce.exception.ECException.public java.util.Set getAppliedItems()
getAppliedItems
in interface ApplyCalculationUsageCmd
protected Item[] getItems()
public java.lang.Long getOrderId()
Creation date: (7/15/2001 7:44:09 AM)
public CommandContext getProcessingContext()
protected java.lang.Integer[] getTaxCategoryIds()
public void insertIntoDB(java.lang.Long orderId, java.util.Hashtable couponHashtable) throws ECSystemException
couponHashTable
- java.util.Hashtablepublic void performExecute() throws ECException
This task command is called from OrderPrepare command to incorpurate 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 ORCPMAP table. They
are removed from ORCPMAP table and CPITMAP table. The eCoupons are checked for expiry
by calling CheckValidityTaskCmd command. The eCoupons those are not expired for applicability
are checked by calling CheckApplicabilityTaskCmd command. The applicable eCoupons are
called by the CalculateDiscountAmountCmd task command and discount amount in the current order is incorporated.
performExecute
in interface ECCommand
performExecute
in class AbstractECCommand
:
- com.ibm.commerce.exception.ECException.public void removeOldEntries() throws ECSystemException
:
- com.ibm.commerce.exception.ECException.public void reset()
AbstractECCommand
reset
in class CalculationCmdImpl
public void setItems(Item[] aItems)
setItems
in interface ApplyCalculationUsageCmd
Item[]
- 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 AbstractECCommand
:
- com.ibm.commerce.exception.ECException.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |