Package org.openwms.wms.receiving.impl
Class ReceivingServiceImpl
- java.lang.Object
-
- org.openwms.wms.receiving.impl.ReceivingServiceImpl
-
- All Implemented Interfaces:
ReceivingService
@Validated @TxService class ReceivingServiceImpl extends Object implements ReceivingService
A ReceivingServiceImpl is a Spring managed transactional Services that deals withReceivingOrder
s.- Author:
- Heiko Scherrer
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Logger
LOGGER
private boolean
overbookingAllowed
private PackagingUnitApi
packagingUnitApi
private org.springframework.context.ApplicationEventPublisher
publisher
private ReceivingOrderRepository
repository
private ProductService
service
private org.ameba.i18n.Translator
translator
-
Constructor Summary
Constructors Constructor Description ReceivingServiceImpl(boolean overbookingAllowed, org.ameba.i18n.Translator translator, ReceivingOrderRepository repository, ProductService service, org.springframework.context.ApplicationEventPublisher publisher, PackagingUnitApi packagingUnitApi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancelOrder(@NotEmpty String pKey)
Cancel aReceivingOrder
.@NotNull ReceivingOrder
capture(@NotEmpty String pKey, @NotEmpty String transportUnitId, @NotEmpty String loadUnitPosition, @NotEmpty String loadUnitType, @NotNull org.openwms.core.units.api.Measurable quantityReceived, CaptureDetailsVO details, @NotNull @Valid Product product)
Decrease one of theReceivingOrderPosition
s by the received amount of the givenProduct
and book the received article to theTransportUnit
identified by thetransportUnitId
.@NotNull ReceivingOrder
createOrder(@NotNull @Valid ReceivingOrder order)
Create aReceivingOrder
with containingReceivingOrderPosition
.@NotNull List<ReceivingOrder>
findAll()
Find and return all existingReceivingOrder
s.Optional<ReceivingOrder>
findByOrderId(@NotEmpty String orderId)
Find and return aReceivingOrder
identified by its business key.@NotNull ReceivingOrder
findByPKey(@NotEmpty String pKey)
Find and return aReceivingOrder
identified by its synthetic persistent key.
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
overbookingAllowed
private final boolean overbookingAllowed
-
translator
private final org.ameba.i18n.Translator translator
-
repository
private final ReceivingOrderRepository repository
-
service
private final ProductService service
-
publisher
private final org.springframework.context.ApplicationEventPublisher publisher
-
packagingUnitApi
private final PackagingUnitApi packagingUnitApi
-
-
Constructor Detail
-
ReceivingServiceImpl
ReceivingServiceImpl(@Value("${owms.receiving.unexpected-receipts-allowed:true}") boolean overbookingAllowed, org.ameba.i18n.Translator translator, ReceivingOrderRepository repository, ProductService service, org.springframework.context.ApplicationEventPublisher publisher, PackagingUnitApi packagingUnitApi)
-
-
Method Detail
-
createOrder
@Measured @NotNull public @NotNull ReceivingOrder createOrder(@NotNull @Valid @NotNull @Valid ReceivingOrder order)
Create aReceivingOrder
with containingReceivingOrderPosition
.- Specified by:
createOrder
in interfaceReceivingService
- Parameters:
order
- The ReceivingOrder instance to create- Returns:
- The saved instance
-
capture
@Measured @NotNull public @NotNull ReceivingOrder capture(@NotEmpty @NotEmpty String pKey, @NotEmpty @NotEmpty String transportUnitId, @NotEmpty @NotEmpty String loadUnitPosition, @NotEmpty @NotEmpty String loadUnitType, @NotNull @NotNull org.openwms.core.units.api.Measurable quantityReceived, CaptureDetailsVO details, @NotNull @Valid @NotNull @Valid Product product)
Decrease one of theReceivingOrderPosition
s by the received amount of the givenProduct
and book the received article to theTransportUnit
identified by thetransportUnitId
.- Specified by:
capture
in interfaceReceivingService
- Parameters:
pKey
- The persistent key of the ReceivingOrdertransportUnitId
- The identifier of the TransportUnit to book the Product toloadUnitPosition
- The position of the LoadUnitloadUnitType
- In case the LoadUnit is created this is type for the LoadUnitquantityReceived
- The received quantityproduct
- The received Product- Returns:
- The updated ReceivingOrder instance with updated positions
-
findByPKey
@Measured @NotNull public @NotNull ReceivingOrder findByPKey(@NotEmpty @NotEmpty String pKey)
Find and return aReceivingOrder
identified by its synthetic persistent key.- Specified by:
findByPKey
in interfaceReceivingService
- Parameters:
pKey
- The synthetic persistent key- Returns:
- The instance
-
findByOrderId
@Measured public Optional<ReceivingOrder> findByOrderId(@NotEmpty @NotEmpty String orderId)
Find and return aReceivingOrder
identified by its business key.- Specified by:
findByOrderId
in interfaceReceivingService
- Parameters:
orderId
- The business key- Returns:
- The order instance
-
cancelOrder
@Measured public void cancelOrder(@NotEmpty @NotEmpty String pKey)
Cancel aReceivingOrder
.- Specified by:
cancelOrder
in interfaceReceivingService
- Parameters:
pKey
- The synthetic persistent key
-
findAll
@Measured @NotNull public @NotNull List<ReceivingOrder> findAll()
Find and return all existingReceivingOrder
s.- Specified by:
findAll
in interfaceReceivingService
- Returns:
- A list of ReceivingOrders, never null
-
-