|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.broadleafcommerce.core.order.service.OrderServiceImpl
@Service(value="blOrderService")
@ManagedResource(objectName="org.broadleafcommerce:name=OrderService",
description="Order Service",
currencyTimeLimit=15)
public class OrderServiceImpl
| Field Summary | |
|---|---|
protected SequenceProcessor |
addItemWorkflow
|
protected boolean |
automaticallyMergeLikeItems
|
protected boolean |
deleteEmptyNamedOrders
|
protected FulfillmentGroupService |
fulfillmentGroupService
|
protected MergeCartService |
mergeCartService
|
protected boolean |
moveNamedOrderItems
|
protected NullOrderFactory |
nullOrderFactory
|
protected OfferDao |
offerDao
|
protected OfferService |
offerService
|
protected OrderDao |
orderDao
|
protected OrderItemService |
orderItemService
|
protected PaymentInfoDao |
paymentInfoDao
|
protected PricingService |
pricingService
|
protected SequenceProcessor |
removeItemWorkflow
|
protected SecurePaymentInfoService |
securePaymentInfoService
|
protected SequenceProcessor |
updateItemWorkflow
|
| Constructor Summary | |
|---|---|
OrderServiceImpl()
|
|
| Method Summary | |
|---|---|
Order |
addAllItemsFromNamedOrder(Order namedOrder,
boolean priceOrder)
Adds all orderItems to the current cart from the same Customer that owns the named order. |
OrderItem |
addGiftWrapItemToOrder(Order order,
GiftWrapOrderItemRequest itemRequest,
boolean priceOrder)
Adds a GiftWrapItem to the order based on the itemRequest. |
Order |
addItem(Long orderId,
OrderItemRequestDTO orderItemRequestDTO,
boolean priceOrder)
Initiates the addItem workflow that will attempt to add the given quantity of the specified item to the Order. |
Order |
addItemFromNamedOrder(Order namedOrder,
OrderItem item,
boolean priceOrder)
Adds the passed in orderItem to the current cart for the same Customer that owns the named order. |
Order |
addItemFromNamedOrder(Order namedOrder,
OrderItem item,
int quantity,
boolean priceOrder)
This method performs the same function as addItemFromNamedOrder(Order, OrderItem, boolean) except that instead of adding all of the quantity from the named order to the cart, it will only add/move the specific quantity requested. |
Order |
addOfferCode(Order order,
OfferCode offerCode,
boolean priceOrder)
Adds the given OfferCode to the order. |
PaymentInfo |
addPaymentToOrder(Order order,
PaymentInfo payment,
Referenced securePaymentInfo)
Associates a given PaymentInfo with an Order. |
void |
cancelOrder(Order order)
Deletes the given order. |
Order |
confirmOrder(Order order)
Changes the OrderStatus to SUBMITTED |
Order |
createNamedOrderForCustomer(String name,
Customer customer)
Creates a new Order for the given customer with the given name. |
Order |
createNewCartForCustomer(Customer customer)
Creates a new Order for the given customer. |
Order |
findCartForCustomer(Customer customer)
Looks up the current shopping cart for the customer. |
OrderItem |
findLastMatchingItem(Order order,
Long skuId,
Long productId)
Looks through the given order and returns the latest added OrderItem that matches on the skuId and productId. |
Order |
findNamedOrderForCustomer(String name,
Customer customer)
Looks up an Order by the given customer and a specified order name. |
Order |
findOrderById(Long orderId)
Looks up an Order by its database id |
Order |
findOrderByOrderNumber(String orderNumber)
Looks up Orders and returns the order matching the given orderNumber |
List<Order> |
findOrdersForCustomer(Customer customer)
Looks up all Orders for the specified customer, regardless of current OrderStatus |
List<Order> |
findOrdersForCustomer(Customer customer,
OrderStatus status)
Looks up all Orders for the specified customer that are in the specified OrderStatus. |
List<PaymentInfo> |
findPaymentInfosForOrder(Order order)
Returns all PaymentInfo objects that are associated with the given order |
boolean |
getAutomaticallyMergeLikeItems()
|
protected Throwable |
getCartOperationExceptionRootCause(WorkflowException e)
This method will return the exception that is immediately below the deepest WorkflowException in the current stack trace. |
Order |
getNullOrder()
The null order is the default order for all customers when they initially enter the site. |
boolean |
isDeleteEmptyNamedOrders()
|
boolean |
isMoveNamedOrderItems()
|
protected Order |
persist(Order order)
|
Order |
removeAllOfferCodes(Order order,
boolean priceOrder)
Removes all offer codes for the given order. |
void |
removeAllPaymentsFromOrder(Order order)
Deletes all the Payment Info's on the order. |
Order |
removeItem(Long orderId,
Long orderItemId,
boolean priceOrder)
Initiates the removeItem workflow that will attempt to remove the specified OrderItem from the given Order |
Order |
removeOfferCode(Order order,
OfferCode offerCode,
boolean priceOrder)
Remove the given OfferCode for the order. |
void |
removePaymentsFromOrder(Order order,
PaymentInfoType paymentInfoType)
Deletes the Payment Info of the passed in type from the order Note that this method will also delete any associated Secure Payment Infos if necessary. |
Order |
save(Order order,
Boolean priceOrder)
Persists the given order to the database. |
void |
setAutomaticallyMergeLikeItems(boolean automaticallyMergeLikeItems)
When set to true, the system when items are added to the cart, they will automatically be merged. |
void |
setDeleteEmptyNamedOrders(boolean deleteEmptyNamedOrders)
Sets whether or not to delete named orders once all items have been removed. |
void |
setMoveNamedOrderItems(boolean moveNamedOrderItems)
Determines whether or not items will be removed from the named order (wishlist) when they are moved to the Customer's current cart. |
Order |
updateItemQuantity(Long orderId,
OrderItemRequestDTO orderItemRequestDTO,
boolean priceOrder)
Initiates the updateItem workflow that will attempt to update the item quantity for the specified OrderItem in the given Order. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PaymentInfoDao paymentInfoDao
protected OrderDao orderDao
protected OfferDao offerDao
protected NullOrderFactory nullOrderFactory
protected PricingService pricingService
protected OrderItemService orderItemService
protected FulfillmentGroupService fulfillmentGroupService
protected OfferService offerService
protected SecurePaymentInfoService securePaymentInfoService
protected MergeCartService mergeCartService
protected SequenceProcessor addItemWorkflow
protected SequenceProcessor updateItemWorkflow
protected SequenceProcessor removeItemWorkflow
protected boolean moveNamedOrderItems
protected boolean deleteEmptyNamedOrders
protected boolean automaticallyMergeLikeItems
| Constructor Detail |
|---|
public OrderServiceImpl()
| Method Detail |
|---|
public Order createNewCartForCustomer(Customer customer)
OrderService
createNewCartForCustomer in interface OrderServiceCustomerState
@Transactional(value="blTransactionManager")
public Order createNamedOrderForCustomer(String name,
Customer customer)
OrderService
createNamedOrderForCustomer in interface OrderService
public Order findNamedOrderForCustomer(String name,
Customer customer)
OrderService
findNamedOrderForCustomer in interface OrderServiceOrderService.createNamedOrderForCustomer(String name, Customer customer)public Order findOrderById(Long orderId)
OrderService
findOrderById in interface OrderServicepublic Order getNullOrder()
OrderService
getNullOrder in interface OrderServicefor more informationpublic Order findCartForCustomer(Customer customer)
OrderService
findCartForCustomer in interface OrderServicepublic List<Order> findOrdersForCustomer(Customer customer)
OrderService
findOrdersForCustomer in interface OrderService
public List<Order> findOrdersForCustomer(Customer customer,
OrderStatus status)
OrderService
findOrdersForCustomer in interface OrderServicepublic Order findOrderByOrderNumber(String orderNumber)
OrderService
findOrderByOrderNumber in interface OrderServicepublic List<PaymentInfo> findPaymentInfosForOrder(Order order)
OrderService
findPaymentInfosForOrder in interface OrderService
@Transactional(value="blTransactionManager")
public PaymentInfo addPaymentToOrder(Order order,
PaymentInfo payment,
Referenced securePaymentInfo)
OrderService
addPaymentToOrder in interface OrderServicesecurePaymentInfo - - null if it doesn't exist
@Transactional(value="blTransactionManager")
public Order save(Order order,
Boolean priceOrder)
throws PricingException
OrderService
save in interface OrderServicePricingExceptionprotected Order persist(Order order)
@Transactional(value="blTransactionManager") public void cancelOrder(Order order)
OrderService
cancelOrder in interface OrderService
@Transactional(value="blTransactionManager")
public Order addOfferCode(Order order,
OfferCode offerCode,
boolean priceOrder)
throws PricingException,
OfferMaxUseExceededException
OrderService
addOfferCode in interface OrderServicePricingException
OfferMaxUseExceededException
@Transactional(value="blTransactionManager")
public Order removeOfferCode(Order order,
OfferCode offerCode,
boolean priceOrder)
throws PricingException
OrderService
removeOfferCode in interface OrderServicePricingException
@Transactional(value="blTransactionManager")
public Order removeAllOfferCodes(Order order,
boolean priceOrder)
throws PricingException
OrderService
removeAllOfferCodes in interface OrderServicePricingException
@ManagedAttribute(description="The delete empty named order after adding items to cart attribute",
currencyTimeLimit=15)
public void setDeleteEmptyNamedOrders(boolean deleteEmptyNamedOrders)
OrderService
setDeleteEmptyNamedOrders in interface OrderService
public OrderItem findLastMatchingItem(Order order,
Long skuId,
Long productId)
OrderServicesetAutomaticallyMergeLikeItems
is set to true and the last added sku matches on a previously added sku. In this case, the sku that has the
merged items would be returned, so the total quantity of the OrderItem might not match exactly what was
just added.
findLastMatchingItem in interface OrderService@Transactional(value="blTransactionManager") public Order confirmOrder(Order order)
OrderService
confirmOrder in interface OrderServiceorder - to confirm
@Transactional(value="blTransactionManager")
public Order addAllItemsFromNamedOrder(Order namedOrder,
boolean priceOrder)
throws RemoveFromCartException,
AddToCartException
OrderServicesetMoveNamedOrderItems flag is set.
Note that any items that are in the wishlist but are no longer able to be added to a cart
will still be removed from the wishlist.
Note that this method does not change the association of the OrderItems to the new
order -- instead, those OrderItems is completely removed and a new OrderItem that mirrors
it is created.
addAllItemsFromNamedOrder in interface OrderServiceRemoveFromCartException
AddToCartException
@Transactional(value="blTransactionManager")
public Order addItemFromNamedOrder(Order namedOrder,
OrderItem item,
boolean priceOrder)
throws RemoveFromCartException,
AddToCartException
OrderServicesetMoveNamedOrderItems flag is set.
Note that if an item was in a wishlist and is no longer able to be added to the cart,
the item will still be removed from the wishlist.
Note that this method does not change the association of the OrderItems to the new
order -- instead, those OrderItems is completely removed and a new OrderItem that mirrors
it is created.
addItemFromNamedOrder in interface OrderServiceRemoveFromCartException
AddToCartException
@Transactional(value="blTransactionManager")
public Order addItemFromNamedOrder(Order namedOrder,
OrderItem item,
int quantity,
boolean priceOrder)
throws RemoveFromCartException,
AddToCartException,
UpdateCartException
OrderService
addItemFromNamedOrder in interface OrderServiceRemoveFromCartException
AddToCartException
UpdateCartExceptionOrderService.addItemFromNamedOrder(Order, OrderItem, boolean)
@Transactional(value="blTransactionManager")
public OrderItem addGiftWrapItemToOrder(Order order,
GiftWrapOrderItemRequest itemRequest,
boolean priceOrder)
throws PricingException
OrderService
addGiftWrapItemToOrder in interface OrderServicePricingException
@Transactional(value="blTransactionManager",
rollbackFor=AddToCartException.class)
public Order addItem(Long orderId,
OrderItemRequestDTO orderItemRequestDTO,
boolean priceOrder)
throws AddToCartException
OrderService
addItem in interface OrderServiceAddToCartExceptionOrderItemRequestDTO
@Transactional(value="blTransactionManager",
rollbackFor={UpdateCartException.class,RemoveFromCartException.class})
public Order updateItemQuantity(Long orderId,
OrderItemRequestDTO orderItemRequestDTO,
boolean priceOrder)
throws UpdateCartException,
RemoveFromCartException
OrderService
updateItemQuantity in interface OrderServiceUpdateCartException
RemoveFromCartExceptionOrderItemRequestDTO
@Transactional(value="blTransactionManager",
rollbackFor=RemoveFromCartException.class)
public Order removeItem(Long orderId,
Long orderItemId,
boolean priceOrder)
throws RemoveFromCartException
OrderService
removeItem in interface OrderServiceRemoveFromCartExceptionOrderItemRequestDTOpublic boolean getAutomaticallyMergeLikeItems()
getAutomaticallyMergeLikeItems in interface OrderServiceOrderService.setAutomaticallyMergeLikeItems(boolean)public void setAutomaticallyMergeLikeItems(boolean automaticallyMergeLikeItems)
OrderService
setAutomaticallyMergeLikeItems in interface OrderService
@ManagedAttribute(description="The move item from named order when adding to the cart attribute",
currencyTimeLimit=15)
public boolean isMoveNamedOrderItems()
isMoveNamedOrderItems in interface OrderServiceOrderService.setMoveNamedOrderItems(boolean)
@ManagedAttribute(description="The move item from named order when adding to the cart attribute",
currencyTimeLimit=15)
public void setMoveNamedOrderItems(boolean moveNamedOrderItems)
OrderService
setMoveNamedOrderItems in interface OrderService
@ManagedAttribute(description="The delete empty named order after adding items to cart attribute",
currencyTimeLimit=15)
public boolean isDeleteEmptyNamedOrders()
isDeleteEmptyNamedOrders in interface OrderServiceOrderService.setDeleteEmptyNamedOrders(boolean)@Transactional(value="blTransactionManager") public void removeAllPaymentsFromOrder(Order order)
OrderService
removeAllPaymentsFromOrder in interface OrderService
@Transactional(value="blTransactionManager")
public void removePaymentsFromOrder(Order order,
PaymentInfoType paymentInfoType)
OrderService
removePaymentsFromOrder in interface OrderServiceprotected Throwable getCartOperationExceptionRootCause(WorkflowException e)
e - the workflow exception that contains the requested root cause
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||