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 LocationServiceprivate static final org.slf4j.Loggerprivate final org.springframework.context.ApplicationEventPublisherprivate final TransportUnitRepositoryprivate final TimeProviderprivate final org.ameba.i18n.Translatorprivate 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 TransportUnitcreate(@NotNull TransportUnit transportUnit) Create a newTransportUnit.private TransportUnit@NotNull TransportUnitcreateWithBK(@NotBlank String transportUnitBK, @NotBlank String tut, @NotBlank String actualErpCode, String loadUnitType, Integer parts, String customerOrderId) @NotNull CommonTransportUnitVOcreateWithoutBK(@NotBlank String tut, @NotBlank String actualErpCode, String loadUnitType, Integer parts, String customerOrderId) @NotNull List<TransportUnit> Find and returnTransportUnits.@NotNull TransportUnitfindByPKey(@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 TransportUnitfindOneByOrThrowInternal(String transportUnitBK) @NotNull List<TransportUnit> findOnLocation(@NotBlank String erpCode) Find and return allTransportUnits that are located on theLocationidentified by the givenerpCode.@NotNull TransportUnitmoveTransportUnit(@NotNull Barcode transportUnitBK, @NotBlank String targetLocationIdentifier) Move aTransportUnitto a newLocation.private intnumberOfTransportUnits(Location location) private Locationprivate Locationprivate LocationresolveAndCheckLocation(String locationIdentifier) @NotNull TransportUnitsave(@NotNull TransportUnit tu) Save an existingTransportUnit.private voidvalidateNotExists(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:
findOneByin interfaceTransportUnitService- Parameters:
transportUnitBK- The business key- Returns:
- The instance
-
findOneByInternal
-
findOneByOrThrow
Find and return aTransportUnit.- Specified by:
findOneByOrThrowin 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 returnTransportUnits.- Specified by:
findAllByin interfaceTransportUnitService- Parameters:
transportUnitBKs- The business keys of the TransportUnits to search for- Returns:
- All instances, never null
-
findByPKey
Find and return aTransportUnit.- Specified by:
findByPKeyin 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 allTransportUnits that are located on theLocationidentified by the givenerpCode.- Specified by:
findOnLocationin 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:
createin 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 aTransportUnitto a newLocation.- Specified by:
moveTransportUnitin 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:
createWithoutBKin 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:
createWithBKin 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:
savein interfaceTransportUnitService- Parameters:
tu- The modified instance to save- Returns:
- The saved instance
-