Class FulfillmentGroupServiceImpl
java.lang.Object
org.broadleafcommerce.core.order.service.FulfillmentGroupServiceImpl
- All Implemented Interfaces:
FulfillmentGroupService
@Service("blFulfillmentGroupService")
public class FulfillmentGroupServiceImpl
extends Object
implements FulfillmentGroupService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FulfillmentGroupDaoprotected FulfillmentGroupItemDaoprotected OrderMultishipOptionServiceprotected OrderService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddFulfillmentGroupToOrder(FulfillmentGroupRequest fulfillmentGroupRequest, boolean priceOrder) addItemToFulfillmentGroup(FulfillmentGroupItemRequest fulfillmentGroupItemRequest, boolean priceOrder) addItemToFulfillmentGroup(FulfillmentGroupItemRequest fulfillmentGroupItemRequest, boolean priceOrder, boolean save) 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.protected FulfillmentGroupItemcreateFulfillmentGroupItemFromOrderItem(OrderItem orderItem, FulfillmentGroup fulfillmentGroup, int quantity) voiddelete(FulfillmentGroup fulfillmentGroup) findFulfillmentGroupById(Long fulfillmentGroupId) findFulfillmentGroupsByStatus(FulfillmentGroupStatusType status, int start, int maxResults) Reads FulfillmentGroups by status, ascending according to the date that the order was created.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.findPartiallyFulfilledFulfillmentGroups(int start, int maxResults) Reads FulfillmentGroups whose status is PARTIALLY_FULFILLED or PARTIALLY_DELIVERED.findUnfulfilledFulfillmentGroups(int start, int maxResults) Reads FulfillmentGroups whose status is not FULFILLED or DELIVERED.findUnprocessedFulfillmentGroups(int start, int maxResults) Returns FulfillmentGroups whose status is null, or where no processing has yet occured.Returns all of the shippable fulfillment groups for an orderThis method will get the first shippable fulfillment group from an order.getFulfillmentGroupItemsForOrderItem(Order order, OrderItem orderItem) Finds all FulfillmentGroupItems in the given Order that reference the given OrderItem.protected StringgetKey(org.broadleafcommerce.profile.core.domain.Address address, FulfillmentOption option, FulfillmentType fulfillmentType) booleanisShippable(FulfillmentType fulfillmentType) Determines if a fulfillment group is shippable based on its fulfillment type.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.removeAllFulfillmentGroupsFromOrder(Order order, boolean priceOrder) voidremoveOrderItemFromFullfillmentGroups(Order order, OrderItem orderItem) Removes every fulfillment group item in every fulfillment group in the order that is associated with the given orderItem.save(FulfillmentGroup fulfillmentGroup)
-
Field Details
-
fulfillmentGroupDao
-
fulfillmentGroupItemDao
-
orderService
-
orderMultishipOptionService
-
-
Constructor Details
-
FulfillmentGroupServiceImpl
public FulfillmentGroupServiceImpl()
-
-
Method Details
-
save
@Transactional("blTransactionManager") public FulfillmentGroup save(FulfillmentGroup fulfillmentGroup) - Specified by:
savein interfaceFulfillmentGroupService
-
createEmptyFulfillmentGroup
- Specified by:
createEmptyFulfillmentGroupin interfaceFulfillmentGroupService
-
findFulfillmentGroupById
- Specified by:
findFulfillmentGroupByIdin interfaceFulfillmentGroupService
-
delete
- Specified by:
deletein interfaceFulfillmentGroupService
-
addFulfillmentGroupToOrder
@Transactional("blTransactionManager") public FulfillmentGroup addFulfillmentGroupToOrder(FulfillmentGroupRequest fulfillmentGroupRequest, boolean priceOrder) throws PricingException - Specified by:
addFulfillmentGroupToOrderin interfaceFulfillmentGroupService- Throws:
PricingException
-
addItemToFulfillmentGroup
public FulfillmentGroup addItemToFulfillmentGroup(FulfillmentGroupItemRequest fulfillmentGroupItemRequest, boolean priceOrder) throws PricingException - Specified by:
addItemToFulfillmentGroupin interfaceFulfillmentGroupService- Throws:
PricingException
-
addItemToFulfillmentGroup
public FulfillmentGroup addItemToFulfillmentGroup(FulfillmentGroupItemRequest fulfillmentGroupItemRequest, boolean priceOrder, boolean save) throws PricingException - Specified by:
addItemToFulfillmentGroupin interfaceFulfillmentGroupService- Throws:
PricingException
-
getFulfillmentGroupItemsForOrderItem
public List<FulfillmentGroupItem> getFulfillmentGroupItemsForOrderItem(Order order, OrderItem orderItem) Description copied from interface:FulfillmentGroupServiceFinds all FulfillmentGroupItems in the given Order that reference the given OrderItem.- Specified by:
getFulfillmentGroupItemsForOrderItemin interfaceFulfillmentGroupService- Returns:
- the list of related FulfillmentGroupItems
-
removeOrderItemFromFullfillmentGroups
@Transactional("blTransactionManager") public void removeOrderItemFromFullfillmentGroups(Order order, OrderItem orderItem) Description copied from interface:FulfillmentGroupServiceRemoves 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:
removeOrderItemFromFullfillmentGroupsin interfaceFulfillmentGroupService
-
collapseToOneShippableFulfillmentGroup
@Transactional("blTransactionManager") public Order collapseToOneShippableFulfillmentGroup(Order order, boolean priceOrder) throws PricingException Description copied from interface:FulfillmentGroupServiceCollapses all of the shippable fulfillment groups in the given order to the first shippable fulfillment group in the order.- Specified by:
collapseToOneShippableFulfillmentGroupin interfaceFulfillmentGroupService- Returns:
- the saved order
- Throws:
PricingException- See Also:
-
matchFulfillmentGroupsToMultishipOptions
@Transactional("blTransactionManager") public Order matchFulfillmentGroupsToMultishipOptions(Order order, boolean priceOrder) throws PricingException Description copied from interface:FulfillmentGroupServiceAssociates shippable FulfillmentGroupItems in the given Order such that they match the structure of the OrderMultishipOptions associated with the given Order.- Specified by:
matchFulfillmentGroupsToMultishipOptionsin interfaceFulfillmentGroupService- Returns:
- the saved order
- Throws:
PricingException- See Also:
-
getKey
protected String getKey(org.broadleafcommerce.profile.core.domain.Address address, FulfillmentOption option, FulfillmentType fulfillmentType) -
createFulfillmentGroupItemFromOrderItem
protected FulfillmentGroupItem createFulfillmentGroupItemFromOrderItem(OrderItem orderItem, FulfillmentGroup fulfillmentGroup, int quantity) -
removeAllFulfillmentGroupsFromOrder
@Transactional("blTransactionManager") public Order removeAllFulfillmentGroupsFromOrder(Order order, boolean priceOrder) throws PricingException - Specified by:
removeAllFulfillmentGroupsFromOrderin interfaceFulfillmentGroupService- Throws:
PricingException
-
createFulfillmentGroupFee
- Specified by:
createFulfillmentGroupFeein interfaceFulfillmentGroupService
-
findUnfulfilledFulfillmentGroups
Description copied from interface:FulfillmentGroupServiceReads FulfillmentGroups whose status is not FULFILLED or DELIVERED.- Specified by:
findUnfulfilledFulfillmentGroupsin interfaceFulfillmentGroupService- Returns:
-
findPartiallyFulfilledFulfillmentGroups
Description copied from interface:FulfillmentGroupServiceReads FulfillmentGroups whose status is PARTIALLY_FULFILLED or PARTIALLY_DELIVERED.- Specified by:
findPartiallyFulfilledFulfillmentGroupsin interfaceFulfillmentGroupService- Returns:
-
findUnprocessedFulfillmentGroups
Description copied from interface:FulfillmentGroupServiceReturns 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:
findUnprocessedFulfillmentGroupsin interfaceFulfillmentGroupService- Returns:
-
findFulfillmentGroupsByStatus
public List<FulfillmentGroup> findFulfillmentGroupsByStatus(FulfillmentGroupStatusType status, int start, int maxResults, boolean ascending) Description copied from interface:FulfillmentGroupServiceReads FulfillmentGroups by status, either ascending or descending according to the date that the order was created.- Specified by:
findFulfillmentGroupsByStatusin interfaceFulfillmentGroupService- Returns:
-
findFulfillmentGroupsByStatus
public List<FulfillmentGroup> findFulfillmentGroupsByStatus(FulfillmentGroupStatusType status, int start, int maxResults) Description copied from interface:FulfillmentGroupServiceReads FulfillmentGroups by status, ascending according to the date that the order was created.- Specified by:
findFulfillmentGroupsByStatusin interfaceFulfillmentGroupService- Returns:
-
isShippable
Description copied from interface:FulfillmentGroupServiceDetermines if a fulfillment group is shippable based on its fulfillment type.- Specified by:
isShippablein interfaceFulfillmentGroupService- Returns:
-
getFirstShippableFulfillmentGroup
This method will get the first shippable fulfillment group from an order.- Specified by:
getFirstShippableFulfillmentGroupin interfaceFulfillmentGroupService- Parameters:
order-- See Also:
-
getAllShippableFulfillmentGroups
Description copied from interface:FulfillmentGroupServiceReturns all of the shippable fulfillment groups for an order- Specified by:
getAllShippableFulfillmentGroupsin interfaceFulfillmentGroupService- See Also:
-
calculateNumShippableFulfillmentGroups
- Specified by:
calculateNumShippableFulfillmentGroupsin interfaceFulfillmentGroupService- Returns:
-