Package org.openwms.wms.transport.impl
Class TransportUnitServiceImpl
java.lang.Object
org.openwms.wms.transport.impl.TransportUnitServiceImpl
- All Implemented Interfaces:
TransportUnitService
A TransportUnitServiceImpl is a transactional Spring managed service implementation of
TransportUnitService
.- Author:
- Heiko Scherrer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LocationService
private static final org.slf4j.Logger
private final org.springframework.context.ApplicationEventPublisher
private final TransportUnitRepository
private final TimeProvider
private final org.ameba.i18n.Translator
private final CommonTransportUnitApi
-
Constructor Summary
ConstructorsConstructorDescriptionTransportUnitServiceImpl
(org.ameba.i18n.Translator translator, TransportUnitRepository repository, LocationService locationService, CommonTransportUnitApi transportUnitApi, org.springframework.context.ApplicationEventPublisher publisher) -
Method Summary
Modifier and TypeMethodDescription@NotNull TransportUnit
create
(@NotNull TransportUnit transportUnit) Create a newTransportUnit
.private TransportUnit
@NotNull TransportUnit
createWithBK
(@NotBlank String transportUnitBK, @NotBlank String tut, @NotBlank String actualErpCode, String loadUnitType, Integer parts, String customerOrderId) @NotNull CommonTransportUnitVO
createWithoutBK
(@NotBlank String tut, @NotBlank String actualErpCode, String loadUnitType, Integer parts, String customerOrderId) @NotNull List<TransportUnit>
Find and returnTransportUnit
s.@NotNull TransportUnit
findByPKey
(@NotBlank String pKey) Find and return aTransportUnit
.Find and return aTransportUnit
.private Optional<TransportUnit>
findOneByInternal
(String transportUnitBK) findOneByOrThrow
(@NotBlank String transportUnitBK) Find and return aTransportUnit
.private TransportUnit
findOneByOrThrowInternal
(String transportUnitBK) @NotNull List<TransportUnit>
findOnLocation
(@NotBlank String erpCode) Find and return allTransportUnit
s that are located on theLocation
identified by the givenerpCode
.@NotNull TransportUnit
moveTransportUnit
(@NotNull Barcode transportUnitBK, @NotBlank String targetLocationIdentifier) Move aTransportUnit
to a newLocation
.private int
numberOfTransportUnits
(Location location) private Location
private Location
private Location
resolveAndCheckLocation
(String locationIdentifier) @NotNull TransportUnit
save
(@NotNull TransportUnit tu) Save an existingTransportUnit
.private void
validateNotExists
(TransportUnit transportUnit)
-
Field Details
-
timeProvider
-
LOGGER
private static final org.slf4j.Logger LOGGER -
translator
private final org.ameba.i18n.Translator translator -
repository
-
locationService
-
transportUnitApi
-
publisher
private final org.springframework.context.ApplicationEventPublisher publisher
-
-
Constructor Details
-
TransportUnitServiceImpl
TransportUnitServiceImpl(org.ameba.i18n.Translator translator, TransportUnitRepository repository, LocationService locationService, CommonTransportUnitApi transportUnitApi, org.springframework.context.ApplicationEventPublisher publisher)
-
-
Method Details
-
findOneBy
Find and return aTransportUnit
.- Specified by:
findOneBy
in interfaceTransportUnitService
- Parameters:
transportUnitBK
- The business key- Returns:
- The instance
-
findOneByInternal
-
findOneByOrThrow
Find and return aTransportUnit
.- Specified by:
findOneByOrThrow
in interfaceTransportUnitService
- Parameters:
transportUnitBK
- The business key- Returns:
- The instance
-
findOneByOrThrowInternal
-
findAllBy
@Measured @NotNull public @NotNull List<TransportUnit> findAllBy(@NotEmpty @NotEmpty List<String> transportUnitBKs) Find and returnTransportUnit
s.- Specified by:
findAllBy
in interfaceTransportUnitService
- Parameters:
transportUnitBKs
- The business keys of the TransportUnits to search for- Returns:
- All instances, never null
-
findByPKey
Find and return aTransportUnit
.- Specified by:
findByPKey
in interfaceTransportUnitService
- Parameters:
pKey
- The persistent identifier- Returns:
- The instance, never null
-
findOnLocation
@Measured @NotNull public @NotNull List<TransportUnit> findOnLocation(@NotBlank @NotBlank String erpCode) Find and return allTransportUnit
s that are located on theLocation
identified by the givenerpCode
.- Specified by:
findOnLocation
in interfaceTransportUnitService
- Parameters:
erpCode
- The Location where the TransportUnits are placed on- Returns:
- All TransportUnits or an empty List, never null
-
create
@Measured @NotNull public @NotNull TransportUnit create(@NotNull @NotNull TransportUnit transportUnit) Create a newTransportUnit
.- Specified by:
create
in interfaceTransportUnitService
- Parameters:
transportUnit
- The instance to create- Returns:
- The created instance
-
validateNotExists
-
moveTransportUnit
@Measured @NotNull public @NotNull TransportUnit moveTransportUnit(@NotNull @NotNull Barcode transportUnitBK, @NotBlank @NotBlank String targetLocationIdentifier) Move aTransportUnit
to a newLocation
.- Specified by:
moveTransportUnit
in interfaceTransportUnitService
- Parameters:
transportUnitBK
- The business key of the TransportUnit to movetargetLocationIdentifier
- The ERP code or the LocationId of the Location to move to- Returns:
- The moved instance
-
numberOfTransportUnits
-
createWithoutBK
@Measured @NotNull public @NotNull CommonTransportUnitVO createWithoutBK(@NotBlank @NotBlank String tut, @NotBlank @NotBlank String actualErpCode, String loadUnitType, Integer parts, String customerOrderId) - Specified by:
createWithoutBK
in interfaceTransportUnitService
- Parameters:
tut
- The name of the TransportUnitType to useactualErpCode
- The actual ERP codeloadUnitType
- The name of the LoadUnitType (optional)parts
- The number of LoadUnits to create (optional)customerOrderId
- A reference to the customer order this TransportUnit is assigned to (optional)- Returns:
- The created instance
-
createWithBK
@Measured @NotNull public @NotNull TransportUnit createWithBK(@NotBlank @NotBlank String transportUnitBK, @NotBlank @NotBlank String tut, @NotBlank @NotBlank String actualErpCode, String loadUnitType, Integer parts, String customerOrderId) - Specified by:
createWithBK
in interfaceTransportUnitService
- Parameters:
transportUnitBK
- The business key to usetut
- The name of the TransportUnitType to useactualErpCode
- The actual ERP codeloadUnitType
- The name of the LoadUnitType (optional)parts
- The number of LoadUnits to create (optional)customerOrderId
- A reference to the customer order this TransportUnit is assigned to (optional)- Returns:
- The created instance
-
createTransportUnitInternal
-
resolveAndCheckLocation
-
resolve
-
refresh
-
save
Save an existingTransportUnit
.- Specified by:
save
in interfaceTransportUnitService
- Parameters:
tu
- The modified instance to save- Returns:
- The saved instance
-