public class CouponDSSTaskCmdImpl extends TaskCommandImpl implements CouponDSSTaskCmd
This task command is called from the CouponDSSCmd when user selects a set of eCoupons to be used on a set of items in her order.
First the eCoupons with selection status whether SELECTED or not is checked and it shouldn't have a common item in their itemlist where the itemlist is obtained from the parameter itemFor<cpwalletIds> if specified or from TempCouponItemMapAccessBean otherwise. This is done for all non order level coupons. Also only one order level eCoupon can be selected per order.
If the above conditions are satisfied, the selected eCoupons are moved from TempOrderCouponMapAccessBean to OrderCouponMapAccessBean and the unselected eCoupons are to deleted from TempOrderCouponMapAccessBean. Also the selected items are moved from TempCouponItemMapAccessBean to CouponItemMapAccessBean.
Modifier and Type | Field and Description |
---|---|
protected java.util.Hashtable | conflicts
Deprecated.
This hashtable stores the information about the conflict in the coupon selection.
|
protected java.lang.Long[] | couponId
Deprecated.
The couponIds to be processed.
|
protected java.math.BigDecimal[] | discAmt
Deprecated.
The nth element is the total discount amount due to the nth coupon.
|
protected java.util.Vector[] | itemList
Deprecated.
The nth element is the vector containing the items on which the nth coupon is being applied.
|
protected int | numCoupons
Deprecated.
The the number of coupons to be processed.
|
protected java.lang.Long | orderId
Deprecated.
The order on which the coupons are to be applied.
|
protected CommandContext | processingContext
Deprecated.
The command context holder
|
protected TypedProperty | reqProp
Deprecated.
The request properties.
|
protected TypedProperty | rspProp
Deprecated.
The response properties.
|
protected boolean | validSelection
Deprecated.
True if coupons selected can be used together.
|
Constructor and Description |
---|
CouponDSSTaskCmdImpl()
Deprecated.
CouponDSSCmdImpl constructor, call super.
|
Modifier and Type | Method and Description |
---|---|
void | computeItemAndDiscount()
Deprecated.
Finds the items and discount on those corresponding to each cpwalletId.
|
java.util.Hashtable | getConflicts()
Deprecated.
Returns the conflict hashtable.
|
java.lang.Long[] | getCouponId()
Deprecated.
Gets the coupon IDs.
|
java.util.Hashtable | getItemsSelected()
Deprecated.
Gets the items that were selected for the coupons to be applied on.
|
int | getNumCoupons()
Deprecated.
Gets the number of coupons.
|
java.lang.Long | getOrderId()
Deprecated.
Gets the order ID.
|
TypedProperty | getReqProp()
Deprecated.
Gets the request properties.
|
TypedProperty | getRspProp()
Deprecated.
Gets the response properties.
|
java.util.Vector | getUnQualifiedCoupons()
Deprecated.
Gets the IDs of the unqualified coupons.
|
boolean | isReadyToCallExecute()
Deprecated.
It always returns true.
|
boolean | isValidSelection()
Deprecated.
Returns whether the selection is valid or not.
|
void | performExecute()
Deprecated.
First the eCoupons with selection status whether SELECTED or not is checked and it shouldn't have a common item in their itemlist where the itemlist is obtained from the parameter itemFor<cpwalletIds> if specified or from TempCouponItemMapAccessBean otherwise.
|
protected boolean | qualifies(java.lang.Integer paramPromoId, java.util.Vector paramItemList, java.lang.String paramPurchaseCondType)
Deprecated.
This method tests whether the coupon of a given promotion can be applied on the given set of items for the purchase condition type.
|
void | setConflicts(java.util.Hashtable newConflicts)
Deprecated.
Sets the conflict variable.
|
void | setCouponId(java.lang.Long[] newCouponId)
Deprecated.
Sets the ecoupon IDs.
|
void | setItemsSelected(java.util.Hashtable newItemsSelected)
Deprecated.
Sets the items that were selected for the coupons to be applied on.
|
void | setNumCoupons(int newNumCoupons)
Deprecated.
Sets the number of coupons.
|
void | setOrderId(java.lang.Long newOrderId)
Deprecated.
Sets the order ID.
|
void | setValidSelection(boolean newValidSelection)
Deprecated.
Sets valid selection.
|
void | transferFromTemp()
Deprecated.
Transfer the entries from TempOrderCouponMapAccessBean and TempCouponItemMapAccessBean to the OrderCouponMapAcessBean and CouponItemMapAcessBean.
|
void | validateParameters()
Deprecated.
Checks the parameters.
|
protected java.lang.Long[] couponId
protected java.util.Vector[] itemList
protected int numCoupons
protected java.lang.Long orderId
protected java.math.BigDecimal[] discAmt
protected java.util.Hashtable conflicts
protected CommandContext processingContext
protected TypedProperty reqProp
protected TypedProperty rspProp
protected boolean validSelection
public CouponDSSTaskCmdImpl()
public void computeItemAndDiscount() throws ECSystemException
public java.util.Hashtable getConflicts()
public java.lang.Long[] getCouponId()
public java.util.Hashtable getItemsSelected()
public int getNumCoupons()
public java.lang.Long getOrderId()
public TypedProperty getReqProp()
public TypedProperty getRspProp()
public java.util.Vector getUnQualifiedCoupons()
public boolean isReadyToCallExecute()
public boolean isValidSelection()
public void performExecute() throws ECException
First the eCoupons with selection status whether SELECTED or not is checked and it shouldn't have a common item in their itemlist where the itemlist is obtained from the parameter itemFor<cpwalletIds> if specified or from TempCouponItemMapAccessBean otherwise. This is done for all non order level coupons. Also only one order level eCoupon can be selected per order.
If the above conditions are satisfied, the selected eCoupons are moved from TempOrderCouponMapAccessBean to OrderCouponMapAccessBean and the unselected eCoupons are to deleted from TempOrderCouponMapAccessBean. Also the selected items are moved from TempCouponItemMapAccessBean to CouponItemMapAccessBean.
protected boolean qualifies(java.lang.Integer paramPromoId, java.util.Vector paramItemList, java.lang.String paramPurchaseCondType) throws ECSystemException
public void setConflicts(java.util.Hashtable newConflicts)
public void setCouponId(java.lang.Long[] newCouponId)
public void setItemsSelected(java.util.Hashtable newItemsSelected)
public void setNumCoupons(int newNumCoupons)
public void setOrderId(java.lang.Long newOrderId)
public void setValidSelection(boolean newValidSelection)
public void transferFromTemp() throws ECSystemException
Transfer the entries from TempOrderCouponMapAccessBean and TempCouponItemMapAccessBean to the OrderCouponMapAcessBean and CouponItemMapAcessBean.
public void validateParameters() throws ECException