Package org.openwms.wms.receiving.impl
Class ReceivingServiceImpl<T extends CaptureRequestVO>
java.lang.Object
org.openwms.wms.receiving.impl.ReceivingServiceImpl<T>
- All Implemented Interfaces:
ReceivingService<T>
@Validated
@Service
class ReceivingServiceImpl<T extends CaptureRequestVO>
extends Object
implements ReceivingService<T>
A ReceivingServiceImpl is a Spring managed transactional Services that deals with
ReceivingOrders.- Author:
- Heiko Scherrer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.springframework.plugin.core.PluginRegistry<ReceivingOrderCapturer<T>, CaptureRequestVO> private static final org.slf4j.Loggerprivate final NextReceivingOrderRepositoryprivate final org.springframework.plugin.core.PluginRegistry<ReceivingOrderUpdater, ReceivingOrderUpdater.Type> private final org.springframework.context.ApplicationEventPublisherprivate final ReceivingOrderRepositoryprivate final ServiceProviderprivate final jakarta.validation.Validator -
Constructor Summary
ConstructorsConstructorDescriptionReceivingServiceImpl(jakarta.validation.Validator validator, NextReceivingOrderRepository nextReceivingOrderRepository, ReceivingOrderRepository repository, org.springframework.plugin.core.PluginRegistry<ReceivingOrderUpdater, ReceivingOrderUpdater.Type> plugins, org.springframework.plugin.core.PluginRegistry<ReceivingOrderCapturer<T>, CaptureRequestVO> capturers, org.springframework.context.ApplicationEventPublisher publisher, ServiceProvider serviceProvider) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidassignOrderId(ReceivingOrder order) @NotNull ReceivingOrdercancelOrder(@NotBlank String pKey) Cancel aReceivingOrder.@NotNull Optional<ReceivingOrder> Capturing on aReceivingOrdermeans: Decrease one of theReceivingOrderPositions by the received amount of the givenProductCreate physicalPackagingUnit(s) from the received quantityvoidcaptureBlindReceipts(@NotNull List<T> requests) Capture an unexpected receipt (aka Blind Receipt) that has no reference to aReceivingOrder.@NotNull ReceivingOrderchangeState(@NotBlank String pKey, @NotNull OrderState state) Change the state of aReceivingOrder.@NotNull ReceivingOrderComplete aReceivingOrderand all positions.private ReceivingOrdercompleteInternal(String pKey) @NotNull ReceivingOrdercreateOrder(@NotNull ReceivingOrder order) Create aReceivingOrderwith containingReceivingOrderPosition.@NotNull List<ReceivingOrder> findAll()Find and return all existingReceivingOrders.findByOrderId(@NotBlank String orderId) Find and return aReceivingOrderidentified by its business key.@NotNull ReceivingOrderfindByPKey(@NotBlank String pKey) Find and return aReceivingOrderidentified by its synthetic persistent key.private ReceivingOrder@NotNull ReceivingOrderupdate(@NotBlank String pKey, @NotNull ReceivingOrder receivingOrder) Update an existingReceivingOrderwith the given data.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
validator
private final jakarta.validation.Validator validator -
nextReceivingOrderRepository
-
repository
-
plugins
private final org.springframework.plugin.core.PluginRegistry<ReceivingOrderUpdater,ReceivingOrderUpdater.Type> plugins -
capturers
private final org.springframework.plugin.core.PluginRegistry<ReceivingOrderCapturer<T extends CaptureRequestVO>,CaptureRequestVO> capturers -
publisher
private final org.springframework.context.ApplicationEventPublisher publisher -
serviceProvider
-
-
Constructor Details
-
ReceivingServiceImpl
ReceivingServiceImpl(jakarta.validation.Validator validator, NextReceivingOrderRepository nextReceivingOrderRepository, ReceivingOrderRepository repository, @Qualifier("plugins") org.springframework.plugin.core.PluginRegistry<ReceivingOrderUpdater, ReceivingOrderUpdater.Type> plugins, @Qualifier("capturers") org.springframework.plugin.core.PluginRegistry<ReceivingOrderCapturer<T>, CaptureRequestVO> capturers, org.springframework.context.ApplicationEventPublisher publisher, ServiceProvider serviceProvider)
-
-
Method Details
-
createOrder
@Measured @NotNull public @NotNull ReceivingOrder createOrder(@NotNull @NotNull ReceivingOrder order) Create aReceivingOrderwith containingReceivingOrderPosition.- Specified by:
createOrderin interfaceReceivingService<T extends CaptureRequestVO>- Parameters:
order- The ReceivingOrder instance to create- Returns:
- The saved instance
-
assignOrderId
-
capture
@Measured @Transactional @NotNull public @NotNull Optional<ReceivingOrder> capture(@NotBlank @NotBlank String pKey, @NotNull @Valid @NotNull @Valid List<T> requests) Capturing on aReceivingOrdermeans:- Decrease one of the
ReceivingOrderPositions by the received amount of the givenProduct - Create physical
PackagingUnit(s) from the received quantity
- Specified by:
capturein interfaceReceivingService<T extends CaptureRequestVO>- Parameters:
pKey- The persistent key of the ReceivingOrderrequests- Contains all the capturing information according to the process in use- Returns:
- The updated ReceivingOrder instance with updated positions
- Decrease one of the
-
captureBlindReceipts
Capture an unexpected receipt (aka Blind Receipt) that has no reference to aReceivingOrder.- Create physical
PackagingUnit(s) from the received quantity
- Specified by:
captureBlindReceiptsin interfaceReceivingService<T extends CaptureRequestVO>- Parameters:
requests- Contains all the capturing information according to the process in use
- Create physical
-
findByPKey
Find and return aReceivingOrderidentified by its synthetic persistent key.- Specified by:
findByPKeyin interfaceReceivingService<T extends CaptureRequestVO>- Parameters:
pKey- The synthetic persistent key- Returns:
- The instance
-
findByOrderId
Find and return aReceivingOrderidentified by its business key.- Specified by:
findByOrderIdin interfaceReceivingService<T extends CaptureRequestVO>- Parameters:
orderId- The business key- Returns:
- The order instance
-
update
@Measured @Transactional @NotNull public @NotNull ReceivingOrder update(@NotBlank @NotBlank String pKey, @NotNull @NotNull ReceivingOrder receivingOrder) Update an existingReceivingOrderwith the given data.- Specified by:
updatein interfaceReceivingService<T extends CaptureRequestVO>- Parameters:
pKey- The synthetic persistent keyreceivingOrder- The representation to update- Returns:
- The updated instance
-
complete
@Measured @Transactional @NotNull public @NotNull ReceivingOrder complete(@NotBlank @NotBlank String pKey) Complete aReceivingOrderand all positions. Satisfy quantities and set the state toCOMPLETED.- Specified by:
completein interfaceReceivingService<T extends CaptureRequestVO>- Parameters:
pKey- The synthetic persistent key- Returns:
- The updated instance
-
completeInternal
-
cancelOrder
@Measured @Transactional @NotNull public @NotNull ReceivingOrder cancelOrder(@NotBlank @NotBlank String pKey) Cancel aReceivingOrder.- Specified by:
cancelOrderin interfaceReceivingService<T extends CaptureRequestVO>- Parameters:
pKey- The synthetic persistent key- Returns:
- The cancelled instance
-
changeState
@Measured @Transactional @NotNull public @NotNull ReceivingOrder changeState(@NotBlank @NotBlank String pKey, @NotNull @NotNull OrderState state) Change the state of aReceivingOrder.- Specified by:
changeStatein interfaceReceivingService<T extends CaptureRequestVO>- Parameters:
pKey- The synthetic persistent keystate- The new state- Returns:
- The updated instance
-
getOrder
-
findAll
Find and return all existingReceivingOrders.- Specified by:
findAllin interfaceReceivingService<T extends CaptureRequestVO>- Returns:
- A list of ReceivingOrders, never null
-