Package org.openwms.tms
Class TransportOrder
java.lang.Object
org.ameba.integration.jpa.BaseEntity
org.ameba.integration.jpa.ApplicationEntity
org.openwms.tms.TransportOrder
- All Implemented Interfaces:
Serializable
,org.ameba.integration.TypedEntity<Long>
@Entity
public class TransportOrder
extends org.ameba.integration.jpa.ApplicationEntity
implements Serializable
A TransportOrder is used to move
TransportUnit
s from the current Location
to another target (Location).- Author:
- Heiko Scherrer
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprivate Date
Date when theTransportOrder
ended.private PriorityLevel
A priority level of theTransportOrder
.private Message
Last reported problem on theTransportOrder
.private String
The sourceLocation
of theTransportOrder
.
This property is set before theTransportOrder
was started.private Date
Date when theTransportOrder
was started.private TransportOrderState
State of theTransportOrder
.private String
The targetLocation
of theTransportOrder
.
This property is set before theTransportOrder
was started.private @NotEmpty(groups=ValidateBKAndTarget.class) String
ALocationGroup
can also be set as target.private @Min(value=1L,groups=ValidateBKAndTarget.class) String
The bk of theTransportUnit
to be moved by thisTransportOrder
.Fields inherited from class org.ameba.integration.jpa.ApplicationEntity
C_ID
-
Constructor Summary
ModifierConstructorDescriptionprotected
Dear JPA...TransportOrder
(String transportUnitBK) Create a TransportOrder with the given TransportUnit's business key. -
Method Summary
Modifier and TypeMethodDescriptionchangeState
(StateManager stateManager, TransportOrderState newState) Change the state of theTransportOrder
regarding some rules.boolean
All fields.Get the endDate.Returns the priority level of theTransportOrder
.Get the lastMessage
.Get the sourceLocation.Returns the date when theTransportOrder
was started.getState()
Returns the state of theTransportOrder
.Get the targetLocation
of thisTransportOrder
.Get the targetLocationGroup.Get theTransportUnit
assigned to theTransportOrder
.int
hashCode()
All fields.boolean
Check whether a problem was reported on this TO.(package private) boolean
hasTargetChanged
(TransportOrder transportOrder) Check whether one of the targets has changed between this TransportOrder and the one passed astransportOrder
.boolean
boolean
boolean
Check whether thisTransportOrder
has aTransportUnit
's business key set.void
setEndDate
(Date endDate) Set the date when the TransportOrder has been deactivated for processing.void
setPersistentKey
(String pKey) void
setPriority
(PriorityLevel priority) Set the priority level of theTransportOrder
.setProblem
(Message problem) Set the lastMessage
.setSourceLocation
(String sourceLocation) Set the sourceLocation.void
setStartDate
(Date startDate) Set the date when the TransportOrder has been activated for processing.void
setState
(TransportOrderState state) Used for MapStruct only.setTargetLocation
(String targetLocation) Set the targetLocation
of thisTransportOrder
.setTargetLocationGroup
(String targetLocationGroup) Set the targetLocationGroup.void
setTransportUnitBK
(String transportUnitBK) Assign aTransportUnit
to theTransportOrder
.toString()
All fields.Methods inherited from class org.ameba.integration.jpa.ApplicationEntity
getPersistentKey, hasPersistentKey, onEntityPersist, onPersist
Methods inherited from class org.ameba.integration.jpa.BaseEntity
getCreatedBy, getCreateDt, getLastModifiedBy, getLastModifiedDt, getOl, getPk, isNew, setCreatedBy, setCreateDt, setLastModifiedBy, setLastModifiedDt, setOl
-
Field Details
-
transportUnitBK
@Min(value=1L, groups=ValidateBKAndTarget.class) private @Min(value=1L,groups=ValidateBKAndTarget.class) String transportUnitBKThe bk of theTransportUnit
to be moved by thisTransportOrder
. Allowed to be null to keepTransportOrder
s withoutTransportUnit
s. -
priority
A priority level of theTransportOrder
. The lower the value the lower the priority.
The priority level affects the execution of theTransportOrder
. An order with high priority will be processed faster than those with lower priority. -
startDate
Date when theTransportOrder
was started. -
problem
Last reported problem on theTransportOrder
. -
endDate
Date when theTransportOrder
ended. -
state
State of theTransportOrder
. -
sourceLocation
The sourceLocation
of theTransportOrder
.
This property is set before theTransportOrder
was started. -
targetLocation
The targetLocation
of theTransportOrder
.
This property is set before theTransportOrder
was started. -
targetLocationGroup
@NotEmpty(groups=ValidateBKAndTarget.class) private @NotEmpty(groups=ValidateBKAndTarget.class) String targetLocationGroupALocationGroup
can also be set as target. At least one target must be set when theTransportOrder
is being started.
-
-
Constructor Details
-
TransportOrder
protected TransportOrder()Dear JPA... -
TransportOrder
Create a TransportOrder with the given TransportUnit's business key.- Parameters:
transportUnitBK
- TransportUnit business key
-
-
Method Details
-
setPersistentKey
- Overrides:
setPersistentKey
in classorg.ameba.integration.jpa.ApplicationEntity
-
getPriority
Returns the priority level of theTransportOrder
.- Returns:
- The priority
-
setPriority
Set the priority level of theTransportOrder
.- Parameters:
priority
- The priority to set
-
getStartDate
Returns the date when theTransportOrder
was started.- Returns:
- The date when started
-
setStartDate
Set the date when the TransportOrder has been activated for processing.- Parameters:
startDate
- The start date
-
getTransportUnitBK
Get theTransportUnit
assigned to theTransportOrder
.- Returns:
- The business key of the assigned
TransportUnit
-
setTransportUnitBK
Assign aTransportUnit
to theTransportOrder
. Setting theTransportUnit
to null is allowed here to unlink both.- Parameters:
transportUnitBK
- The business key of theTransportUnit
to be assigned
-
hasTransportUnitBK
public boolean hasTransportUnitBK()Check whether thisTransportOrder
has aTransportUnit
's business key set.- Returns:
true
if a the business key is assigne
-
getState
Returns the state of theTransportOrder
.- Returns:
- The state of the order
-
setState
Used for MapStruct only.- Parameters:
state
- The state to set
-
changeState
Change the state of theTransportOrder
regarding some rules.- Parameters:
newState
- The new state of the order- Returns:
- The modified instance
- Throws:
StateChangeException
- in case- the newState is null or
- the newState is less than the old state or
- the
TransportOrder
is in stateTransportOrderState.CREATED
and shall be manually turned into something else thenTransportOrderState.INITIALIZED
orTransportOrderState.CANCELED
- the
TransportOrder
isTransportOrderState.CREATED
and shall beTransportOrderState.INITIALIZED
but it is incomplete
-
getTargetLocation
Get the targetLocation
of thisTransportOrder
.- Returns:
- The targetLocation if any, otherwise null
-
hasTargetLocation
public boolean hasTargetLocation() -
setTargetLocation
Set the targetLocation
of thisTransportOrder
.- Parameters:
targetLocation
- The location to move on- Returns:
- this
-
getTargetLocationGroup
Get the targetLocationGroup.- Returns:
- The targetLocationGroup if any, otherwise null
-
hasTargetLocationGroup
public boolean hasTargetLocationGroup() -
setTargetLocationGroup
Set the targetLocationGroup.- Parameters:
targetLocationGroup
- The targetLocationGroup to set.- Returns:
- this
-
getProblem
Get the lastMessage
.- Returns:
- The last problem.
-
setProblem
Set the lastMessage
.- Parameters:
problem
- TheMessage
to set.- Returns:
- this
-
getEndDate
Get the endDate.- Returns:
- The date the order ended
-
setEndDate
Set the date when the TransportOrder has been deactivated for processing.- Parameters:
endDate
- The end date
-
getSourceLocation
Get the sourceLocation.- Returns:
- The sourceLocation
-
setSourceLocation
Set the sourceLocation.- Parameters:
sourceLocation
- The sourceLocation to set- Returns:
- this
-
hasProblem
public boolean hasProblem()Check whether a problem was reported on this TO.- Returns:
- true if so, otherwise false
-
hasTargetChanged
Check whether one of the targets has changed between this TransportOrder and the one passed astransportOrder
.- Parameters:
transportOrder
- The TransportOrder to verify against- Returns:
- true if targets has changed, otherwise false
-
equals
All fields.- Overrides:
equals
in classorg.ameba.integration.jpa.ApplicationEntity
-
hashCode
public int hashCode()All fields.- Overrides:
hashCode
in classorg.ameba.integration.jpa.ApplicationEntity
-
toString
All fields.
-