Class DefaultCartServiceForAccelerator
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.service.AbstractService
-
- de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
-
- de.hybris.platform.order.impl.DefaultAbstractOrderService<CartModel,CartEntryModel>
-
- de.hybris.platform.order.impl.DefaultCartService
-
- de.hybris.platform.acceleratorservices.order.impl.DefaultCartServiceForAccelerator
-
- All Implemented Interfaces:
AbstractOrderService<CartModel,CartEntryModel>,CartService,java.io.Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
public class DefaultCartServiceForAccelerator extends DefaultCartService
Override addNewEntry method fromAbstractOrderServicefor adding new entry/update entries to cart.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
AbstractService.SerializableDTO
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.order.impl.DefaultCartService
SESSION_CART_PARAMETER_NAME
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManager
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant
-
-
Constructor Summary
Constructors Constructor Description DefaultCartServiceForAccelerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractOrderEntryModeladdNewEntry(ComposedTypeModel entryType, CartModel order, ProductModel product, long qty, UnitModel unit, int number, boolean addToPresent)Adds a new entry of the givenComposedTypeModelto the given order.protected voidcheckQuantity(long qty, int number)protected AbstractOrderEntryModelgetAbstractOrderEntryModel(CartModel order, ProductModel product, long qty, int number, boolean addToPresent, UnitModel usedUnit)protected booleanisNotGiveAwayAndHasEqualUnit(CartEntryModel cartEntry, UnitModel usedUnit)protected booleanisPOSNotNullAndHasEqualEntryNumber(CartEntryModel cartEntry, int number)protected booleanisPOSNullAndAppendAsLast(CartEntryModel cartEntry, int number)-
Methods inherited from class de.hybris.platform.order.impl.DefaultCartService
addToCart, appendToCart, calculateCart, changeCurrentCartUser, changeSessionCartCurrency, clone, createCartFromQuote, getCreateCartFromQuoteStrategy, getNextEntryNumber, getSessionCart, hasCart, hasSessionCart, internalGetSessionCart, postProcessClonedEntries, removeSessionCart, setAddToCartStrategy, setCartFactory, setCreateCartFromQuoteStrategy, setOrderCalculation, setSessionCart, updateQuantities, updateQuantities
-
Methods inherited from class de.hybris.platform.order.impl.DefaultAbstractOrderService
addAllGlobalDiscountValues, addAllTotalTaxValues, addEntryAtPosition, addGlobalDiscountValue, addNewEntry, addNewEntry, addTotalTaxValue, getAbstractOrderEntryService, getAbstractOrderEntryTypeService, getCloneAbstractOrderStrategy, getCollidingEntry, getEntriesForNumber, getEntriesForProduct, getEntryForNumber, getEntryTypeCode, getGlobalDiscountValue, getOrderDao, getSaveAbstractOrderStrategy, removeGlobalDiscountValue, removeTotalTaxValue, saveOrder, setAbstractOrderEntryService, setAbstractOrderEntryTypeService, setCloneAbstractOrderStrategy, setOrderDao, setSaveAbstractOrderStrategy
-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManager
-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.order.AbstractOrderService
addAllGlobalDiscountValues, addAllTotalTaxValues, addGlobalDiscountValue, addNewEntry, addNewEntry, addTotalTaxValue, getEntriesForNumber, getEntriesForProduct, getEntryForNumber, getGlobalDiscountValue, removeGlobalDiscountValue, removeTotalTaxValue, saveOrder
-
-
-
-
Method Detail
-
addNewEntry
public AbstractOrderEntryModel addNewEntry(ComposedTypeModel entryType, CartModel order, ProductModel product, long qty, UnitModel unit, int number, boolean addToPresent)
Description copied from interface:AbstractOrderServiceAdds a new entry of the givenComposedTypeModelto the given order. The new entry is neither saved nor calculated. If your new entry has caused entries shuffling you may need to callAbstractOrderService.saveOrder(AbstractOrderModel)method in order to persist the changes.- Specified by:
addNewEntryin interfaceAbstractOrderService<CartModel,CartEntryModel>- Overrides:
addNewEntryin classDefaultAbstractOrderService<CartModel,CartEntryModel>- Parameters:
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 created- Returns:
AbstractOrderEntryModel- newly created order entry
-
getAbstractOrderEntryModel
protected AbstractOrderEntryModel getAbstractOrderEntryModel(CartModel order, ProductModel product, long qty, int number, boolean addToPresent, UnitModel usedUnit)
-
isPOSNotNullAndHasEqualEntryNumber
protected boolean isPOSNotNullAndHasEqualEntryNumber(CartEntryModel cartEntry, int number)
-
isPOSNullAndAppendAsLast
protected boolean isPOSNullAndAppendAsLast(CartEntryModel cartEntry, int number)
-
isNotGiveAwayAndHasEqualUnit
protected boolean isNotGiveAwayAndHasEqualUnit(CartEntryModel cartEntry, UnitModel usedUnit)
-
checkQuantity
protected void checkQuantity(long qty, int number)
-
-