Package org.openwms.tms.impl
Class TransportationServiceImpl
java.lang.Object
org.openwms.tms.impl.TransportationServiceImpl
- All Implemented Interfaces:
TransportationService<TransportOrder>
@TxService
class TransportationServiceImpl
extends Object
implements TransportationService<TransportOrder>
A TransportationServiceImpl is a Spring managed transactional service.
- Author:
- Heiko Scherrer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.springframework.context.ApplicationContextprivate static final org.slf4j.Loggerprivate final TransportOrderRepository<TransportOrder, Long> private final StateManagerprivate final List<TargetResolver<org.openwms.common.location.api.TargetVO>> private final org.ameba.i18n.Translatorprivate final List<UpdateFunction> -
Constructor Summary
ConstructorsConstructorDescriptionTransportationServiceImpl(org.ameba.i18n.Translator translator, TransportOrderRepository<TransportOrder, Long> repository, org.springframework.context.ApplicationContext ctx, StateManager stateManager, List<UpdateFunction> updateFunctions, List<TargetResolver<org.openwms.common.location.api.TargetVO>> targetResolvers) -
Method Summary
Modifier and TypeMethodDescriptionchange(String barcode, TransportOrderState currentState, TransportOrderState targetState, Message message) change(TransportOrderState state, Collection<String> pKeys) Try to turn a list ofTransportOrders into the givenstate.Create a newTransportOrderwith the giventarget.private TransportOrder@NotNull TransportOrderfindByPKey(@NotBlank String pKey) Find and return theTransportOrderidentified by the persisted keypKey.intgetNoTransportOrdersToTarget(String target, String... states) update(TransportOrder transportOrder) Modifies an existingTransportOrderaccording to the argument passed asTransportOrder.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
translator
private final org.ameba.i18n.Translator translator -
repository
-
ctx
private final org.springframework.context.ApplicationContext ctx -
stateManager
-
updateFunctions
-
targetResolvers
-
-
Constructor Details
-
TransportationServiceImpl
TransportationServiceImpl(org.ameba.i18n.Translator translator, TransportOrderRepository<TransportOrder, Long> repository, org.springframework.context.ApplicationContext ctx, StateManager stateManager, @Autowired(required=false) List<UpdateFunction> updateFunctions, @Autowired(required=false) List<TargetResolver<org.openwms.common.location.api.TargetVO>> targetResolvers)
-
-
Method Details
-
findBy
- Specified by:
findByin interfaceTransportationService<TransportOrder>- Parameters:
barcode- The Barcode of the TransportUnitstates- A set of TransportOrder states- Returns:
- A List of all TransportOrders, never null
-
findByPKey
Find and return theTransportOrderidentified by the persisted keypKey.- Specified by:
findByPKeyin interfaceTransportationService<TransportOrder>- Parameters:
pKey- The persisted key- Returns:
- An
TransportOrderinstance
-
findBy
-
getNoTransportOrdersToTarget
- Specified by:
getNoTransportOrdersToTargetin interfaceTransportationService<TransportOrder>- Parameters:
target- The target place to search TransportOrders forstates- An array of TransportOrder states to filter TransportOrders for- Returns:
- Number of all TransportOrders in one of the
statesthat are on the way to thetarget
-
create
@Transactional(propagation=REQUIRES_NEW, noRollbackFor=StateChangeException.class) @Measured public TransportOrder create(String barcode, String target, String priority) Create a newTransportOrderwith the giventarget.Checks that all necessary data to create a TransportOrder is given, does not do any logical checks, whether a target is blocked or a
TransportOrderfor theTransportUnitexist.- Specified by:
createin interfaceTransportationService<TransportOrder>- Parameters:
barcode- The ID of theTransportUnitto movetarget- The target of the TransportOrder to move topriority- APriorityLevelof the newTransportOrder- Returns:
- The newly created
TransportOrder - Throws:
org.ameba.exception.NotFoundException- when the barcode is null or no transportunit with barcode can be found or no target can be found.
-
update
Modifies an existingTransportOrderaccording to the argument passed asTransportOrder.- Specified by:
updatein interfaceTransportationService<TransportOrder>- Parameters:
transportOrder- Stores the ID of theTransportOrderto change as well as the state to change- Returns:
- The modified instance
-
change
Try to turn a list ofTransportOrders into the givenstate.- Specified by:
changein interfaceTransportationService<TransportOrder>- Parameters:
state- The state to change all orders topKeys- The persisted keys ofTransportOrders- Returns:
- A list of persisted keys of
TransportOrders that have not been changed
-
change
@Measured public Collection<Message> change(String barcode, TransportOrderState currentState, TransportOrderState targetState, Message message) - Specified by:
changein interfaceTransportationService<TransportOrder>- Parameters:
barcode- The ID of theTransportUnitto movecurrentState- The state of TransportOrders to changetargetState- The state to change all orders tomessage- A messages attached to the changed TransportOrder, may be null- Returns:
- A list of Messages according to the
TransportOrders that have not been changed
-