public class DefaultOrderService extends DefaultAbstractOrderService<OrderModel,OrderEntryModel> implements OrderService
OrderService.AbstractService.SerializableDTOmodelService, sessionService, txManagertenant| Constructor and Description |
|---|
DefaultOrderService() |
| Modifier and Type | Method and Description |
|---|---|
AbstractOrderEntryModel |
addNewEntry(ComposedTypeModel entryType,
OrderModel order,
ProductModel product,
long qty,
UnitModel unit,
int number,
boolean addToPresent)
Adds a new entry of the given
ComposedTypeModel to the given order. |
OrderEntryModel |
addNewEntry(OrderModel order,
ProductModel product,
long qty,
UnitModel unit,
int number,
boolean addToPresent)
Adds a new entry to the given order on the required entry number.
|
boolean |
calculateOrder(AbstractOrderModel order)
Deprecated.
since ages
|
OrderModel |
clone(ComposedTypeModel orderType,
ComposedTypeModel entryType,
AbstractOrderModel original,
java.lang.String code)
Creates new order from given original and change its type and type for entry.
|
OrderModel |
createOrderFromCart(CartModel cart)
Create the order for the given
cart. |
OrderModel |
placeOrder(CartModel cart,
AddressModel deliveryAddress,
AddressModel paymentAddress,
PaymentInfoModel paymentInfo)
Deprecated.
since ages
|
void |
setCreateOrderFromCartStrategy(CreateOrderFromCartStrategy submitOrderStrategy) |
void |
setOrderCalculation(OrderCalculation orderCalculation)
Deprecated.
since ages
|
void |
setPlaceOrderStrategy(PlaceOrderStrategy placeOrderStrategy)
Deprecated.
since ages
|
void |
setSubmitOrderStrategies(java.util.List<SubmitOrderStrategy> submitOrderStrategies) |
void |
submitOrder(OrderModel order)
Submits an order.
|
addAllGlobalDiscountValues, addAllTotalTaxValues, addEntryAtPosition, addGlobalDiscountValue, addNewEntry, addTotalTaxValue, getAbstractOrderEntryService, getAbstractOrderEntryTypeService, getCloneAbstractOrderStrategy, getCollidingEntry, getEntriesForNumber, getEntriesForProduct, getEntryForNumber, getEntryTypeCode, getGlobalDiscountValue, getOrderDao, getSaveAbstractOrderStrategy, removeGlobalDiscountValue, removeTotalTaxValue, saveOrder, setAbstractOrderEntryService, setAbstractOrderEntryTypeService, setCloneAbstractOrderStrategy, setOrderDao, setSaveAbstractOrderStrategygetModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerafterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplaceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddAllGlobalDiscountValues, addAllTotalTaxValues, addGlobalDiscountValue, addNewEntry, addTotalTaxValue, getEntriesForNumber, getEntriesForProduct, getEntryForNumber, getGlobalDiscountValue, removeGlobalDiscountValue, removeTotalTaxValue, saveOrderpublic OrderModel createOrderFromCart(CartModel cart) throws InvalidCartException
OrderServicecart. This method focuses on creating an OrderModel instance
from the given CartModel instance. The order instance remains unsaved and not calculated. This method
does nothing with the cart member attributes (addresses, paymentInfo). It also leaves the target cart untouched.
If you want to calculate cart or order, use CalculationService.createOrderFromCart in interface OrderServicecart - the target CartModelOrderModelInvalidCartException - if the cart is invalid according to the used CartValidator.public void submitOrder(OrderModel order)
OrderServiceEventPublishingSubmitOrderStrategy fires SubmitOrderEvent.submitOrder in interface OrderServiceorder - Order to submit.@Deprecated public OrderModel placeOrder(CartModel cart, AddressModel deliveryAddress, AddressModel paymentAddress, PaymentInfoModel paymentInfo) throws InvalidCartException
OrderServicecart. This means: first the cart is calculated (see
OrderService.calculateOrder(AbstractOrderModel) than (if not null) the
deliveryAddress and paymentAddress and paymentInfo are stored for the
current session user and also to the cart. After this from the cart an OrderModel is created
and the cart is removed from the session.placeOrder in interface OrderServicecart - the CartModeldeliveryAddress - the delivery AddressModel for the current session user. Can be null.paymentAddress - the payment AddressModel for the current session user. Can be null.paymentInfo - the PaymentInfoModel for the current session user. Can be null.OrderModelInvalidCartException@Deprecated public boolean calculateOrder(AbstractOrderModel order)
OrderServiceorder and returns true if each entry and after this the
AbstractOrderModel was calculated. Thereby any invalid entry will be automatically removed.
The default implementation delegates to the OrderCalculation.calculate(AbstractOrderModel) strategy.
Please check the API doc of your current calculation strategy.calculateOrder in interface OrderServiceorder - the AbstractOrderModelfalse if the order was already calculated.@Deprecated public void setPlaceOrderStrategy(PlaceOrderStrategy placeOrderStrategy)
@Deprecated public void setOrderCalculation(OrderCalculation orderCalculation)
public void setCreateOrderFromCartStrategy(CreateOrderFromCartStrategy submitOrderStrategy)
public void setSubmitOrderStrategies(java.util.List<SubmitOrderStrategy> submitOrderStrategies)
public OrderModel clone(ComposedTypeModel orderType, ComposedTypeModel entryType, AbstractOrderModel original, java.lang.String code)
AbstractOrderServiceCloneAbstractOrderStrategy injected strategy. Resulting order remains not persisted.clone in interface AbstractOrderService<OrderModel,OrderEntryModel>orderType - type of result order (OrderModel will be chosen if null is passed)entryType - type of entry (if null will use service to get proper type)original - original ordercode - code for new orderpublic OrderEntryModel addNewEntry(OrderModel order, ProductModel product, long qty, UnitModel unit, int number, boolean addToPresent)
AbstractOrderServiceAbstractOrderEntryTypeService and the spring configuration behind it. The new entry is neither saved nor
calculated. If your new entry has caused entries shuffling you may need to call
AbstractOrderService.saveOrder(AbstractOrderModel) method in order to persist the changes.addNewEntry in interface AbstractOrderService<OrderModel,OrderEntryModel>addNewEntry in interface OrderServiceaddNewEntry in class DefaultAbstractOrderService<OrderModel,OrderEntryModel>order - - target orderproduct - -product to add, must not be nullqty - - quantityunit - - must not be nullnumber - - entry number of the new entry in the order. Entries are indexed starting from 0. Set number to -1 if
you want to append the entry as the last one. You can request any non-negative position.addToPresent - - if true an existing entry with matching product and unit will get its quantity increased;
otherwise a new entry is createdAbstractOrderEntryModel - newly created order entryAbstractOrderEntryTypeService.getAbstractOrderEntryType(AbstractOrderModel)public AbstractOrderEntryModel addNewEntry(ComposedTypeModel entryType, OrderModel order, ProductModel product, long qty, UnitModel unit, int number, boolean addToPresent)
AbstractOrderServiceComposedTypeModel to the given order. The new entry is neither saved nor
calculated. If your new entry has caused entries shuffling you may need to call
AbstractOrderService.saveOrder(AbstractOrderModel) method in order to persist the changes.addNewEntry in interface AbstractOrderService<OrderModel,OrderEntryModel>addNewEntry in interface OrderServiceaddNewEntry in class DefaultAbstractOrderService<OrderModel,OrderEntryModel>entryType - - the requested sub-type AbstractOrderEntryorder - - target orderproduct - -product to add, must not be nullqty - - quantityunit - - must not be nullnumber - - entry number of the new entry in the order. Entries are indexed starting from 0. Set number to -1 if
you want to append the entry as the last one. You can request any non-negative position.addToPresent - - if true an existing entry with matching product and unit will get its quantity increased;
otherwise a new entry is createdAbstractOrderEntryModel - newly created order entryCopyright © 2018 SAP SE. All Rights Reserved.