Class DefaultAtpFormulaService
java.lang.Object
de.hybris.platform.warehousing.atp.formula.services.impl.DefaultAtpFormulaService
- All Implemented Interfaces:
AtpFormulaService
Default implementation of
AtpFormulaService-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAppends the result into the results object if the ATP var is part of the ATP formulacreateAtpFormula(AtpFormulaModel atpFormula) Creates anAtpFormulaModelvoiddeleteAtpFormula(String formulaCode) Deletes anAtpFormulaModelfrom its code.Retrieves collection of allAtpFormulaModelin the system.getAtpFormulaByCode(String formulaCode) Retrieves anAtpFormulaModelby its code.protected AtpFormulaDaogetAtpFormulaVariableValue(Map<String, Object> params, List<Long> results, PropertyDescriptor formulaVarPropDescriptor, AtpFormulaModel atpFormula) Gets the value for a specific atpformula variable namegetAtpValueFromFormula(AtpFormulaModel atpFormula, Map<String, Object> params) Retrieves the ATP value from a specific formulaprotected AvailableToPromiseDaoprotected BaseStoreServiceprotected ModelServiceprotected voidLoops throughAvailableToPromiseDaomethods to aggregate values for ATP calculationvoidsetAtpFormulaDao(AtpFormulaDao atpFormulaDao) voidsetAtpFormulaVar2ArithmeticOperatorMap(Map<String, String> atpFormulaVar2ArithmeticOperatorMap) voidsetAvailableToPromiseDao(AvailableToPromiseDao availableToPromiseDao) voidsetBaseStoreService(BaseStoreService baseStoreService) voidsetModelService(ModelService modelService) updateAtpFormula(AtpFormulaModel atpFormula) Updates anAtpFormulaModelbased on its code
-
Field Details
-
EXTERNAL
- See Also:
-
RETURNED
- See Also:
-
operatorList
-
-
Constructor Details
-
DefaultAtpFormulaService
public DefaultAtpFormulaService()
-
-
Method Details
-
getAtpFormulaByCode
Description copied from interface:AtpFormulaServiceRetrieves anAtpFormulaModelby its code.- Specified by:
getAtpFormulaByCodein interfaceAtpFormulaService- Parameters:
formulaCode- The formula code for which we want to retrieve a specificAtpFormulaModel.- Returns:
- the corresponding
AtpFormulaModel.
-
getAllAtpFormula
Description copied from interface:AtpFormulaServiceRetrieves collection of allAtpFormulaModelin the system.- Specified by:
getAllAtpFormulain interfaceAtpFormulaService- Returns:
- the collection of all
AtpFormulaModel.
-
createAtpFormula
Description copied from interface:AtpFormulaServiceCreates anAtpFormulaModel- Specified by:
createAtpFormulain interfaceAtpFormulaService- Parameters:
atpFormula- The ATP formula to be created.- Returns:
- the created
AtpFormulaModel.
-
updateAtpFormula
Description copied from interface:AtpFormulaServiceUpdates anAtpFormulaModelbased on its code- Specified by:
updateAtpFormulain interfaceAtpFormulaService- Parameters:
atpFormula- The ATP formula to be updated.- Returns:
- the up to date
AtpFormulaModel.
-
deleteAtpFormula
Description copied from interface:AtpFormulaServiceDeletes anAtpFormulaModelfrom its code. Only possible if the formula is not assign to any base store- Specified by:
deleteAtpFormulain interfaceAtpFormulaService- Parameters:
formulaCode- The formula code that we want to delete
-
getAtpValueFromFormula
Description copied from interface:AtpFormulaServiceRetrieves the ATP value from a specific formula- Specified by:
getAtpValueFromFormulain interfaceAtpFormulaService- Parameters:
atpFormula- TheAtpFormulaModelfrom which we want to retrieve the ATP valueparams- The list ofStockLevelModelto gather in order to define the ATP value- Returns:
- the number of available item according to the params
-
getAtpFormulaVariableValue
protected List<Long> getAtpFormulaVariableValue(Map<String, Object> params, List<Long> results, PropertyDescriptor formulaVarPropDescriptor, AtpFormulaModel atpFormula) Gets the value for a specific atpformula variable name- Parameters:
params- The parameters to apply to the method matching the name inAvailableToPromiseDaoresults- The list of results already found and to which the result must be addedformulaVarPropDescriptor- ThePropertyDescriptorfor AtpFormulaVariable's property for which the value is requestedatpFormula-- Returns:
- the complete list of values including the found value
-
loopThroughAtpMethods
protected void loopThroughAtpMethods(Map<String, Object> params, List<Long> results, String atpFormulaVar) throws IllegalAccessException, InvocationTargetExceptionLoops throughAvailableToPromiseDaomethods to aggregate values for ATP calculation- Parameters:
params- The parameters to apply to the method matching the name inAvailableToPromiseDaoresults- The list of results already found and to which the result must be addedatpFormulaVar- The Name of thePropertyDescriptorfor AtpFormulaVariable's property for which the value is requested- Throws:
IllegalAccessExceptionInvocationTargetException
-
appendResults
protected void appendResults(Map<String, Object> params, List<Long> results, String atpFormulaVar, Method method) throws IllegalAccessException, InvocationTargetExceptionAppends the result into the results object if the ATP var is part of the ATP formula- Parameters:
params- The parameters to apply to the method matching the name inAvailableToPromiseDaoresults- The list of results already found and to which the result must be addedatpFormulaVar- The Name of thePropertyDescriptorfor AtpFormulaVariable's property for which the value is requestedmethod- The method to invoke to retrieve the value to append- Throws:
IllegalAccessExceptionInvocationTargetException
-
getAvailableToPromiseDao
-
setAvailableToPromiseDao
-
getBaseStoreService
-
setBaseStoreService
-
getModelService
-
setModelService
-
getAtpFormulaDao
-
setAtpFormulaDao
-
getAtpFormulaVar2ArithmeticOperatorMap
-
setAtpFormulaVar2ArithmeticOperatorMap
-