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
ReceivingOrder
s.- Author:
- Heiko Scherrer
-
Field Summary
Modifier and TypeFieldDescriptionprivate final org.springframework.plugin.core.PluginRegistry
<ReceivingOrderCapturer<T>, CaptureRequestVO> private static final org.slf4j.Logger
private final NextReceivingOrderRepository
private final org.springframework.plugin.core.PluginRegistry
<ReceivingOrderUpdater, ReceivingOrderUpdater.Type> private final org.springframework.context.ApplicationEventPublisher
private final ReceivingOrderRepository
private final ServiceProvider
private final jakarta.validation.Validator
-
Constructor Summary
ConstructorDescriptionReceivingServiceImpl
(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 void
assignOrderId
(ReceivingOrder order) @NotNull ReceivingOrder
cancelOrder
(@NotBlank String pKey) Cancel aReceivingOrder
.@NotNull Optional
<ReceivingOrder> Capturing on aReceivingOrder
means: Decrease one of theReceivingOrderPosition
s by the received amount of the givenProduct
Create physicalPackagingUnit
(s) from the received quantityvoid
captureBlindReceipts
(@NotNull List<T> requests) Capture an unexpected receipt (aka Blind Receipt) that has no reference to aReceivingOrder
.@NotNull ReceivingOrder
changeState
(@NotBlank String pKey, @NotNull OrderState state) Change the state of aReceivingOrder
.@NotNull ReceivingOrder
Complete aReceivingOrder
and all positions.private ReceivingOrder
completeInternal
(String pKey) @NotNull ReceivingOrder
createOrder
(@NotNull ReceivingOrder order) Create aReceivingOrder
with containingReceivingOrderPosition
.@NotNull List
<ReceivingOrder> findAll()
Find and return all existingReceivingOrder
s.findByOrderId
(@NotBlank String orderId) Find and return aReceivingOrder
identified by its business key.@NotNull ReceivingOrder
findByPKey
(@NotBlank String pKey) Find and return aReceivingOrder
identified by its synthetic persistent key.private ReceivingOrder
@NotNull ReceivingOrder
update
(@NotBlank String pKey, @NotNull ReceivingOrder receivingOrder) Update an existingReceivingOrder
with 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 aReceivingOrder
with containingReceivingOrderPosition
.- Specified by:
createOrder
in 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 aReceivingOrder
means:- Decrease one of the
ReceivingOrderPosition
s by the received amount of the givenProduct
- Create physical
PackagingUnit
(s) from the received quantity
- Specified by:
capture
in 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:
captureBlindReceipts
in interfaceReceivingService<T extends CaptureRequestVO>
- Parameters:
requests
- Contains all the capturing information according to the process in use
- Create physical
-
findByPKey
Find and return aReceivingOrder
identified by its synthetic persistent key.- Specified by:
findByPKey
in interfaceReceivingService<T extends CaptureRequestVO>
- Parameters:
pKey
- The synthetic persistent key- Returns:
- The instance
-
findByOrderId
Find and return aReceivingOrder
identified by its business key.- Specified by:
findByOrderId
in 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 existingReceivingOrder
with the given data.- Specified by:
update
in 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 aReceivingOrder
and all positions. Satisfy quantities and set the state toCOMPLETED
.- Specified by:
complete
in 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:
cancelOrder
in 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:
changeState
in interfaceReceivingService<T extends CaptureRequestVO>
- Parameters:
pKey
- The synthetic persistent keystate
- The new state- Returns:
- The updated instance
-
getOrder
-
findAll
Find and return all existingReceivingOrder
s.- Specified by:
findAll
in interfaceReceivingService<T extends CaptureRequestVO>
- Returns:
- A list of ReceivingOrders, never null
-