Package org.openwms.wms.receiving.impl
Class ReceivingOrder
java.lang.Object
org.ameba.integration.jpa.BaseEntity
org.ameba.integration.jpa.ApplicationEntity
org.openwms.wms.receiving.impl.ReceivingOrder
- All Implemented Interfaces:
Serializable
,org.ameba.integration.TypedEntity<Long>
@Entity
public class ReceivingOrder
extends org.ameba.integration.jpa.ApplicationEntity
implements Serializable
A ReceivingOrder.
- Author:
- Heiko Scherrer
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionArbitrary detail information on this order, might be populated with ERP information.private ZonedDateTime
Earliest date the order can be started.private ZonedDateTime
When the order has been finished.private ZonedDateTime
When the order is expected to be received.private ZonedDateTime
Latest date of this order can be processed.private boolean
Property to lock/unlock an order.private static final org.slf4j.Logger
private ZonedDateTime
Date when the order should be allocated.private String
Unique order id, business key.private OrderState
Current state of this order.private @Valid List
<AbstractReceivingOrderPosition> All ReceivingOrderPosition this order has.private int
Current priority of the order.private Problem
Latest problem that is occurred on this order.private ZonedDateTime
When the order has been started.Fields inherited from class org.ameba.integration.jpa.ApplicationEntity
C_ID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancelOrder
(org.springframework.context.ApplicationEventPublisher publisher, org.ameba.i18n.Translator translator) Cancel the current order.boolean
Only the orderId.int
int
hashCode()
Only the orderId.boolean
Whether the order has anorderId
set or not.boolean
isLocked()
protected void
boolean
recalculateOrderState
(org.springframework.context.ApplicationEventPublisher publisher) Recalculate and occasionally change the state of thisReceivingOrder
.void
setDetails
(Map<String, String> details) void
setEndDate
(ZonedDateTime endDate) void
setExpectedReceiptDate
(ZonedDateTime expectedReceiptDate) (package private) void
setOrderId
(String orderId) void
setOrderState
(OrderState orderState) protected void
setOrderState
(org.springframework.context.ApplicationEventPublisher publisher, OrderState orderState) Changes the state of the order and publishes an event indicating the state change.void
setPositions
(List<AbstractReceivingOrderPosition> positions) toString()
Only the orderId.Methods inherited from class org.ameba.integration.jpa.ApplicationEntity
getPersistentKey, hasPersistentKey, onPersist, setPersistentKey
Methods inherited from class org.ameba.integration.jpa.BaseEntity
getCreatedBy, getCreateDt, getLastModifiedBy, getLastModifiedDt, getOl, getPk, isNew, setCreatedBy, setCreateDt, setLastModifiedBy, setLastModifiedDt, setOl
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
orderId
Unique order id, business key. -
orderState
Current state of this order. -
locked
private boolean lockedProperty to lock/unlock an order.- true: locked
- false: unlocked
-
priority
private int priorityCurrent priority of the order. -
latestDueDate
Latest date of this order can be processed. -
expectedReceiptDate
When the order is expected to be received. -
earliestStartDate
Earliest date the order can be started. -
startDate
When the order has been started. -
endDate
When the order has been finished. -
nextAllocationDate
Date when the order should be allocated. -
problem
Latest problem that is occurred on this order. -
positions
All ReceivingOrderPosition this order has. -
details
Arbitrary detail information on this order, might be populated with ERP information.
-
-
Constructor Details
-
ReceivingOrder
protected ReceivingOrder()Used by the JPA provider. -
ReceivingOrder
-
-
Method Details
-
onEntityPersist
protected void onEntityPersist()- Overrides:
onEntityPersist
in classorg.ameba.integration.jpa.ApplicationEntity
-
getOrderId
-
setOrderId
-
hasOrderId
public boolean hasOrderId()Whether the order has anorderId
set or not.- Returns:
- true is assigned
-
getOrderState
-
setOrderState
-
setOrderState
protected void setOrderState(org.springframework.context.ApplicationEventPublisher publisher, OrderState orderState) Changes the state of the order and publishes an event indicating the state change.- Parameters:
publisher
- TheApplicationEventPublisher
used to publish theReceivingOrderStateChangeEvent
.orderState
- The newOrderState
to set for the order.
-
cancelOrder
public void cancelOrder(org.springframework.context.ApplicationEventPublisher publisher, org.ameba.i18n.Translator translator) Cancel the current order. This method sets the order state to CANCELED under specific conditions and updates the state of order positions.- Parameters:
publisher
- The ApplicationEventPublisher used to publish events related to state changes.translator
- The Translator used to retrieve error messages.- Throws:
AlreadyCancelledException
- If the order has already been canceled.CancellationDeniedException
- If the order state does not permit cancellation.
-
recalculateOrderState
public boolean recalculateOrderState(org.springframework.context.ApplicationEventPublisher publisher) Recalculate and occasionally change the state of thisReceivingOrder
.- Returns:
true
if the state has been changed
-
isLocked
public boolean isLocked() -
getPriority
public int getPriority() -
getLatestDueDate
-
getExpectedReceiptDate
-
setExpectedReceiptDate
-
getEarliestStartDate
-
getEndDate
-
setEndDate
-
getStartDate
-
getNextAllocationDate
-
getProblem
-
getPositions
-
setPositions
-
getDetails
-
setDetails
-
toString
Only the orderId. -
equals
Only the orderId.- Overrides:
equals
in classorg.ameba.integration.jpa.ApplicationEntity
-
hashCode
public int hashCode()Only the orderId.- Overrides:
hashCode
in classorg.ameba.integration.jpa.ApplicationEntity
-