Class WarehousingAvailabilityCalculationStrategy
- java.lang.Object
-
- de.hybris.platform.commerceservices.stock.strategies.impl.DefaultCommerceAvailabilityCalculationStrategy
-
- de.hybris.platform.warehousing.atp.strategy.impl.WarehousingAvailabilityCalculationStrategy
-
- All Implemented Interfaces:
CommerceAvailabilityCalculationStrategy
public class WarehousingAvailabilityCalculationStrategy extends DefaultCommerceAvailabilityCalculationStrategy
Warehousing implementation ofCommerceAvailabilityCalculationStrategy
-
-
Constructor Summary
Constructors Constructor Description WarehousingAvailabilityCalculationStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.LongcalculateAvailability(java.util.Collection<StockLevelModel> stockLevels)protected java.util.Collection<StockLevelModel>filterStockLevels(java.util.Collection<StockLevelModel> stockLevels)Removes theStockLevelModel(s) that are either forced out of stock Or if they belong to cancelledAdvancedShippingNoticeModelprotected java.util.Collection<StockLevelModel>filterStockLevelsExternal(java.util.Collection<StockLevelModel> stockLevels)Filters the stock level that are externalprotected java.util.Collection<StockLevelModel>filterStockLevelsReturned(java.util.Collection<StockLevelModel> stockLevels)Filters the stock level that are returned binsprotected java.util.Map<java.lang.String,java.lang.Object>filterStocks(java.util.Collection<StockLevelModel> stockLevels, AtpFormulaModel atpFormula)Filters theStockLevelModel(s) based on givenAtpFormulaModelprotected AtpFormulaServicegetAtpFormulaService()protected BaseStoreServicegetBaseStoreService()protected AtpFormulaModelgetDefaultAtpFormula(java.util.Collection<StockLevelModel> stockLevels)Gets the default ATP formula based on the current basestore or from the first stock level of the given listprotected RestockConfigServicegetRestockConfigService()voidsetAtpFormulaService(AtpFormulaService atpFormulaService)voidsetBaseStoreService(BaseStoreService baseStoreService)voidsetRestockConfigService(RestockConfigService restockConfigService)-
Methods inherited from class de.hybris.platform.commerceservices.stock.strategies.impl.DefaultCommerceAvailabilityCalculationStrategy
getAvailableToSellQuantity
-
-
-
-
Method Detail
-
calculateAvailability
public java.lang.Long calculateAvailability(java.util.Collection<StockLevelModel> stockLevels)
- Specified by:
calculateAvailabilityin interfaceCommerceAvailabilityCalculationStrategy- Overrides:
calculateAvailabilityin classDefaultCommerceAvailabilityCalculationStrategy
-
getDefaultAtpFormula
protected AtpFormulaModel getDefaultAtpFormula(java.util.Collection<StockLevelModel> stockLevels)
Gets the default ATP formula based on the current basestore or from the first stock level of the given list- Parameters:
stockLevels- the list of stock levels from where to retrieve the default base store in case the current basestore is unknown- Returns:
- the default ATP formula
-
filterStocks
protected java.util.Map<java.lang.String,java.lang.Object> filterStocks(java.util.Collection<StockLevelModel> stockLevels, AtpFormulaModel atpFormula)
Filters theStockLevelModel(s) based on givenAtpFormulaModel- Parameters:
stockLevels-StockLevelModelto be filteredatpFormula-AtpFormulaModelthe formula to filter the stocks- Returns:
- A map that contains filtered stocklevels
-
filterStockLevels
protected java.util.Collection<StockLevelModel> filterStockLevels(java.util.Collection<StockLevelModel> stockLevels)
Removes theStockLevelModel(s) that are either forced out of stock Or if they belong to cancelledAdvancedShippingNoticeModel- Parameters:
stockLevels- the stock levels to filter- Returns:
- the filtered stock levels
-
filterStockLevelsReturned
protected java.util.Collection<StockLevelModel> filterStockLevelsReturned(java.util.Collection<StockLevelModel> stockLevels)
Filters the stock level that are returned bins- Parameters:
stockLevels- theStockLevelModelto filter- Returns:
- the filtered stock levels (i.e levels that are returned bins)
-
filterStockLevelsExternal
protected java.util.Collection<StockLevelModel> filterStockLevelsExternal(java.util.Collection<StockLevelModel> stockLevels)
Filters the stock level that are external- Parameters:
stockLevels- theStockLevelModelto filter- Returns:
- the external stocklevels
-
getAtpFormulaService
protected AtpFormulaService getAtpFormulaService()
-
setAtpFormulaService
public void setAtpFormulaService(AtpFormulaService atpFormulaService)
-
getRestockConfigService
protected RestockConfigService getRestockConfigService()
-
setRestockConfigService
public void setRestockConfigService(RestockConfigService restockConfigService)
-
getBaseStoreService
protected BaseStoreService getBaseStoreService()
-
setBaseStoreService
public void setBaseStoreService(BaseStoreService baseStoreService)
-
-