Class ProductionRun
java.lang.Object
org.apache.ofbiz.manufacturing.jobshopmgt.ProductionRun
ProductionRun Object used by the Jobshop management OFBiz components,
this object is used to find or updated an existing ProductionRun.
-
Constructor Summary
ConstructorDescriptionProductionRun
(String productionRunId, Delegator delegator, LocalDispatcher dispatcher) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear list of all the productionRunRoutingTasks to force re-reading at the next need.boolean
exist()
test if the productionRun exist.get the GenericValue currentStatus.get the description property.get the estimatedCompletionDate property.get the estimatedStartDate property.static long
getEstimatedTaskTime
(GenericValue task, BigDecimal quantity, String productId, String routingId, LocalDispatcher dispatcher) static long
getEstimatedTaskTime
(GenericValue task, BigDecimal quantity, LocalDispatcher dispatcher) get the ProductionRun GenericValue .get the list of all the productionRunRoutingTasks as a list of GenericValue.get the list of all the productionRunComponents as a list of GenericValue.get the productionRunName property.get the list of all the productionRunRoutingTasks as a list of GenericValue.get the Product GenericValue corresponding to the productProduced.get the quantity property.boolean
Is update completion date boolean.call recalculateEstimatedCompletionDate(0, estimatedStartDate), so recalculated for all the routing tasks.recalculateEstimatedCompletionDate
(Long priority, Timestamp startDate) Recalculate the estimatedCompletionDate property.void
setDescription
(String description) Sets description.void
setEstimatedCompletionDate
(Timestamp estimatedCompletionDate) set the estimatedCompletionDate property without any control or calculation.void
setEstimatedStartDate
(Timestamp estimatedStartDate) set the estimatedStartDate property.void
setProductionRunName
(String name) Sets production run name.void
setQuantity
(BigDecimal newQuantity) set the quantity property and recalculated the productComponent quantity.boolean
store()
Store the modified ProductionRun object in the database.
-
Constructor Details
-
ProductionRun
-
-
Method Details
-
exist
public boolean exist()test if the productionRun exist.- Returns:
- true if it exist false otherwise.
-
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
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
get the quantity property.- Returns:
- the quantity property
-
setQuantity
set the quantity property and recalculated the productComponent quantity.- Parameters:
newQuantity
- the new quantity to be set
-
getEstimatedStartDate
get the estimatedStartDate property.- Returns:
- the estimatedStartDate property
-
setEstimatedStartDate
set the estimatedStartDate property.- Parameters:
estimatedStartDate
- set the estimatedStartDate property
-
getEstimatedCompletionDate
get the estimatedCompletionDate property.- Returns:
- the estimatedCompletionDate property
-
setEstimatedCompletionDate
set the estimatedCompletionDate property without any control or calculation. usage productionRun.setEstimatedCompletionDate(productionRun.recalculateEstimatedCompletionDate(priority);- Parameters:
estimatedCompletionDate
- set the estimatedCompletionDate property
-
recalculateEstimatedCompletionDate
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
call recalculateEstimatedCompletionDate(0, estimatedStartDate), so recalculated for all the routing tasks. -
getProductionRunName
get the productionRunName property.- Returns:
- the productionRunName property
-
setProductionRunName
Sets production run name.- Parameters:
name
- the name
-
getDescription
get the description property.- Returns:
- the description property
-
setDescription
Sets description.- Parameters:
description
- the description
-
getCurrentStatus
get the GenericValue currentStatus.- Returns:
- the currentStatus related object
-
getProductionRunComponents
get the list of all the productionRunComponents as a list of GenericValue.- Returns:
- the productionRunComponents related object
-
getProductionRunRoutingTasks
get the list of all the productionRunRoutingTasks as a list of GenericValue.- Returns:
- the productionRunRoutingTasks related object
-
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
-