Class ProductionRun
- java.lang.Object
-
- org.apache.ofbiz.manufacturing.jobshopmgt.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 Summary
Fields Modifier and Type Field Description protected GenericValue
currentStatus
protected java.lang.String
description
protected LocalDispatcher
dispatcher
protected java.sql.Timestamp
estimatedCompletionDate
protected java.sql.Timestamp
estimatedStartDate
static java.lang.String
module
protected GenericValue
productionRun
protected java.util.List<GenericValue>
productionRunComponents
protected java.lang.String
productionRunName
protected GenericValue
productionRunProduct
protected java.util.List<GenericValue>
productionRunRoutingTasks
protected GenericValue
productProduced
protected java.math.BigDecimal
quantity
static java.lang.String
resource
-
Constructor Summary
Constructors Constructor Description ProductionRun(java.lang.String productionRunId, Delegator delegator, LocalDispatcher dispatcher)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearRoutingTasksList()
clear list of all the productionRunRoutingTasks to force re-reading at the next need.boolean
exist()
test if the productionRun exist.GenericValue
getCurrentStatus()
get the GenericValue currentStatus.java.lang.String
getDescription()
get the description property.java.sql.Timestamp
getEstimatedCompletionDate()
get the estimatedCompletionDate property.java.sql.Timestamp
getEstimatedStartDate()
get the estimatedStartDate property.static long
getEstimatedTaskTime(GenericValue task, java.math.BigDecimal quantity, java.lang.String productId, java.lang.String routingId, LocalDispatcher dispatcher)
static long
getEstimatedTaskTime(GenericValue task, java.math.BigDecimal quantity, LocalDispatcher dispatcher)
GenericValue
getGenericValue()
get the ProductionRun GenericValue .GenericValue
getLastProductionRunRoutingTask()
get the list of all the productionRunRoutingTasks as a list of GenericValue.java.util.List<GenericValue>
getProductionRunComponents()
get the list of all the productionRunComponents as a list of GenericValue.java.lang.String
getProductionRunName()
get the productionRunName property.java.util.List<GenericValue>
getProductionRunRoutingTasks()
get the list of all the productionRunRoutingTasks as a list of GenericValue.GenericValue
getProductProduced()
get the Product GenericValue corresponding to the productProduced.java.math.BigDecimal
getQuantity()
get the quantity property.boolean
isUpdateCompletionDate()
java.sql.Timestamp
recalculateEstimatedCompletionDate()
call recalculateEstimatedCompletionDate(0,estimatedStartDate), so recalculated for all the routing tasks.java.sql.Timestamp
recalculateEstimatedCompletionDate(java.lang.Long priority, java.sql.Timestamp startDate)
Recalculate the estimatedCompletionDate property.void
setDescription(java.lang.String description)
void
setEstimatedCompletionDate(java.sql.Timestamp estimatedCompletionDate)
set the estimatedCompletionDate property without any control or calculation.void
setEstimatedStartDate(java.sql.Timestamp estimatedStartDate)
set the estimatedStartDate property.void
setProductionRunName(java.lang.String name)
void
setQuantity(java.math.BigDecimal newQuantity)
set the quantity property and recalculated the productComponent quantity.boolean
store()
Store the modified ProductionRun object in the database.
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
resource
public static final java.lang.String resource
- See Also:
- Constant Field Values
-
productionRun
protected GenericValue productionRun
-
productionRunProduct
protected GenericValue productionRunProduct
-
productProduced
protected GenericValue productProduced
-
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
-
currentStatus
protected GenericValue currentStatus
-
productionRunComponents
protected java.util.List<GenericValue> productionRunComponents
-
productionRunRoutingTasks
protected java.util.List<GenericValue> productionRunRoutingTasks
-
dispatcher
protected LocalDispatcher dispatcher
-
-
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()
-
-