Class TransportUnitServiceImpl

java.lang.Object
org.openwms.wms.transport.impl.TransportUnitServiceImpl
All Implemented Interfaces:
TransportUnitService

@Validated @TxService class TransportUnitServiceImpl extends Object implements TransportUnitService
A TransportUnitServiceImpl is a transactional Spring managed service implementation of TransportUnitService.
Author:
Heiko Scherrer
  • Field Details

    • timeProvider

      private final TimeProvider timeProvider
    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • translator

      private final org.ameba.i18n.Translator translator
    • repository

      private final TransportUnitRepository repository
    • locationService

      private final LocationService locationService
    • transportUnitApi

      private final CommonTransportUnitApi transportUnitApi
    • publisher

      private final org.springframework.context.ApplicationEventPublisher publisher
  • Constructor Details

  • Method Details

    • findOneBy

      @Measured public Optional<TransportUnit> findOneBy(@NotBlank @NotBlank String transportUnitBK)
      Find and return a TransportUnit.
      Specified by:
      findOneBy in interface TransportUnitService
      Parameters:
      transportUnitBK - The business key
      Returns:
      The instance
    • findOneByInternal

      private Optional<TransportUnit> findOneByInternal(String transportUnitBK)
    • findOneByOrThrow

      @Measured public TransportUnit findOneByOrThrow(@NotBlank @NotBlank String transportUnitBK)
      Find and return a TransportUnit.
      Specified by:
      findOneByOrThrow in interface TransportUnitService
      Parameters:
      transportUnitBK - The business key
      Returns:
      The instance
    • findOneByOrThrowInternal

      private TransportUnit findOneByOrThrowInternal(String transportUnitBK)
    • findAllBy

      @Measured @NotNull public @NotNull List<TransportUnit> findAllBy(@NotEmpty @NotEmpty List<String> transportUnitBKs)
      Find and return TransportUnits.
      Specified by:
      findAllBy in interface TransportUnitService
      Parameters:
      transportUnitBKs - The business keys of the TransportUnits to search for
      Returns:
      All instances, never null
    • findByPKey

      @Measured @NotNull public @NotNull TransportUnit findByPKey(@NotBlank @NotBlank String pKey)
      Find and return a TransportUnit.
      Specified by:
      findByPKey in interface TransportUnitService
      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 all TransportUnits that are located on the Location identified by the given erpCode.
      Specified by:
      findOnLocation in interface TransportUnitService
      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 new TransportUnit.
      Specified by:
      create in interface TransportUnitService
      Parameters:
      transportUnit - The instance to create
      Returns:
      The created instance
    • validateNotExists

      private void validateNotExists(TransportUnit transportUnit)
    • moveTransportUnit

      @Measured @NotNull public @NotNull TransportUnit moveTransportUnit(@NotNull @NotNull Barcode transportUnitBK, @NotBlank @NotBlank String targetLocationIdentifier)
      Move a TransportUnit to a new Location.
      Specified by:
      moveTransportUnit in interface TransportUnitService
      Parameters:
      transportUnitBK - The business key of the TransportUnit to move
      targetLocationIdentifier - The ERP code or the LocationId of the Location to move to
      Returns:
      The moved instance
    • numberOfTransportUnits

      private int numberOfTransportUnits(Location location)
    • createWithoutBK

      @Measured @NotNull public @NotNull CommonTransportUnitVO createWithoutBK(@NotBlank @NotBlank String tut, @NotBlank @NotBlank String actualErpCode, String loadUnitType, Integer parts, String customerOrderId)
      Create a TransportUnit with a transportUnitBK generated by the system and a number of LoadUnits.
      Specified by:
      createWithoutBK in interface TransportUnitService
      Parameters:
      tut - The name of the TransportUnitType to use
      actualErpCode - The actual ERP code
      loadUnitType - 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)
      Create a TransportUnit with the given transportUnitBK and a number of LoadUnits.
      Specified by:
      createWithBK in interface TransportUnitService
      Parameters:
      transportUnitBK - The business key to use
      tut - The name of the TransportUnitType to use
      actualErpCode - The actual ERP code
      loadUnitType - 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

      private TransportUnit createTransportUnitInternal(TransportUnit result)
    • resolveAndCheckLocation

      private Location resolveAndCheckLocation(String locationIdentifier)
    • resolve

      private Location resolve(String locationIdentifier)
    • refresh

      private Location refresh(Location location)
    • save

      @Measured @NotNull public @NotNull TransportUnit save(@NotNull @NotNull TransportUnit tu)
      Save an existing TransportUnit.
      Specified by:
      save in interface TransportUnitService
      Parameters:
      tu - The modified instance to save
      Returns:
      The saved instance