public class UseCouponIdTaskCmdImpl extends TaskCommandImpl implements UseCouponIdTaskCmd
CheckValidityCmd
command is called to find the eCoupons that are not expired.
For the not expired eCoupons, CheckApplicabilityCmd
command is called
to find out which eCoupons are applicable for this order. For applicable coupons,
CalculateDiscountAmtCmd
command is called to calculate the discount amount
and CouponDSSTaskCmd
command is called to check for any conflict.defaultCommandClassName, Name
Constructor and Description |
---|
UseCouponIdTaskCmdImpl()
Deprecated.
UseCouponIdCmdImpl constructor calls super.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkCouponIdShopperState()
Deprecated.
Returns true if the CouponId are for this shopper and in Usable state.
|
java.lang.Integer |
getCalculationUsage()
Deprecated.
Returns the calculation usage code.
|
java.util.Hashtable |
getConflicts()
Deprecated.
Returns the conflicts information.
|
java.lang.Long[] |
getCouponIds()
Deprecated.
Returns the couponIds.
|
java.lang.String |
getCurrency()
Deprecated.
Gets the currency.
|
java.lang.Integer |
getErrorCode()
Deprecated.
Returns the error code.
|
java.util.Vector |
getInvalidCoupons()
Deprecated.
Returns the invalid coupons.
|
int |
getNumCoupons()
Deprecated.
Returns the number of coupons.
|
java.lang.Long |
getOrderId()
Deprecated.
Gets the order ID.
|
CommandContext |
getProcessingContext()
Deprecated.
Returns the processing context.
|
TypedProperty |
getRequestProperties()
Deprecated.
Returns the request properties.
|
java.lang.Long |
getShopperId()
Deprecated.
Gets the shopperId.
|
void |
insertIntoDB(java.lang.Long orderId,
java.util.Hashtable couponHashtable)
Deprecated.
Inserts the coupon related information in the database.
|
boolean |
isValidSelection()
Deprecated.
Returns true if the selection was valid.
|
void |
performExecute()
Deprecated.
First, this this command check whether the specified coupons belong to the shopper.
|
void |
removeExistingAdjustments(java.lang.Long anOrderId)
Deprecated.
Removes the existing adjustments for this order.
|
void |
removeOldEntries()
Deprecated.
It removes the old entries from the TORCPMAP and TCPITMAP tables.
|
void |
setCalculationUsage(java.lang.Integer newCalculationUsage)
Deprecated.
Sets the calculation usage.
|
void |
setConflicts(java.util.Hashtable newConflicts)
Deprecated.
Sets the conflicts information.
|
void |
setCouponIds(java.lang.Long[] newCouponIds)
Deprecated.
Sets the couponIds.
|
void |
setCurrency(java.lang.String newCurrency)
Deprecated.
Sets the currency.
|
void |
setErrorCode(java.lang.Integer newErrorCode)
Deprecated.
Sets the errorcode.
|
void |
setInvalidCoupons(java.util.Vector newInvalidCoupons)
Deprecated.
Sets the invalidCoupons.
|
void |
setKeepPrevious(boolean keepPrevious)
Deprecated.
Sets the removePrevious.
|
void |
setNumCoupons(int newNumCoupons)
Deprecated.
Sets the number of coupons.
|
void |
setOrderId(java.lang.Long newOrderId)
Deprecated.
Sets the order ID.
|
void |
setProcessingContext(CommandContext newProcessingContext)
Deprecated.
Sets the processing context.
|
void |
setRequestProperties(TypedProperty newRequestProperties)
Deprecated.
Sets the request properties.
|
void |
setShopperId(java.lang.Long newShopperId)
Deprecated.
Sets the shopperId.
|
void |
setValidSelection(boolean newValidSelection)
Deprecated.
Sets the validSelect field.
|
void |
validateParameters()
Deprecated.
Extracts the couponIds to be used in the command from the request.
|
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, setDefaultProperties
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
public UseCouponIdTaskCmdImpl()
public boolean checkCouponIdShopperState() throws ECSystemException
CouponEmailMapAccessBean
for cpwalletId
and shopperEmailId
fields.ECSystemException
public java.lang.Integer getCalculationUsage()
public java.util.Hashtable getConflicts()
getConflicts
in interface UseCouponIdTaskCmd
public java.lang.Long[] getCouponIds()
public java.lang.String getCurrency()
public java.lang.Integer getErrorCode()
getErrorCode
in interface UseCouponIdTaskCmd
public java.util.Vector getInvalidCoupons()
getInvalidCoupons
in interface UseCouponIdTaskCmd
public int getNumCoupons()
getNumCoupons
in interface UseCouponIdTaskCmd
public java.lang.Long getOrderId()
public CommandContext getProcessingContext()
public TypedProperty getRequestProperties()
public java.lang.Long getShopperId()
public void insertIntoDB(java.lang.Long orderId, java.util.Hashtable couponHashtable) throws ECSystemException
TempOrderCouponMapAccessBean
for each coupon used for this order. Then, create the TempCouponItemMapAccessBean
for each item for
coupon, with the discount amount information.orderId
- The order for which the coupons are being applied.couponHashTable
- It has information about the items the coupons apply to and the discount amounts for each.com.ibm.commerce.exception.ECException.
ECSystemException
public boolean isValidSelection()
isValidSelection
in interface UseCouponIdTaskCmd
public void performExecute() throws ECException
CheckValidityCmd
command is called to find the eCoupons that are not expired.
For the not expired eCoupons, CheckApplicabilityCmd
command is called
to find out which eCoupons are applicable for this order. For applicable coupons,
CalculateDiscountAmtCmd
command is called to calculate the discount amount
and CouponDSSTaskCmd
command is called to check for any conflict.performExecute
in interface ECCommand
performExecute
in interface com.ibm.websphere.command.TargetableCommand
performExecute
in class AbstractECTargetableCommand
ECException
public void removeExistingAdjustments(java.lang.Long anOrderId) throws ECSystemException
anOrderId
- the order ID for which the adjustments are removed.ECSystemException
public void removeOldEntries() throws ECSystemException
com.ibm.commerce.exception.ECException.
ECSystemException
public void setCalculationUsage(java.lang.Integer newCalculationUsage)
newCalculationUsage
- the calculation code.public void setConflicts(java.util.Hashtable newConflicts)
newConflicts
- hashtable containing the conflict information.public void setCouponIds(java.lang.Long[] newCouponIds)
setCouponIds
in interface UseCouponIdTaskCmd
newCouponIds
- the coupon IDs.public void setCurrency(java.lang.String newCurrency)
newCurrency
- the currency to be used.public void setErrorCode(java.lang.Integer newErrorCode)
newErrorCode
- the error code indicating the reason for the coupons to be not applicable.public void setInvalidCoupons(java.util.Vector newInvalidCoupons)
newInvalidCoupons
- vector containing information about which coupons are invalid.public void setNumCoupons(int newNumCoupons)
newNumCoupons
- number of coupons.public void setOrderId(java.lang.Long newOrderId)
setOrderId
in interface UseCouponIdTaskCmd
newOrderId
- the order ID.public void setProcessingContext(CommandContext newProcessingContext)
newProcessingContext
- command context to be used.public void setRequestProperties(TypedProperty newRequestProperties)
setRequestProperties
in interface UseCouponIdTaskCmd
newRequestProperties
- the request properties.public void setShopperId(java.lang.Long newShopperId)
setShopperId
in interface UseCouponIdTaskCmd
newShopperId
- the shopper ID.public void setValidSelection(boolean newValidSelection)
newValidSelection
- true if the selection is valid.public void validateParameters() throws ECException
validateParameters
in interface ECCommand
validateParameters
in class AbstractECTargetableCommand
ECException.
ECException
public void setKeepPrevious(boolean keepPrevious)
setKeepPrevious
in interface UseCouponIdTaskCmd
keepPrevious
- The keepPrevious to set