Class ProductionRun


  • public class ProductionRun
    extends java.lang.Object
    ProductionRun Object used by the Jobshop management OFBiz components, this object is used to find or updated an existing ProductionRun.
    • Field Detail

      • module

        public static final java.lang.String module
      • productionRunProduct

        protected GenericValue productionRunProduct
      • quantity

        protected java.math.BigDecimal quantity
      • estimatedStartDate

        protected java.sql.Timestamp estimatedStartDate
      • estimatedCompletionDate

        protected java.sql.Timestamp estimatedCompletionDate
      • productionRunName

        protected java.lang.String productionRunName
      • description

        protected java.lang.String description
      • productionRunComponents

        protected java.util.List<GenericValue> productionRunComponents
      • productionRunRoutingTasks

        protected java.util.List<GenericValue> productionRunRoutingTasks
    • Constructor Detail

      • ProductionRun

        public ProductionRun​(java.lang.String productionRunId,
                             Delegator delegator,
                             LocalDispatcher dispatcher)
    • Method Detail

      • exist

        public boolean exist()
        test if the productionRun exist.
        Returns:
        true if it exist false otherwise.
      • getGenericValue

        public GenericValue getGenericValue()
        get the ProductionRun GenericValue .
        Returns:
        the ProductionRun GenericValue
      • store

        public boolean store()
        Store the modified ProductionRun object in the database.
        • store the the productionRun header
        • the productProduced related data
        • the listRoutingTask related data
        • the productComponent list related data
        Returns:
        true if success false otherwise
      • getProductProduced

        public GenericValue getProductProduced()
        get the Product GenericValue corresponding to the productProduced. In the same time this method read the quantity property from SGBD
        Returns:
        the productProduced related object
      • getQuantity

        public java.math.BigDecimal getQuantity()
        get the quantity property.
        Returns:
        the quantity property
      • setQuantity

        public void setQuantity​(java.math.BigDecimal newQuantity)
        set the quantity property and recalculated the productComponent quantity.
        Parameters:
        newQuantity - the new quantity to be set
      • getEstimatedStartDate

        public java.sql.Timestamp getEstimatedStartDate()
        get the estimatedStartDate property.
        Returns:
        the estimatedStartDate property
      • setEstimatedStartDate

        public void setEstimatedStartDate​(java.sql.Timestamp estimatedStartDate)
        set the estimatedStartDate property.
        Parameters:
        estimatedStartDate - set the estimatedStartDate property
      • getEstimatedCompletionDate

        public java.sql.Timestamp getEstimatedCompletionDate()
        get the estimatedCompletionDate property.
        Returns:
        the estimatedCompletionDate property
      • setEstimatedCompletionDate

        public void setEstimatedCompletionDate​(java.sql.Timestamp estimatedCompletionDate)
        set the estimatedCompletionDate property without any control or calculation. usage productionRun.setEstimatedCompletionDate(productionRun.recalculateEstimatedCompletionDate(priority);
        Parameters:
        estimatedCompletionDate - set the estimatedCompletionDate property
      • recalculateEstimatedCompletionDate

        public java.sql.Timestamp recalculateEstimatedCompletionDate​(java.lang.Long priority,
                                                                     java.sql.Timestamp startDate)
        Recalculate the estimatedCompletionDate property. Use the quantity and the estimatedStartDate properties as entries parameters. Read the listRoutingTask and for each recalculated and update the estimatedStart and endDate in the object. No store in the database is done.
        Parameters:
        priority - give the routingTask start point to recalculated
        Returns:
        the estimatedCompletionDate calculated
      • recalculateEstimatedCompletionDate

        public java.sql.Timestamp recalculateEstimatedCompletionDate()
        call recalculateEstimatedCompletionDate(0,estimatedStartDate), so recalculated for all the routing tasks.
      • getProductionRunName

        public java.lang.String getProductionRunName()
        get the productionRunName property.
        Returns:
        the productionRunName property
      • setProductionRunName

        public void setProductionRunName​(java.lang.String name)
      • getDescription

        public java.lang.String getDescription()
        get the description property.
        Returns:
        the description property
      • setDescription

        public void setDescription​(java.lang.String description)
      • getCurrentStatus

        public GenericValue getCurrentStatus()
        get the GenericValue currentStatus.
        Returns:
        the currentStatus related object
      • getProductionRunComponents

        public java.util.List<GenericValue> getProductionRunComponents()
        get the list of all the productionRunComponents as a list of GenericValue.
        Returns:
        the productionRunComponents related object
      • getProductionRunRoutingTasks

        public java.util.List<GenericValue> getProductionRunRoutingTasks()
        get the list of all the productionRunRoutingTasks as a list of GenericValue.
        Returns:
        the productionRunRoutingTasks related object
      • getLastProductionRunRoutingTask

        public GenericValue getLastProductionRunRoutingTask()
        get the list of all the productionRunRoutingTasks as a list of GenericValue.
        Returns:
        the productionRunRoutingTasks related object
      • clearRoutingTasksList

        public void clearRoutingTasksList()
        clear list of all the productionRunRoutingTasks to force re-reading at the next need. This method is used when the routingTasks ordering is changed.
      • getEstimatedTaskTime

        public static long getEstimatedTaskTime​(GenericValue task,
                                                java.math.BigDecimal quantity,
                                                LocalDispatcher dispatcher)
      • getEstimatedTaskTime

        public static long getEstimatedTaskTime​(GenericValue task,
                                                java.math.BigDecimal quantity,
                                                java.lang.String productId,
                                                java.lang.String routingId,
                                                LocalDispatcher dispatcher)
      • isUpdateCompletionDate

        public boolean isUpdateCompletionDate()