Package org.openwms.wms.inventory.impl
Class LoadUnitServiceImpl
java.lang.Object
org.openwms.wms.inventory.impl.LoadUnitServiceImpl
- All Implemented Interfaces:
LoadUnitService
A LoadUnitServiceImpl.
- Author:
- Heiko Scherrer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.springframework.context.ApplicationEventPublisher
private final LoadUnitTypeService
private static final org.slf4j.Logger
private final PackagingUnitRepository
private final ProductService
private final LoadUnitRepository
private final TransportUnitService
private final org.ameba.i18n.Translator
-
Constructor Summary
ConstructorsConstructorDescriptionLoadUnitServiceImpl
(org.ameba.i18n.Translator translator, LoadUnitRepository repository, PackagingUnitRepository packagingUnitRepository, LoadUnitTypeService loadUnitTypeRepository, ProductService productService, TransportUnitService service, org.springframework.context.ApplicationEventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionprivate LoadUnit
createInternal
(TransportUnit tu, LoadUnitType type, String position) void
Divide aTransportUnit
identified by its business key into a number of parts.Find and return allLoadUnit
s on aTransportUnit
.findByPKey
(@NotBlank String pKey) Find and return aLoadUnit
.private LoadUnit
findInternal
(String pKey) findInternal
(String transportUnitBK, String loadUnitPosition) findOptional
(@NotBlank String transportUnitBK, @NotBlank String loadUnitPosition) findOrThrow
(@NotNull Long pk) Find and return aLoadUnit
.private TransportUnit
findTransportUnit
(String transportUnitBK) private LoadUnitType
getLoadUnitType
(String loadUnitType) boolean
isLoadUnitEmpty
(@NotBlank String transportUnitBK, @NotBlank String loadUnitPosition) Checks whether theLoadUnit
is empty.void
Load aLoadUnit
with the givenProduct
.Save an already existing and modified instance of aLoadUnit
.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
translator
private final org.ameba.i18n.Translator translator -
repository
-
packagingUnitRepository
-
loadUnitTypeService
-
productService
-
service
-
eventPublisher
private final org.springframework.context.ApplicationEventPublisher eventPublisher
-
-
Constructor Details
-
LoadUnitServiceImpl
LoadUnitServiceImpl(org.ameba.i18n.Translator translator, LoadUnitRepository repository, PackagingUnitRepository packagingUnitRepository, LoadUnitTypeService loadUnitTypeRepository, ProductService productService, TransportUnitService service, org.springframework.context.ApplicationEventPublisher eventPublisher)
-
-
Method Details
-
create
@Measured public LoadUnit create(@NotBlank @NotBlank String transportUnitBK, @NotBlank @NotBlank String position, @NotBlank @NotBlank String loadUnitType) - Specified by:
create
in interfaceLoadUnitService
- Parameters:
transportUnitBK
- The TransportUnit's business keyposition
- The position on the TransportUnitloadUnitType
- The LoadUnitType to assign the LoadUnit to- Returns:
- The newly created instance
-
findTransportUnit
-
divide
@Measured public void divide(@NotBlank @NotBlank String transportUnitBK, @NotBlank @NotBlank String loadUnitType, int parts) Divide aTransportUnit
identified by its business key into a number of parts.- Specified by:
divide
in interfaceLoadUnitService
- Parameters:
transportUnitBK
- The business key of the TransportUnit to divideloadUnitType
- The type of that the LoadUnits are createdparts
- The number of parts
-
createInternal
-
getLoadUnitType
-
load
@Measured public void load(@NotBlank @NotBlank String pKey, @NotNull @Valid @NotNull @Valid ProductVO product) Load aLoadUnit
with the givenProduct
.- Specified by:
load
in interfaceLoadUnitService
- Parameters:
pKey
- The synthetic persistent key of the LoadUnitproduct
- The Product to load
-
findInternal
-
find
Find and return allLoadUnit
s on aTransportUnit
.- Specified by:
find
in interfaceLoadUnitService
- Parameters:
transportUnitBK
- The business key of the TransportUnit- Returns:
- The LoadUnit instance
-
findOptional
@Measured public Optional<LoadUnit> findOptional(@NotBlank @NotBlank String transportUnitBK, @NotBlank @NotBlank String loadUnitPosition) - Specified by:
findOptional
in interfaceLoadUnitService
- Parameters:
transportUnitBK
- The business key of the TransportUnitloadUnitPosition
- The position of the LoadUnit on top of the TransportUnit- Returns:
- The LoadUnit instance
-
findInternal
-
find
@Measured public LoadUnit find(@NotBlank @NotBlank String transportUnitBK, @NotBlank @NotBlank String loadUnitPosition) - Specified by:
find
in interfaceLoadUnitService
- Parameters:
transportUnitBK
- The business key of the TransportUnitloadUnitPosition
- The position of the LoadUnit on top of the TransportUnit- Returns:
- The LoadUnit instance
-
save
Save an already existing and modified instance of aLoadUnit
.- Specified by:
save
in interfaceLoadUnitService
- Parameters:
loadUnit
- The modified LoadUnit to save- Returns:
- The saved instance
-
findByPKey
Find and return aLoadUnit
.- Specified by:
findByPKey
in interfaceLoadUnitService
- Parameters:
pKey
- The persistent key- Returns:
- The instance
-
findOrThrow
Find and return aLoadUnit
.- Specified by:
findOrThrow
in interfaceLoadUnitService
- Parameters:
pk
- The primary key- Returns:
- The instance
-
isLoadUnitEmpty
@Measured public boolean isLoadUnitEmpty(@NotBlank @NotBlank String transportUnitBK, @NotBlank @NotBlank String loadUnitPosition) Checks whether theLoadUnit
is empty.- Specified by:
isLoadUnitEmpty
in interfaceLoadUnitService
- Parameters:
transportUnitBK
- The identifying business key of the TransportUnit the LoadUnit is placed onloadUnitPosition
- The identifying position within that TransportUnit- Returns:
- true if empty
-