Class ProductionRun

java.lang.Object
org.apache.ofbiz.manufacturing.jobshopmgt.ProductionRun

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

  • Method Details

    • 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 BigDecimal getQuantity()
      get the quantity property.
      Returns:
      the quantity property
    • setQuantity

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

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

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

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

      public void setEstimatedCompletionDate(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 Timestamp recalculateEstimatedCompletionDate(Long priority, 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 Timestamp recalculateEstimatedCompletionDate()
      call recalculateEstimatedCompletionDate(0, estimatedStartDate), so recalculated for all the routing tasks.
    • getProductionRunName

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

      public void setProductionRunName(String name)
      Sets production run name.
      Parameters:
      name - the name
    • getDescription

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

      public void setDescription(String description)
      Sets description.
      Parameters:
      description - the description
    • getCurrentStatus

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

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

      public 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, BigDecimal quantity, LocalDispatcher dispatcher)
    • getEstimatedTaskTime

      public static long getEstimatedTaskTime(GenericValue task, BigDecimal quantity, String productId, String routingId, LocalDispatcher dispatcher)
    • isUpdateCompletionDate

      public boolean isUpdateCompletionDate()
      Is update completion date boolean.
      Returns:
      the boolean