Package org.openwms.wms.shipping.impl
Class ShippingOrder
java.lang.Object
org.ameba.integration.jpa.BaseEntity
org.ameba.integration.jpa.ApplicationEntity
org.openwms.wms.shipping.impl.ShippingOrder
- All Implemented Interfaces:
Serializable
,org.ameba.integration.TypedEntity<Long>
@Entity
public class ShippingOrder
extends org.ameba.integration.jpa.ApplicationEntity
implements Serializable
An Order.
- Author:
- Heiko Scherrer
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
Customer number.private String
A reference to the customers order number.private ZonedDateTime
Latest finish date of this Order.private boolean
Property to lock/unlock an Order.private ZonedDateTime
Date when the Order should be allocated.private @NotBlank(message="{owms.wms.shp.orderId}",groups=Create.class) String
Unique business key.private OrderState
Current state of this Order.private List
<AbstractShippingOrderPosition<?>> All AbstractShippingOrderPosition of this Order.private int
Current priority of the Order.private Problem
Latest problem that is occurred on this Order.private String
Some arbitrary shipping type, like DHL, FedEx etc.private ZonedDateTime
Earliest date when the Order has to be started.private OrderStartMode
Defines how an Order is started.Fields inherited from class org.ameba.integration.jpa.ApplicationEntity
C_ID
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Used by the JPA provider.ShippingOrder
(@NotBlank(message="{owms.wms.shp.orderId}",groups=Create.class) String orderId) Create a new Order with the mandatory attribute. -
Method Summary
Modifier and TypeMethodDescription(package private) ShippingOrder
addPostions
(ShippingOrderPosition... pos) Add one or more order positions to this order.void
changeOrderState
(org.ameba.i18n.Translator translator, org.springframework.context.ApplicationEventPublisher eventPublisher, OrderState orderState) Change the state of thisShippingOrder
.void
void
boolean
int
int
hashCode()
boolean
boolean
isLocked()
protected void
Before the entity is persisted: the orderState is setvoid
setCustomerNo
(String customerNo) void
setCustomerOrderId
(String customerOrderId) void
setDetails
(Map<String, String> details) void
setLatestDueDate
(ZonedDateTime latestDueDate) void
setNextAllocationDate
(ZonedDateTime nextAllocationDate) void
setOrderState
(OrderState orderState) void
setPersistentKey
(String pKey) void
setPositions
(Set<AbstractShippingOrderPosition<?>> positions) void
setPriority
(int priority) void
setShippingType
(String shippingType) void
setStartDate
(ZonedDateTime startDate) void
setStartMode
(OrderStartMode startMode) toString()
Methods inherited from class org.ameba.integration.jpa.ApplicationEntity
getPersistentKey, hasPersistentKey, onPersist
Methods inherited from class org.ameba.integration.jpa.BaseEntity
getCreatedBy, getCreateDt, getLastModifiedBy, getLastModifiedDt, getOl, getPk, isNew, setCreatedBy, setCreateDt, setLastModifiedBy, setLastModifiedDt, setOl
-
Field Details
-
orderId
@NotBlank(message="{owms.wms.shp.orderId}", groups=Create.class) private @NotBlank(message="{owms.wms.shp.orderId}",groups=Create.class) String orderIdUnique business key. -
customerOrderId
A reference to the customers order number.- See Also:
-
customerNo
Customer number. -
orderState
Current state of this Order. -
shippingType
Some arbitrary shipping type, like DHL, FedEx etc. -
locked
private boolean lockedProperty to lock/unlock an Order.- true: locked
- false: unlocked
-
priority
private int priorityCurrent priority of the Order. -
latestDueDate
Latest finish date of this Order. -
startDate
Earliest date when the Order has to be started. -
nextAllocationDate
Date when the Order should be allocated. -
problem
Latest problem that is occurred on this Order. -
positions
All AbstractShippingOrderPosition of this Order. -
startMode
Defines how an Order is started. Default isOrderStartMode.MANUAL
-
details
-
-
Constructor Details
-
ShippingOrder
public ShippingOrder(@NotBlank(message="{owms.wms.shp.orderId}",groups=Create.class) @NotBlank(message="{owms.wms.shp.orderId}",groups=Create.class) String orderId) Create a new Order with the mandatory attribute.@Default
for the mapper.- Parameters:
orderId
- The order id
-
ShippingOrder
protected ShippingOrder()Used by the JPA provider.
-
-
Method Details
-
onEntityPersist
protected void onEntityPersist()Before the entity is persisted:- the orderState is set
- Overrides:
onEntityPersist
in classorg.ameba.integration.jpa.ApplicationEntity
-
setPersistentKey
- Overrides:
setPersistentKey
in classorg.ameba.integration.jpa.ApplicationEntity
-
changeOrderState
public void changeOrderState(org.ameba.i18n.Translator translator, org.springframework.context.ApplicationEventPublisher eventPublisher, OrderState orderState) Change the state of thisShippingOrder
.- Parameters:
translator
- An instance of Translator to translate messagesorderState
- The new order state to set- Throws:
org.ameba.exception.BusinessRuntimeException
- In case a state change is not allowed
-
addPostions
Add one or more order positions to this order.- Parameters:
pos
-OrderPosition
s to add
-
toString
Return the orderId.
-
equals
Just use the orderId
- Overrides:
equals
in classorg.ameba.integration.jpa.ApplicationEntity
-
hashCode
public int hashCode()Just use the orderId
- Overrides:
hashCode
in classorg.ameba.integration.jpa.ApplicationEntity
-
hasPositions
public boolean hasPositions() -
clearPositions
public void clearPositions() -
clearDetails
public void clearDetails() -
getOrderId
-
getCustomerOrderId
-
setCustomerOrderId
-
getCustomerNo
-
setCustomerNo
-
getStartMode
-
setStartMode
-
getOrderState
-
setOrderState
-
getShippingType
-
setShippingType
-
getPositions
-
setPositions
-
isLocked
public boolean isLocked() -
getPriority
public int getPriority() -
setPriority
public void setPriority(int priority) -
getLatestDueDate
-
setLatestDueDate
-
getStartDate
-
setStartDate
-
getNextAllocationDate
-
setNextAllocationDate
-
getProblem
-
getDetails
-
setDetails
-