org.broadleafcommerce.core.order.service
Class FulfillmentGroupServiceImpl

java.lang.Object
  extended by org.broadleafcommerce.core.order.service.FulfillmentGroupServiceImpl
All Implemented Interfaces:
FulfillmentGroupService

@Service(value="blFulfillmentGroupService")
public class FulfillmentGroupServiceImpl
extends Object
implements FulfillmentGroupService


Field Summary
protected  FulfillmentGroupDao fulfillmentGroupDao
           
protected  FulfillmentGroupItemDao fulfillmentGroupItemDao
           
protected  OrderMultishipOptionService orderMultishipOptionService
           
protected  OrderService orderService
           
 
Constructor Summary
FulfillmentGroupServiceImpl()
           
 
Method Summary
 FulfillmentGroup addFulfillmentGroupToOrder(FulfillmentGroupRequest fulfillmentGroupRequest, boolean priceOrder)
           
 FulfillmentGroup addItemToFulfillmentGroup(FulfillmentGroupItemRequest fulfillmentGroupItemRequest, boolean priceOrder)
           
 FulfillmentGroup addItemToFulfillmentGroup(FulfillmentGroupItemRequest fulfillmentGroupItemRequest, boolean priceOrder, boolean save)
           
 Order collapseToOneShippableFulfillmentGroup(Order order, boolean priceOrder)
          Collapses all of the shippable fulfillment groups in the given order to the first shippable fulfillment group in the order.
 FulfillmentGroup createEmptyFulfillmentGroup()
           
 FulfillmentGroupFee createFulfillmentGroupFee()
           
protected  FulfillmentGroupItem createFulfillmentGroupItemFromOrderItem(OrderItem orderItem, FulfillmentGroup fulfillmentGroup, int quantity)
           
 void delete(FulfillmentGroup fulfillmentGroup)
           
 FulfillmentGroup findFulfillmentGroupById(Long fulfillmentGroupId)
           
 List<FulfillmentGroup> findFulfillmentGroupsByStatus(FulfillmentGroupStatusType status, int start, int maxResults)
          Reads FulfillmentGroups by status, ascending according to the date that the order was created.
 List<FulfillmentGroup> findFulfillmentGroupsByStatus(FulfillmentGroupStatusType status, int start, int maxResults, boolean ascending)
          Reads FulfillmentGroups by status, either ascending or descending according to the date that the order was created.
 List<FulfillmentGroup> findPartiallyFulfilledFulfillmentGroups(int start, int maxResults)
          Reads FulfillmentGroups whose status is PARTIALLY_FULFILLED or PARTIALLY_DELIVERED.
 List<FulfillmentGroup> findUnfulfilledFulfillmentGroups(int start, int maxResults)
          Reads FulfillmentGroups whose status is not FULFILLED or DELIVERED.
 List<FulfillmentGroup> findUnprocessedFulfillmentGroups(int start, int maxResults)
          Returns FulfillmentGroups whose status is null, or where no processing has yet occured.
 FulfillmentGroup getFirstShippableFulfillmentGroup(Order order)
          This method will get the first shippable fulfillment group from an order.
 List<FulfillmentGroupItem> getFulfillmentGroupItemsForOrderItem(Order order, OrderItem orderItem)
          Finds all FulfillmentGroupItems in the given Order that reference the given OrderItem.
protected  String getKey(Address address, FulfillmentOption option, FulfillmentType fulfillmentType)
           
 boolean isShippable(FulfillmentType fulfillmentType)
          Determines if a fulfillment group is shippable based on its fulfillment type.
 Order matchFulfillmentGroupsToMultishipOptions(Order order, boolean priceOrder)
          Associates shippable FulfillmentGroupItems in the given Order such that they match the structure of the OrderMultishipOptions associated with the given Order.
 Order removeAllFulfillmentGroupsFromOrder(Order order, boolean priceOrder)
           
 void removeOrderItemFromFullfillmentGroups(Order order, OrderItem orderItem)
          Removes every fulfillment group item in every fulfillment group in the order that is associated with the given orderItem.
 FulfillmentGroup save(FulfillmentGroup fulfillmentGroup)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fulfillmentGroupDao

