|
||||||||
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.couponredemption.commands.CheckApplicabilityCmdImpl
The purpose of this command is to check for aplicability of the coupons i.e., the purchase order condition is satisfied and the information is put in applicable variable which is used by the calling command.
The input to this command are:
First the order amount is calculated. Then the cppmnId is found out by using corresponding cpwalletId for that eCoupon. If the purchase order condition type for an eCoupon promotion is of product type, then the required products and their minumum quantities are found out from cppmnprod table. If all the required products are present in the order with the required quantities, then the applicable eCoupons are found out.If the purchase order condition type for an eCoupon promotion is of type order, then the required amount for that order is found from cppmnord table and the currency from cppmn table. If the order amount satisfies the boundary conditions, then the eCoupon is applicable. These above steps are performed for each cpwalletId.
Field Summary | |
protected java.util.Vector[] |
applicableItems
|
protected java.lang.Long[] |
bcIds
|
protected java.sql.Timestamp |
currentTimeStamp
|
protected TypedProperty |
inParam
|
protected java.lang.Long |
orderId
|
protected TypedProperty |
outParam
|
protected CommandContext |
processingContext
|
protected TypedProperty |
reqParam
|
protected boolean[] |
validCoupons
|
Fields inherited from class com.ibm.commerce.command.AbstractECCommand |
commandContext |
Fields inherited from interface com.ibm.commerce.couponredemption.commands.CheckApplicabilityCmd |
COPYRIGHT, defaultCommandClassName, Name |
Constructor Summary | |
CheckApplicabilityCmdImpl()
CheckValidityCmdImpl constructor call super. |
Method Summary | |
java.math.BigDecimal |
calculateTotalOrderAmt(java.util.Vector vecoiAB,
StoreAccessBean sAB,
CurrencyManager cm,
java.lang.String curCurrency)
It calculate the total order amount. |
boolean |
checkParentCatEntryIds(java.lang.Long oiCatEntryId,
java.lang.Long walletCatEntryId)
Check the parent catalog entry. |
java.util.Vector[] |
getApplicableItems()
Get applicable items. |
java.lang.Long[] |
getBcIds()
Get the eCoupon ids. |
java.sql.Timestamp |
getCurrentTimeStamp()
Get current time from system. |
java.lang.Long |
getOrderId()
Get order ids. |
CommandContext |
getProcessingContext()
It get the processing context. |
TypedProperty |
getRequestProperties()
Get the request properties. |
TypedProperty |
getResponseProperties()
Get the response properties. |
boolean[] |
getValidCoupons()
Get valid coupons. |
void |
performExecute()
The purpose of this command is to check for aplicability of the coupons i.e., the purchase order condition is satisfied and the information is put in applicable variable which is used by the calling command. |
void |
setApplicableItems(java.util.Vector[] newApplicableItems)
Set the applicable items. |
void |
setBcIds(java.lang.Long[] newBcIds)
Set eCoupon ids. |
void |
setCurrentTimeStamp(java.sql.Timestamp newCurrentTimeStamp)
Set the current time from system. |
void |
setOrderId(java.lang.Long newOrderId)
Set the order ids. |
void |
setProcessingContext(CommandContext newProcessingContext)
Set the processing context. |
void |
setRequestProperties(TypedProperty param)
Set the request properties. |
void |
setValidCoupons(boolean[] newValidCoupons)
Set valid eCoupons. |
void |
validateParameters()
It check the parameters. |
Methods inherited from class com.ibm.commerce.command.AbstractECCommand |
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, 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.command.ECCommand |
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties |
Field Detail |
protected java.util.Vector[] applicableItems
protected java.lang.Long[] bcIds
protected java.sql.Timestamp currentTimeStamp
protected TypedProperty inParam
protected java.lang.Long orderId
protected TypedProperty outParam
protected CommandContext processingContext
protected TypedProperty reqParam
protected boolean[] validCoupons
Constructor Detail |
public CheckApplicabilityCmdImpl()
Method Detail |
public java.math.BigDecimal calculateTotalOrderAmt(java.util.Vector vecoiAB, StoreAccessBean sAB, CurrencyManager cm, java.lang.String curCurrency) throws ECSystemException, javax.naming.NamingException, java.rmi.RemoteException, javax.ejb.CreateException, javax.ejb.FinderException
public boolean checkParentCatEntryIds(java.lang.Long oiCatEntryId, java.lang.Long walletCatEntryId) throws ECSystemException
public java.util.Vector[] getApplicableItems()
getApplicableItems
in interface CheckApplicabilityCmd
public java.lang.Long[] getBcIds()
public java.sql.Timestamp getCurrentTimeStamp()
public java.lang.Long getOrderId()
public CommandContext getProcessingContext()
public TypedProperty getRequestProperties()
public TypedProperty getResponseProperties()
getResponseProperties
in interface CheckApplicabilityCmd
public boolean[] getValidCoupons()
getValidCoupons
in interface CheckApplicabilityCmd
public void performExecute() throws ECException
The purpose of this command is to check for aplicability of the coupons i.e., the
purchase order condition is satisfied and the information is put in applicable variable
which is used by the calling command.
First the order amount is calculated. Then the cppmnId is found out by using corresponding cpwalletId
for that eCoupon. If the purchase order condition type for an eCoupon promotion is of product type, then
the required products and their minumum quantities are found out from cppmnprod table. If all the required
products are present in the order with the required quantities, then the applicable eCoupons are found out.If
the purchase order condition type for an eCoupon promotion is of type order, then the required amount for that
order is found from cppmnord table and the currency from cppmn table. If the order amount satisfies the boundary
conditions, then the eCoupon is applicable. These above steps are performed for each cpwalletId.
performExecute
in interface ECCommand
performExecute
in class AbstractECCommand
:
- ECException.
public void setApplicableItems(java.util.Vector[] newApplicableItems)
newApplicableItems
- java.util.Vectorpublic void setBcIds(java.lang.Long[] newBcIds)
setBcIds
in interface CheckApplicabilityCmd
newBcId
- java.lang.Longpublic void setCurrentTimeStamp(java.sql.Timestamp newCurrentTimeStamp)
newCurrentTimeStamp
- java.sql.Timestamppublic void setOrderId(java.lang.Long newOrderId)
setOrderId
in interface CheckApplicabilityCmd
newOrderId
- java.lang.Integerpublic void setProcessingContext(CommandContext newProcessingContext)
setProcessingContext
in interface CheckApplicabilityCmd
newProcessingContext
- com.ibm.commerce.command.CommandContextpublic void setRequestProperties(TypedProperty param)
setRequestProperties
in interface CheckApplicabilityCmd
param
- com.ibm.commerce.datatype.TypedPropertypublic void setValidCoupons(boolean[] newValidCoupons)
newValidCoupons
- boolean[]public void validateParameters() throws ECException
validateParameters
in interface ECCommand
validateParameters
in class AbstractECCommand
ECException
- The exception description.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |