Class MovementServiceImpl

java.lang.Object
org.openwms.wms.movements.impl.MovementServiceImpl
All Implemented Interfaces:
MovementService

@Validated @TxService @RefreshScope class MovementServiceImpl extends Object implements MovementService
A MovementServiceImpl is a Spring managed transaction service that deals with Movements.
Author:
Heiko Scherrer
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • eventPublisher

      private final org.springframework.context.ApplicationEventPublisher eventPublisher
    • mapper

      private final org.ameba.mapping.BeanMapper mapper
    • validator

      private final javax.validation.Validator validator
    • translator

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

      private final MovementStateResolver movementStateResolver
    • repository

      private final MovementRepository repository
    • movementTypeResolver

      private final MovementTypeResolver movementTypeResolver
    • handlers

      private final org.springframework.plugin.core.PluginRegistry<MovementHandler,MovementType> handlers
    • validators

      private final Validators validators
    • transportUnitApi

      private final org.openwms.common.transport.api.TransportUnitApi transportUnitApi
    • locationApi

      private final org.openwms.common.location.api.LocationApi locationApi
    • locationGroupApi

      private final org.openwms.common.location.api.LocationGroupApi locationGroupApi
  • Constructor Details

    • MovementServiceImpl

      MovementServiceImpl(org.springframework.context.ApplicationEventPublisher eventPublisher, org.ameba.mapping.BeanMapper mapper, javax.validation.Validator validator, org.ameba.i18n.Translator translator, MovementStateResolver movementStateResolver, MovementRepository repository, @Autowired(required=false) MovementTypeResolver movementTypeResolver, org.springframework.plugin.core.PluginRegistry<MovementHandler,MovementType> handlers, Validators validators, org.openwms.common.transport.api.TransportUnitApi transportUnitApi, org.openwms.common.location.api.LocationApi locationApi, org.openwms.common.location.api.LocationGroupApi locationGroupApi)
  • Method Details

    • create

      @Measured @Validated(Create.class) @NotNull public @NotNull MovementVO create(@NotBlank(groups=Create.class) @NotBlank(groups=Create.class) String bk, @NotNull(groups=Create.class) @Valid @NotNull(groups=Create.class) @Valid MovementVO vo)
      Create a new Movement for a TransportUnit.
      Specified by:
      create in interface MovementService
      Parameters:
      bk - The identifying business key of the TransportUnit to move
      vo - Detailed Movement information
      Returns:
      The created Movement instance
    • resolveHandler

      private MovementHandler resolveHandler(MovementType type)
    • resolveTransportUnit

      private void resolveTransportUnit(String bk)
    • resolveLocation

      private org.openwms.common.location.api.LocationVO resolveLocation(String locationIdentifier)
    • validateAndResolveType

      private void validateAndResolveType(MovementVO vo)
    • findFor

      @Measured public List<MovementVO> findFor(@NotNull @NotNull MovementState state, @NotBlank @NotBlank String source, @NotEmpty @NotEmpty MovementType... types)
      Find and return Movements in the given state and of one of the types.
      Specified by:
      findFor in interface MovementService
      Parameters:
      state - The state the Movement is in
      source - The source of the Movement
      types - The type of Movement
      Returns:
      A list of, never null
    • getPriorityList

      @Measured public List<String> getPriorityList()
      Get all priorities as a list of strings.
      Specified by:
      getPriorityList in interface MovementService
      Returns:
      The list of priorities
    • findInternal

      private Movement findInternal(String pKey)
    • move

      @Validated(Move.class) @Measured @NotNull public @NotNull MovementVO move(@NotBlank @NotBlank String pKey, @Valid @NotNull @Valid @NotNull MovementVO vo)
      Move a Movement to a new location.
      Specified by:
      move in interface MovementService
      Parameters:
      pKey - The persistent key of the Movement
      vo - The Movement data must contain the new source
      Returns:
      The moved instance
    • complete

      @Validated(Complete.class) @Measured @NotNull public @NotNull MovementVO complete(@NotBlank @NotBlank String pKey, @Valid @NotNull @Valid @NotNull MovementVO vo)
      Complete a Movement.
      Specified by:
      complete in interface MovementService
      Parameters:
      pKey - The identifying persistent key of the Movement to complete
      vo - Required data to set at completion
      Returns:
      The completed instance
    • cancel

      @Measured @NotNull public @NotNull MovementVO cancel(@NotBlank @NotBlank String pKey)
      Cancel an existing Movement.
      Specified by:
      cancel in interface MovementService
      Parameters:
      pKey - The identifying persistent key of the Movement to complete
      Returns:
      The cancelled instance
    • findAll

      @Measured @NotNull public @NotNull List<MovementVO> findAll()
      Find and return all existing Movements.
      Specified by:
      findAll in interface MovementService
      Returns:
      All instances, never null
    • findForTuAndTypesAndStates

      @Measured public List<MovementVO> findForTuAndTypesAndStates(@NotBlank @NotBlank String barcode, @NotEmpty @NotEmpty List<MovementType> types, @NotEmpty @NotEmpty List<String> states)
      Find all Movements for a TransportUnit with the given barcode and states.
      Specified by:
      findForTuAndTypesAndStates in interface MovementService
      Parameters:
      barcode - The business key of the TransportUnit to move
      types - A list of types to consider
      states - A list of states to consider
      Returns:
      A list of Movements, never null
    • convert

      private MovementVO convert(Movement eo)