Class DefaultTransportOneOrderServicesProcessingStrategy
java.lang.Object
de.hybris.platform.oneorderfulfilmentprocess.strategy.impl.DefaultTransportOneOrderServicesProcessingStrategy
- All Implemented Interfaces:
SendOneOrderSalesNotifStrategy
public class DefaultTransportOneOrderServicesProcessingStrategy
extends Object
implements SendOneOrderSalesNotifStrategy
The One Order implementation of
SendOneOrderSalesNotifStrategy class.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(OrderModel orderModel) Creates the One Order Service Delivery Provider Notification Request.protected voidcreateAndUpdateIataServices(List<ConsignmentModel> consignmentModelList, OrderModel orderModel, List<IATAServiceModel> newIataServices, List<IATAServiceModel> removedServices) Populates the lists of new IataServices and removed ones.protected voidcreateAndUpdateIATAServicesForConsignmentEntry(ConsignmentEntryModel consignmentEntry, AbstractOrderModel orderModel, List<IATAServiceModel> newIataServices, List<IATAServiceModel> removedServices) 1) Creates a list of IATAServices from a consignment entry.protected List<IATAServiceModel>createIATAServices(ConsignmentEntryModel consignmentEntry, Integer minRange, Integer maxRange) Creates a list of IATAServices for each quantity added in the current order for the relative consignment entry.protected BookingServiceGets the bookingServiceprotected de.hybris.platform.processengine.BusinessProcessServiceGets the businessProcessServiceprotected de.hybris.platform.servicelayer.config.ConfigurationServiceGets the configurationServiceprotected Map<String,List<ConsignmentModel>> getDeliveryProvidersFromOrder(OrderModel orderModel) Gets a map of delivery providers with respective consignments in the orderModel.protected de.hybris.platform.servicelayer.model.ModelServiceGets the modelServiceprotected booleanhasDecreased(AbstractOrderEntryModel entry, AbstractOrderModel originalOrder) Checks if the quantity of the order entry has been decreased during the amendment of the order.protected booleanhasIncreased(AbstractOrderEntryModel entry, AbstractOrderModel originalOrder) Checks if the quantity of the order entry has been increased during the amendment of the order.voidsetBookingService(BookingService bookingService) Sets the bookingServicevoidsetBusinessProcessService(de.hybris.platform.processengine.BusinessProcessService businessProcessService) Sets the businessProcessServicevoidsetConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService) Sets the configurationServicevoidsetModelService(de.hybris.platform.servicelayer.model.ModelService modelService) Sets the modelServiceprotected voidstartServiceDeliveryProcess(OrderModel orderModel, String deliveryProviderCode, List<IATAServiceModel> newIataServices) Starts the service Delivery process, only if there are services that have been added to the order.protected voidstartServiceStatusChangeProcess(OrderModel orderModel, String deliveryProviderCode, List<IATAServiceModel> removedIataServices) Starts the Service Status Change Notification Process, only when there are some services that have been removed.protected List<IATAServiceModel>updateStatusOfRemovedServices(Integer minRange, Integer maxRange, ConsignmentEntryModel consignmentEntry) Gets the iataServices and update the deliveryStatus to REMOVED
-
Constructor Details
-
DefaultTransportOneOrderServicesProcessingStrategy
public DefaultTransportOneOrderServicesProcessingStrategy()
-
-
Method Details
-
apply
Description copied from interface:SendOneOrderSalesNotifStrategyCreates the One Order Service Delivery Provider Notification Request. Get the delivery providers from the transport order entries and for each DP start a OneOrderDeliveryProcess. This type of message will be sent only if the BookingJourneyType of the order is not of type BOOKING_ACCOMMODATION_ONLY.- Specified by:
applyin interfaceSendOneOrderSalesNotifStrategy
-
startServiceStatusChangeProcess
protected void startServiceStatusChangeProcess(OrderModel orderModel, String deliveryProviderCode, List<IATAServiceModel> removedIataServices) Starts the Service Status Change Notification Process, only when there are some services that have been removed.- Parameters:
orderModel- the orderModeldeliveryProviderCode- the deliveryProviderCoderemovedIataServices- the removedIataServices
-
startServiceDeliveryProcess
protected void startServiceDeliveryProcess(OrderModel orderModel, String deliveryProviderCode, List<IATAServiceModel> newIataServices) Starts the service Delivery process, only if there are services that have been added to the order.- Parameters:
orderModel- the orderModeldeliveryProviderCode- the deliveryProviderCodenewIataServices- the newIataServices
-
createAndUpdateIataServices
protected void createAndUpdateIataServices(List<ConsignmentModel> consignmentModelList, OrderModel orderModel, List<IATAServiceModel> newIataServices, List<IATAServiceModel> removedServices) Populates the lists of new IataServices and removed ones.- Parameters:
consignmentModelList- the consignmentModelListorderModel- the orderModelnewIataServices- the newIataServicesremovedServices- the removedServices
-
updateStatusOfRemovedServices
protected List<IATAServiceModel> updateStatusOfRemovedServices(Integer minRange, Integer maxRange, ConsignmentEntryModel consignmentEntry) Gets the iataServices and update the deliveryStatus to REMOVED- Parameters:
minRange- the minRangemaxRange- the macRangeconsignmentEntry- the consignmentEntry- Returns:
- the list of updated iataServices
-
getDeliveryProvidersFromOrder
Gets a map of delivery providers with respective consignments in the orderModel.- Parameters:
orderModel- the orderModel- Returns:
- the map of delivert providers and consignments.
-
createAndUpdateIATAServicesForConsignmentEntry
protected void createAndUpdateIATAServicesForConsignmentEntry(ConsignmentEntryModel consignmentEntry, AbstractOrderModel orderModel, List<IATAServiceModel> newIataServices, List<IATAServiceModel> removedServices) 1) Creates a list of IATAServices from a consignment entry. The number of IATA entity is equal to the quantity of the consignment entry. If the consignment entry has already a list of IATAServices, checks if the quantity in the current order has been increased and creates the new IATAServices for the quantity added. 2) Creates a list of removedIATAServices from a consignment entry. If the consignment entry has already a list of IATAServices, checks if the quantity in the current order has been decreased and get the IATAServices that have to be updated to REMOVED.- Parameters:
consignmentEntry- the consignment entryorderModel- the order modelnewIataServices-removedServices-
-
createIATAServices
protected List<IATAServiceModel> createIATAServices(ConsignmentEntryModel consignmentEntry, Integer minRange, Integer maxRange) Creates a list of IATAServices for each quantity added in the current order for the relative consignment entry.- Parameters:
consignmentEntry- the consignmentEntryminRange- the minimum index for the IATAService IDmaxRange- the maximum index for the IATAService ID- Returns:
- the list of IATAServices
-
hasIncreased
Checks if the quantity of the order entry has been increased during the amendment of the order.- Parameters:
entry- the order entryoriginalOrder- the original order- Returns:
- true if the quantity of the product in the actual order is greater than its original quantity.
-
hasDecreased
Checks if the quantity of the order entry has been decreased during the amendment of the order.- Parameters:
entry- the order entryoriginalOrder- the original order- Returns:
- true if the quantity of the product in the actual order is less than its original quantity.
-
getConfigurationService
protected de.hybris.platform.servicelayer.config.ConfigurationService getConfigurationService()Gets the configurationService- Returns:
- the configurationService
-
setConfigurationService
public void setConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService) Sets the configurationService- Parameters:
configurationService- the configurationService
-
getBusinessProcessService
protected de.hybris.platform.processengine.BusinessProcessService getBusinessProcessService()Gets the businessProcessService- Returns:
- the businessProcessService
-
setBusinessProcessService
public void setBusinessProcessService(de.hybris.platform.processengine.BusinessProcessService businessProcessService) Sets the businessProcessService- Parameters:
businessProcessService- the businessProcessService
-
getModelService
protected de.hybris.platform.servicelayer.model.ModelService getModelService()Gets the modelService- Returns:
- the modelService
-
setModelService
public void setModelService(de.hybris.platform.servicelayer.model.ModelService modelService) Sets the modelService- Parameters:
modelService- the modelService
-
getBookingService
Gets the bookingService- Returns:
- the bookingService
-
setBookingService
Sets the bookingService- Parameters:
bookingService- the bookingService
-