protected FulfillmentGroupDao fulfillmentGroupDao

fulfillmentGroupItemDao

protected FulfillmentGroupItemDao fulfillmentGroupItemDao

orderService

protected OrderService orderService

orderMultishipOptionService

protected OrderMultishipOptionService orderMultishipOptionService
Constructor Detail

FulfillmentGroupServiceImpl

public FulfillmentGroupServiceImpl()
Method Detail

save

@Transactional(value="blTransactionManager")
public FulfillmentGroup save(FulfillmentGroup fulfillmentGroup)
Specified by:
save in interface FulfillmentGroupService

createEmptyFulfillmentGroup

public FulfillmentGroup createEmptyFulfillmentGroup()
Specified by:
createEmptyFulfillmentGroup in interface FulfillmentGroupService

findFulfillmentGroupById

public FulfillmentGroup findFulfillmentGroupById(Long fulfillmentGroupId)
Specified by:
findFulfillmentGroupById in interface FulfillmentGroupService

delete

@Transactional(value="blTransactionManager")
public void delete(FulfillmentGroup fulfillmentGroup)
Specified by:
delete in interface FulfillmentGroupService

addFulfillmentGroupToOrder

@Transactional(value="blTransactionManager")
public FulfillmentGroup addFulfillmentGroupToOrder(FulfillmentGroupRequest fulfillmentGroupRequest,
                                                                 boolean priceOrder)
                                            throws PricingException
Specified by:
addFulfillmentGroupToOrder in interface FulfillmentGroupService
Throws:
PricingException

addItemToFulfillmentGroup

public FulfillmentGroup addItemToFulfillmentGroup(FulfillmentGroupItemRequest fulfillmentGroupItemRequest,
                                                  boolean priceOrder)
                                           throws PricingException
Specified by:
addItemToFulfillmentGroup in interface FulfillmentGroupService
Throws:
PricingException

addItemToFulfillmentGroup

public FulfillmentGroup addItemToFulfillmentGroup(FulfillmentGroupItemRequest fulfillmentGroupItemRequest,
                                                  boolean priceOrder,
                                                  boolean save)
                                           throws PricingException
Specified by:
addItemToFulfillmentGroup in interface FulfillmentGroupService
Throws:
PricingException

getFulfillmentGroupItemsForOrderItem

public List<FulfillmentGroupItem> getFulfillmentGroupItemsForOrderItem(Order order,
                                                                       OrderItem orderItem)
Description copied from interface: FulfillmentGroupService
Finds all FulfillmentGroupItems in the given Order that reference the given OrderItem.

Specified by:
getFulfillmentGroupItemsForOrderItem in interface FulfillmentGroupService
Returns:
the list of related FulfillmentGroupItems

removeOrderItemFromFullfillmentGroups

@Transactional(value="blTransactionManager")
public void removeOrderItemFromFullfillmentGroups(Order order,
                                                                OrderItem orderItem)
Description copied from interface: FulfillmentGroupService
Removes every fulfillment group item in every fulfillment group in the order that is associated with the given orderItem. Note that it does not save the changes made - instead, the caller is responsible for saving the order further down.

Specified by:
removeOrderItemFromFullfillmentGroups in interface FulfillmentGroupService

collapseToOneShippableFulfillmentGroup

@Transactional(value="blTransactionManager")
public Order collapseToOneShippableFulfillmentGroup(Order order,
                                                                  boolean priceOrder)
                                             throws PricingException
Description copied from interface: FulfillmentGroupService
Collapses all of the shippable fulfillment groups in the given order to the first shippable fulfillment group in the order.

Specified by:
collapseToOneShippableFulfillmentGroup in interface FulfillmentGroupService
Returns:
the saved order
Throws:
PricingException
See Also:
FulfillmentGroupService.matchFulfillmentGroupsToMultishipOptions(Order, boolean)

matchFulfillmentGroupsToMultishipOptions

@Transactional(value="blTransactionManager")
public Order matchFulfillmentGroupsToMultishipOptions(Order order,
                                                                    boolean priceOrder)
                                               throws PricingException
