Class OrderMultishipOptionServiceImpl
java.lang.Object
org.broadleafcommerce.core.order.service.OrderMultishipOptionServiceImpl
- All Implemented Interfaces:
OrderMultishipOptionService
@Service("blOrderMultishipOptionService")
public class OrderMultishipOptionServiceImpl
extends Object
implements OrderMultishipOptionService
- Author:
- Andre Azzolini (apazzolini)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.broadleafcommerce.profile.core.service.AddressServiceprotected FulfillmentGroupServiceprotected FulfillmentOptionServiceprotected OrderItemService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate()Creates a new instance of the OrderMultishipOption.protected List<OrderMultishipOption>createPopulatedOrderMultishipOption(Order order, DiscreteOrderItem item, Integer quantity) voidRemoves all OrderMultishipOptions for this Order permanently.voiddeleteOrderItemOrderMultishipOptions(Long orderItemId) Removes all OrderMultishipOptions associated with the OrderItem represented by this orderItemId permanently.voiddeleteOrderItemOrderMultishipOptions(Long orderItemId, int numToDelete) Removes up to numToDelete OrderMultishipOptions associated with the OrderItem represented by this orderItemId permanently.findOrderItemOrderMultishipOptions(Long orderItemId) Finds all OrderMultishipOptions associated with the given Order Item based on the order item idfindOrderMultishipOptions(Long orderId) Finds all OrderMultishipOptions associated with the given Order based on the orderIdGenerates the blank set of OrderMultishipOptions for a given order.getOrderMultishipOptionsFromDTOs(Order order, List<OrderMultishipOptionDTO> optionDtos) Given the (potetially only partially filled out) OrderMultishipOptionDTO objects, builds out the associated OrderMultishipOption objects.If this order has associated OrderMultishipOptions, this method will return those options.save(OrderMultishipOption orderMultishipOption) Saves the given OrderMultishipOption and returns the saved entityvoidsaveOrderMultishipOptions(Order order, List<OrderMultishipOptionDTO> optionDTOs) Associates the appropriate objects based on the OrderMultishipOptionDTOs to OrderMultishipOption instances, associates them with the given order, and saves the set.
-
Field Details
-
addressService
protected org.broadleafcommerce.profile.core.service.AddressService addressService -
orderItemService
-
fulfillmentOptionService
-
fulfillmentGroupService
-
-
Constructor Details
-
OrderMultishipOptionServiceImpl
public OrderMultishipOptionServiceImpl()
-
-
Method Details
-
save
Description copied from interface:OrderMultishipOptionServiceSaves the given OrderMultishipOption and returns the saved entity- Specified by:
savein interfaceOrderMultishipOptionService- Returns:
- the saved entity
-
findOrderMultishipOptions
Description copied from interface:OrderMultishipOptionServiceFinds all OrderMultishipOptions associated with the given Order based on the orderId- Specified by:
findOrderMultishipOptionsin interfaceOrderMultishipOptionService- Parameters:
orderId- the order id to find OrderMultishipOptions for- Returns:
- the associated OrderMultishipOptions
-
findOrderItemOrderMultishipOptions
Description copied from interface:OrderMultishipOptionServiceFinds all OrderMultishipOptions associated with the given Order Item based on the order item id- Specified by:
findOrderItemOrderMultishipOptionsin interfaceOrderMultishipOptionService- Parameters:
orderItemId- the orderItem id to find OrderMultishipOptions for- Returns:
- the associated OrderMultishipOptions
-
create
Description copied from interface:OrderMultishipOptionServiceCreates a new instance of the OrderMultishipOption. The default Broadleaf implementation will create an instance based on what is configured in the EntityConfiguration.- Specified by:
createin interfaceOrderMultishipOptionService- Returns:
- the newly created OrderMultishipOption
-
deleteOrderItemOrderMultishipOptions
Description copied from interface:OrderMultishipOptionServiceRemoves all OrderMultishipOptions associated with the OrderItem represented by this orderItemId permanently.- Specified by:
deleteOrderItemOrderMultishipOptionsin interfaceOrderMultishipOptionService
-
deleteOrderItemOrderMultishipOptions
Description copied from interface:OrderMultishipOptionServiceRemoves up to numToDelete OrderMultishipOptions associated with the OrderItem represented by this orderItemId permanently.- Specified by:
deleteOrderItemOrderMultishipOptionsin interfaceOrderMultishipOptionServicenumToDelete- the maximum number of occurrences of this orderItemId to delete- See Also:
-
deleteAllOrderMultishipOptions
Description copied from interface:OrderMultishipOptionServiceRemoves all OrderMultishipOptions for this Order permanently.- Specified by:
deleteAllOrderMultishipOptionsin interfaceOrderMultishipOptionService
-
saveOrderMultishipOptions
Description copied from interface:OrderMultishipOptionServiceAssociates the appropriate objects based on the OrderMultishipOptionDTOs to OrderMultishipOption instances, associates them with the given order, and saves the set.Note that this method will clear any previously saved OrderMultishipOptions for the requested order before performing the save.
- Specified by:
saveOrderMultishipOptionsin interfaceOrderMultishipOptionService
-
getOrGenerateOrderMultishipOptions
Description copied from interface:OrderMultishipOptionServiceIf this order has associated OrderMultishipOptions, this method will return those options. If there are items in the order that do not have associated options, options for those items will be generated and attached to the existing options.- Specified by:
getOrGenerateOrderMultishipOptionsin interfaceOrderMultishipOptionService- Returns:
- the OrderMultishipOptions for this Order
- See Also:
-
getOrderMultishipOptionsFromDTOs
public List<OrderMultishipOption> getOrderMultishipOptionsFromDTOs(Order order, List<OrderMultishipOptionDTO> optionDtos) Description copied from interface:OrderMultishipOptionServiceGiven the (potetially only partially filled out) OrderMultishipOptionDTO objects, builds out the associated OrderMultishipOption objects. This is done by looking up the non-null fields in the optionDtos for their associated entity.Note that the only potentially null fields are address and location ids.
- Specified by:
getOrderMultishipOptionsFromDTOsin interfaceOrderMultishipOptionService- Returns:
- the associated OrderMultishipOptions
-
generateOrderMultishipOptions
Description copied from interface:OrderMultishipOptionServiceGenerates the blank set of OrderMultishipOptions for a given order. Note that the default Broadleaf implementation splits up all DiscreteOrderItems in the given order into instances of OrderMultishipOption such that each instance assumes its quantity is one. Also note that this will not set the Address or the FulfillmentOption for any of the generated options.- Specified by:
generateOrderMultishipOptionsin interfaceOrderMultishipOptionService- Parameters:
order- the order to generate OrderMultishipOptions for- Returns:
- the OrderMultishipOptions generated for the Order.
-
createPopulatedOrderMultishipOption
protected List<OrderMultishipOption> createPopulatedOrderMultishipOption(Order order, DiscreteOrderItem item, Integer quantity)
-