Package org.openwms.wms.movements.impl
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
Movement
s.- Author:
- Heiko Scherrer
-
Field Summary
Modifier and TypeFieldDescriptionprivate final org.springframework.context.ApplicationEventPublisher
private final org.springframework.plugin.core.PluginRegistry
<MovementHandler, MovementType> private final org.openwms.common.location.api.LocationApi
private final org.openwms.common.location.api.LocationGroupApi
private static final org.slf4j.Logger
private final org.ameba.mapping.BeanMapper
private final MovementStateResolver
private final MovementTypeResolver
private final MovementRepository
private final org.ameba.i18n.Translator
private final org.openwms.common.transport.api.TransportUnitApi
private final javax.validation.Validator
private final Validators
-
Constructor Summary
ConstructorDescriptionMovementServiceImpl
(org.springframework.context.ApplicationEventPublisher eventPublisher, org.ameba.mapping.BeanMapper mapper, javax.validation.Validator validator, org.ameba.i18n.Translator translator, MovementStateResolver movementStateResolver, MovementRepository repository, 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 Summary
Modifier and TypeMethodDescription@NotNull MovementVO
Cancel an existingMovement
.@NotNull MovementVO
complete
(@NotBlank String pKey, @Valid @NotNull MovementVO vo) Complete aMovement
.private MovementVO
@NotNull MovementVO
create
(@NotBlank(groups=Create.class) String bk, @NotNull(groups=Create.class) @Valid MovementVO vo) Create a newMovement
for aTransportUnit
.@NotNull List
<MovementVO> findAll()
Find and return all existingMovement
s.findFor
(@NotNull MovementState state, @NotBlank String source, @NotEmpty MovementType... types) Find and returnMovements
in the givenstate
and of one of thetypes
.findForTuAndTypesAndStates
(@NotBlank String barcode, @NotEmpty List<MovementType> types, @NotEmpty List<String> states) Find allMovement
s for aTransportUnit
with the givenbarcode
andstates
.private Movement
findInternal
(String pKey) Get all priorities as a list of strings.@NotNull MovementVO
move
(@NotBlank String pKey, @Valid @NotNull MovementVO vo) Move aMovement
to a new location.private MovementHandler
resolveHandler
(MovementType type) private org.openwms.common.location.api.LocationVO
resolveLocation
(String locationIdentifier) private void
private void
-
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
-
repository
-
movementTypeResolver
-
handlers
-
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 newMovement
for aTransportUnit
.- Specified by:
create
in interfaceMovementService
- Parameters:
bk
- The identifying business key of the TransportUnit to movevo
- Detailed Movement information- Returns:
- The created Movement instance
-
resolveHandler
-
resolveTransportUnit
-
resolveLocation
-
validateAndResolveType
-
findFor
@Measured public List<MovementVO> findFor(@NotNull @NotNull MovementState state, @NotBlank @NotBlank String source, @NotEmpty @NotEmpty MovementType... types) Find and returnMovements
in the givenstate
and of one of thetypes
.- Specified by:
findFor
in interfaceMovementService
- Parameters:
state
- The state the Movement is insource
- The source of the Movementtypes
- The type of Movement- Returns:
- A list of, never null
-
getPriorityList
Get all priorities as a list of strings.- Specified by:
getPriorityList
in interfaceMovementService
- Returns:
- The list of priorities
-
findInternal
-
move
@Validated(Move.class) @Measured @NotNull public @NotNull MovementVO move(@NotBlank @NotBlank String pKey, @Valid @NotNull @Valid @NotNull MovementVO vo) Move aMovement
to a new location.- Specified by:
move
in interfaceMovementService
- Parameters:
pKey
- The persistent key of the Movementvo
- 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 aMovement
.- Specified by:
complete
in interfaceMovementService
- Parameters:
pKey
- The identifying persistent key of the Movement to completevo
- Required data to set at completion- Returns:
- The completed instance
-
cancel
Cancel an existingMovement
.- Specified by:
cancel
in interfaceMovementService
- Parameters:
pKey
- The identifying persistent key of the Movement to complete- Returns:
- The cancelled instance
-
findAll
Find and return all existingMovement
s.- Specified by:
findAll
in interfaceMovementService
- 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 allMovement
s for aTransportUnit
with the givenbarcode
andstates
.- Specified by:
findForTuAndTypesAndStates
in interfaceMovementService
- Parameters:
barcode
- The business key of the TransportUnit to movetypes
- A list of types to considerstates
- A list of states to consider- Returns:
- A list of Movements, never null
-
convert
-