Description copied from interface: FulfillmentGroupService
Associates shippable FulfillmentGroupItems in the given Order such that they match the structure of the OrderMultishipOptions associated with the given Order.

Specified by:
matchFulfillmentGroupsToMultishipOptions in interface FulfillmentGroupService
Returns:
the saved order
Throws:
PricingException
See Also:
OrderMultishipOption

getKey

protected String getKey(Address address,
                        FulfillmentOption option,
                        FulfillmentType fulfillmentType)

createFulfillmentGroupItemFromOrderItem

protected FulfillmentGroupItem createFulfillmentGroupItemFromOrderItem(OrderItem orderItem,
                                                                       FulfillmentGroup fulfillmentGroup,
                                                                       int quantity)

removeAllFulfillmentGroupsFromOrder

@Transactional(value="blTransactionManager")
public Order removeAllFulfillmentGroupsFromOrder(Order order,
                                                               boolean priceOrder)
                                          throws PricingException
Specified by:
removeAllFulfillmentGroupsFromOrder in interface FulfillmentGroupService
Throws:
PricingException

createFulfillmentGroupFee

public FulfillmentGroupFee createFulfillmentGroupFee()
Specified by:
createFulfillmentGroupFee in interface FulfillmentGroupService

findUnfulfilledFulfillmentGroups

public List<FulfillmentGroup> findUnfulfilledFulfillmentGroups(int start,
                                                               int maxResults)
Description copied from interface: FulfillmentGroupService
Reads FulfillmentGroups whose status is not FULFILLED or DELIVERED.

Specified by:
findUnfulfilledFulfillmentGroups in interface FulfillmentGroupService
Returns:

findPartiallyFulfilledFulfillmentGroups

public List<FulfillmentGroup> findPartiallyFulfilledFulfillmentGroups(int start,
                                                                      int maxResults)
Description copied from interface: FulfillmentGroupService
Reads FulfillmentGroups whose status is PARTIALLY_FULFILLED or PARTIALLY_DELIVERED.

Specified by:
findPartiallyFulfilledFulfillmentGroups in interface FulfillmentGroupService
Returns:

findUnprocessedFulfillmentGroups

public List<FulfillmentGroup> findUnprocessedFulfillmentGroups(int start,
                                                               int maxResults)
Description copied from interface: FulfillmentGroupService
Returns FulfillmentGroups whose status is null, or where no processing has yet occured. Default returns in ascending order according to date that the order was created.

Specified by:
findUnprocessedFulfillmentGroups in interface FulfillmentGroupService
Returns:

findFulfillmentGroupsByStatus

public List<FulfillmentGroup> findFulfillmentGroupsByStatus(FulfillmentGroupStatusType status,
                                                            int start,
                                                            int maxResults,
                                                            boolean ascending)
Description copied from interface: FulfillmentGroupService
Reads FulfillmentGroups by status, either ascending or descending according to the date that the order was created.

Specified by:
findFulfillmentGroupsByStatus in interface FulfillmentGroupService
Returns:

findFulfillmentGroupsByStatus

public List<FulfillmentGroup> findFulfillmentGroupsByStatus(FulfillmentGroupStatusType status,
                                                            int start,
                                                            int maxResults)
Description copied from interface: FulfillmentGroupService
Reads FulfillmentGroups by status, ascending according to the date that the order was created.

Specified by:
findFulfillmentGroupsByStatus in interface FulfillmentGroupService
Returns:

isShippable

public boolean isShippable(FulfillmentType fulfillmentType)
Description copied from interface: FulfillmentGroupService
Determines if a fulfillment group is shippable based on its fulfillment type.

Specified by:
isShippable in interface FulfillmentGroupService
Returns:

getFirstShippableFulfillmentGroup

public FulfillmentGroup getFirstShippableFulfillmentGroup(Order order)
This method will get the first shippable fulfillment group from an order.

Specified by:
getFirstShippableFulfillmentGroup in interface FulfillmentGroupService
Parameters:
order -


Copyright © 2013. All Rights Reserved.