public class CheckApplicabilityCmdImpl extends TaskCommandImpl implements CheckApplicabilityCmd
The purpose of this command is to check for applicability of the coupons on the shopping cart. The purchase condition are evaluated 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 PromoProdAccessBean.
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 PromoOrderAccessBean and the currency from CouponPromotionAccessBean.
If the order amount satisfies the
conditions, then the eCoupon is applicable. These above steps are performed for each cpwalletId.
defaultCommandClassName, Name| Constructor and Description |
|---|
CheckApplicabilityCmdImpl()
Deprecated.
CheckValidityCmdImpl constructor calls super.
|
| Modifier and Type | Method and Description |
|---|---|
java.math.BigDecimal |
calculateTotalOrderAmt(java.util.Vector vecoiAB,
StoreAccessBean sAB,
CurrencyManager cm,
java.lang.String curCurrency)
Deprecated.
Calculates the total order amount.
|
boolean |
checkParentCatEntryIds(java.lang.Long oiCatEntryId,
java.lang.Long walletCatEntryId)
Deprecated.
Checks the parent catalog entry.
|
java.util.Vector[] |
getApplicableItems()
Deprecated.
Gets applicable items.
|
java.lang.Long[] |
getBcIds()
Deprecated.
Gets the eCoupon IDs.
|
java.sql.Timestamp |
getCurrentTimeStamp()
Deprecated.
Gets current time from system.
|
java.lang.Long |
getOrderId()
Deprecated.
Gets order ID.
|
CommandContext |
getProcessingContext()
Deprecated.
Gets the processing context.
|
TypedProperty |
getRequestProperties()
Deprecated.
Gets the request properties.
|
TypedProperty |
getResponseProperties()
Deprecated.
Gets the response properties.
|
boolean[] |
getValidCoupons()
Deprecated.
Gets the array indicating whether the Coupons are applicable or not.
|
void |
performExecute()
Deprecated.
First the order amount is calculated.
|
void |
setApplicableItems(java.util.Vector[] newApplicableItems)
Deprecated.
Sets the applicable items.
|
void |
setBcIds(java.lang.Long[] newBcIds)
Deprecated.
Sets eCoupon IDs.
|
void |
setCurrentTimeStamp(java.sql.Timestamp newCurrentTimeStamp)
Deprecated.
Sets the current time from system.
|
void |
setOrderId(java.lang.Long newOrderId)
Deprecated.
Sets the order ID.
|
void |
setProcessingContext(CommandContext newProcessingContext)
Deprecated.
Sets the processing context.
|
void |
setRequestProperties(TypedProperty param)
Deprecated.
Sets the request properties.
|
void |
setValidCoupons(boolean[] newValidCoupons)
Deprecated.
Sets the array indicating whether the Coupons are applicable or not.
|
void |
validateParameters()
Deprecated.
It checks the parameters.
|
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultPropertiesexecuteFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCachegetCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicyequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexecuteFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCachegetCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputPropertiescheckIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultPropertiespublic CheckApplicabilityCmdImpl()
public java.math.BigDecimal calculateTotalOrderAmt(java.util.Vector vecoiAB,
StoreAccessBean sAB,
CurrencyManager cm,
java.lang.String curCurrency)
throws ECSystemException
ECSystemExceptionpublic boolean checkParentCatEntryIds(java.lang.Long oiCatEntryId,
java.lang.Long walletCatEntryId)
throws ECSystemException
oiCatEntryId - The child catalog entry ID.walletCatEntryId - The parent catalog entry ID.ECSystemExceptionpublic java.util.Vector[] getApplicableItems()
getApplicableItems in interface CheckApplicabilityCmdpublic 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 CheckApplicabilityCmdpublic boolean[] getValidCoupons()
getValidCoupons in interface CheckApplicabilityCmdpublic void performExecute()
throws ECException
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 PromoProdAccessBean.
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 PromoOrderAccessBean and the currency from CouponPromotionAccessBean.
If the order amount satisfies the
conditions, then the eCoupon is applicable. These above steps are performed for each cpwalletId.
performExecute in interface ECCommandperformExecute in interface com.ibm.websphere.command.TargetableCommandperformExecute in class AbstractECTargetableCommand: - ECException.ECExceptionpublic void setApplicableItems(java.util.Vector[] newApplicableItems)
setApplicableItems in interface CheckApplicabilityCmdnewApplicableItems - the applicable items.public void setBcIds(java.lang.Long[] newBcIds)
setBcIds in interface CheckApplicabilityCmdnewBcId - The coupons to be checked for applicability.public void setCurrentTimeStamp(java.sql.Timestamp newCurrentTimeStamp)
newCurrentTimeStamp - the current timepublic void setOrderId(java.lang.Long newOrderId)
setOrderId in interface CheckApplicabilityCmdnewOrderId - the order ID.public void setProcessingContext(CommandContext newProcessingContext)
setProcessingContext in interface CheckApplicabilityCmdnewProcessingContext - the command context to be used.public void setRequestProperties(TypedProperty param)
setRequestProperties in interface CheckApplicabilityCmdparam - the request properties.public void setValidCoupons(boolean[] newValidCoupons)
newValidCoupons - array whose nth element indicates if the nth coupon is applicablepublic void validateParameters()
throws ECException
validateParameters in interface ECCommandvalidateParameters in class AbstractECTargetableCommandECException