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
FieldsModifier and TypeFieldDescriptionArbitrary detail information on this order, might be populated with ERP information.private ZonedDateTimeEarliest date the order can be started.private ZonedDateTimeWhen the order has been finished.private ZonedDateTimeWhen the order is expected to be received.private ZonedDateTimeLatest date of this order can be processed.private booleanProperty to lock/unlock an order.private static final org.slf4j.Loggerprivate ZonedDateTimeDate when the order should be allocated.private StringUnique order id, business key.private OrderStateCurrent state of this order.private @Valid List<AbstractReceivingOrderPosition> All ReceivingOrderPosition this order has.private intCurrent priority of the order.private ProblemLatest problem that is occurred on this order.private ZonedDateTimeWhen the order has been started.Fields inherited from class org.ameba.integration.jpa.ApplicationEntity
C_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancelOrder(org.springframework.context.ApplicationEventPublisher publisher, org.ameba.i18n.Translator translator) Cancel the current order.booleanOnly the orderId.intinthashCode()Only the orderId.booleanWhether the order has anorderIdset or not.booleanisLocked()protected voidbooleanrecalculateOrderState(org.springframework.context.ApplicationEventPublisher publisher) Recalculate and occasionally change the state of thisReceivingOrder.voidsetDetails(Map<String, String> details) voidsetEndDate(ZonedDateTime endDate) voidsetExpectedReceiptDate(ZonedDateTime expectedReceiptDate) (package private) voidsetOrderId(String orderId) voidsetOrderState(OrderState orderState) protected voidsetOrderState(org.springframework.context.ApplicationEventPublisher publisher, OrderState orderState) Changes the state of the order and publishes an event indicating the state change.voidsetPositions(List<AbstractReceivingOrderPosition> positions) toString()Only the orderId.Methods inherited from class org.ameba.integration.jpa.ApplicationEntity
getPersistentKey, hasPersistentKey, onPersist, setPersistentKeyMethods 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:
onEntityPersistin classorg.ameba.integration.jpa.ApplicationEntity
-
getOrderId
-
setOrderId
-
hasOrderId
public boolean hasOrderId()Whether the order has anorderIdset 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- TheApplicationEventPublisherused to publish theReceivingOrderStateChangeEvent.orderState- The newOrderStateto 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:
trueif 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:
equalsin classorg.ameba.integration.jpa.ApplicationEntity
-
hashCode
public int hashCode()Only the orderId.- Overrides:
hashCodein classorg.ameba.integration.jpa.ApplicationEntity
-