Class DefaultAtpFormulaService

    • Field Detail

      • operatorList

        protected static final java.util.List<java.lang.String> operatorList
    • Constructor Detail

      • DefaultAtpFormulaService

        public DefaultAtpFormulaService()
    • Method Detail

      • deleteAtpFormula

        public void deleteAtpFormula​(java.lang.String formulaCode)
        Description copied from interface: AtpFormulaService
        Deletes an AtpFormulaModel from its code. Only possible if the formula is not assign to any base store
        Specified by:
        deleteAtpFormula in interface AtpFormulaService
        Parameters:
        formulaCode - The formula code that we want to delete
      • getAtpValueFromFormula

        public java.lang.Long getAtpValueFromFormula​(AtpFormulaModel atpFormula,
                                                     java.util.Map<java.lang.String,​java.lang.Object> params)
        Description copied from interface: AtpFormulaService
        Retrieves the ATP value from a specific formula
        Specified by:
        getAtpValueFromFormula in interface AtpFormulaService
        Parameters:
        atpFormula - The AtpFormulaModel from which we want to retrieve the ATP value
        params - The list of StockLevelModel to gather in order to define the ATP value
        Returns:
        the number of available item according to the params
      • getAtpFormulaVariableValue

        protected java.util.List<java.lang.Long> getAtpFormulaVariableValue​(java.util.Map<java.lang.String,​java.lang.Object> params,
                                                                            java.util.List<java.lang.Long> results,
                                                                            java.beans.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 in AvailableToPromiseDao
        results - The list of results already found and to which the result must be added
        formulaVarPropDescriptor - The PropertyDescriptor for AtpFormulaVariable's property for which the value is requested
        atpFormula -
        Returns:
        the complete list of values including the found value
      • loopThroughAtpMethods

        protected void loopThroughAtpMethods​(java.util.Map<java.lang.String,​java.lang.Object> params,
                                             java.util.List<java.lang.Long> results,
                                             java.lang.String atpFormulaVar)
                                      throws java.lang.IllegalAccessException,
                                             java.lang.reflect.InvocationTargetException
        Loops through AvailableToPromiseDao methods to aggregate values for ATP calculation
        Parameters:
        params - The parameters to apply to the method matching the name in AvailableToPromiseDao
        results - The list of results already found and to which the result must be added
        atpFormulaVar - The Name of the PropertyDescriptor for AtpFormulaVariable's property for which the value is requested
        Throws:
        java.lang.IllegalAccessException
        java.lang.reflect.InvocationTargetException
      • appendResults

        protected void appendResults​(java.util.Map<java.lang.String,​java.lang.Object> params,
                                     java.util.List<java.lang.Long> results,
                                     java.lang.String atpFormulaVar,
                                     java.lang.reflect.Method method)
                              throws java.lang.IllegalAccessException,
                                     java.lang.reflect.InvocationTargetException
        Appends 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 in AvailableToPromiseDao
        results - The list of results already found and to which the result must be added
        atpFormulaVar - The Name of the PropertyDescriptor for AtpFormulaVariable's property for which the value is requested
        method - The method to invoke to retrieve the value to append
        Throws:
        java.lang.IllegalAccessException
        java.lang.reflect.InvocationTargetException
      • setAvailableToPromiseDao

        public void setAvailableToPromiseDao​(AvailableToPromiseDao availableToPromiseDao)
      • setBaseStoreService

        public void setBaseStoreService​(BaseStoreService baseStoreService)
      • getModelService

        protected ModelService getModelService()
      • setModelService

        public void setModelService​(ModelService modelService)
      • setAtpFormulaDao

        public void setAtpFormulaDao​(AtpFormulaDao atpFormulaDao)
      • getAtpFormulaVar2ArithmeticOperatorMap

        protected java.util.Map<java.lang.String,​java.lang.String> getAtpFormulaVar2ArithmeticOperatorMap()
      • setAtpFormulaVar2ArithmeticOperatorMap

        public void setAtpFormulaVar2ArithmeticOperatorMap​(java.util.Map<java.lang.String,​java.lang.String> atpFormulaVar2ArithmeticOperatorMap)