Class LoadUnitServiceImpl

java.lang.Object
org.openwms.wms.inventory.impl.LoadUnitServiceImpl
All Implemented Interfaces:
LoadUnitService

@Validated @TxService class LoadUnitServiceImpl extends Object implements LoadUnitService
A LoadUnitServiceImpl.
Author:
Heiko Scherrer
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • translator

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

      private final LoadUnitRepository repository
    • packagingUnitRepository

      private final PackagingUnitRepository packagingUnitRepository
    • loadUnitTypeService

      private final LoadUnitTypeService loadUnitTypeService
    • productService

      private final ProductService productService
    • service

      private final TransportUnitService service
    • eventPublisher

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

  • Method Details

    • create

      @Measured public LoadUnit create(@NotBlank @NotBlank String transportUnitBK, @NotBlank @NotBlank String position, @NotBlank @NotBlank String loadUnitType)
      Create a new LoadUnit with the given position on a TransportUnit.
      Specified by:
      create in interface LoadUnitService
      Parameters:
      transportUnitBK - The TransportUnit's business key
      position - The position on the TransportUnit
      loadUnitType - The LoadUnitType to assign the LoadUnit to
      Returns:
      The newly created instance
    • findTransportUnit

      private TransportUnit findTransportUnit(String transportUnitBK)
    • divide

      @Measured public void divide(@NotBlank @NotBlank String transportUnitBK, @NotBlank @NotBlank String loadUnitType, int parts)
      Divide a TransportUnit identified by its business key into a number of parts.
      Specified by:
      divide in interface LoadUnitService
      Parameters:
      transportUnitBK - The business key of the TransportUnit to divide
      loadUnitType - The type of that the LoadUnits are created
      parts - The number of parts
    • createInternal

      private LoadUnit createInternal(TransportUnit tu, LoadUnitType type, String position)
    • getLoadUnitType

      private LoadUnitType getLoadUnitType(String loadUnitType)
    • load

      @Measured public void load(@NotBlank @NotBlank String pKey, @NotNull @Valid @NotNull @Valid ProductVO product)
      Load a LoadUnit with the given Product.
      Specified by:
      load in interface LoadUnitService
      Parameters:
      pKey - The synthetic persistent key of the LoadUnit
      product - The Product to load
    • findInternal

      private LoadUnit findInternal(String pKey)
    • find

      @Measured public Optional<List<LoadUnit>> find(@NotBlank @NotBlank String transportUnitBK)
      Find and return all LoadUnits on a TransportUnit.
      Specified by:
      find in interface LoadUnitService
      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)
      Find and return a particular LoadUnit on a TransportUnit at the loadUnitPosition.
      Specified by:
      findOptional in interface LoadUnitService
      Parameters:
      transportUnitBK - The business key of the TransportUnit
      loadUnitPosition - The position of the LoadUnit on top of the TransportUnit
      Returns:
      The LoadUnit instance
    • findInternal

      private Optional<LoadUnit> findInternal(String transportUnitBK, String loadUnitPosition)
    • find

      @Measured public LoadUnit find(@NotBlank @NotBlank String transportUnitBK, @NotBlank @NotBlank String loadUnitPosition)
      Find and return a particular LoadUnit on a TransportUnit at the loadUnitPosition.
      Specified by:
      find in interface LoadUnitService
      Parameters:
      transportUnitBK - The business key of the TransportUnit
      loadUnitPosition - The position of the LoadUnit on top of the TransportUnit
      Returns:
      The LoadUnit instance
    • save

      @Measured public LoadUnit save(@NotNull @Valid @NotNull @Valid LoadUnit loadUnit)
      Save an already existing and modified instance of a LoadUnit.
      Specified by:
      save in interface LoadUnitService
      Parameters:
      loadUnit - The modified LoadUnit to save
      Returns:
      The saved instance
    • findByPKey

      @Measured public LoadUnit findByPKey(@NotBlank @NotBlank String pKey)
      Find and return a LoadUnit.
      Specified by:
      findByPKey in interface LoadUnitService
      Parameters:
      pKey - The persistent key
      Returns:
      The instance
    • findOrThrow

      @Measured public LoadUnit findOrThrow(@NotNull @NotNull Long pk)
      Find and return a LoadUnit.
      Specified by:
      findOrThrow in interface LoadUnitService
      Parameters:
      pk - The primary key
      Returns:
      The instance
    • isLoadUnitEmpty

      @Measured public boolean isLoadUnitEmpty(@NotBlank @NotBlank String transportUnitBK, @NotBlank @NotBlank String loadUnitPosition)
      Checks whether the LoadUnit is empty.
      Specified by:
      isLoadUnitEmpty in interface LoadUnitService
      Parameters:
      transportUnitBK - The identifying business key of the TransportUnit the LoadUnit is placed on
      loadUnitPosition - The identifying position within that TransportUnit
      Returns:
      true if empty