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 Details

    • DefaultTransportOneOrderServicesProcessingStrategy

      public DefaultTransportOneOrderServicesProcessingStrategy()
  • Method Details

    • apply

      public void apply(OrderModel orderModel)
      Description copied from interface: SendOneOrderSalesNotifStrategy
      Creates 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:
      apply in interface SendOneOrderSalesNotifStrategy
    • 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 orderModel
      deliveryProviderCode - the deliveryProviderCode
      removedIataServices - 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 orderModel
      deliveryProviderCode - the deliveryProviderCode
      newIataServices - 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 consignmentModelList
      orderModel - the orderModel
      newIataServices - the newIataServices
      removedServices - 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 minRange
      maxRange - the macRange
      consignmentEntry - the consignmentEntry
      Returns:
      the list of updated iataServices
    • getDeliveryProvidersFromOrder

      protected Map<String,List<ConsignmentModel>> getDeliveryProvidersFromOrder(OrderModel orderModel)
      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 entry
      orderModel - the order model
      newIataServices -
      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 consignmentEntry
      minRange - the minimum index for the IATAService ID
      maxRange - the maximum index for the IATAService ID
      Returns:
      the list of IATAServices
    • hasIncreased

      protected boolean hasIncreased(AbstractOrderEntryModel entry, AbstractOrderModel originalOrder)
      Checks if the quantity of the order entry has been increased during the amendment of the order.
      Parameters:
      entry - the order entry
      originalOrder - the original order
      Returns:
      true if the quantity of the product in the actual order is greater than its original quantity.
    • hasDecreased

      protected boolean hasDecreased(AbstractOrderEntryModel entry, AbstractOrderModel originalOrder)
      Checks if the quantity of the order entry has been decreased during the amendment of the order.
      Parameters:
      entry - the order entry
      originalOrder - 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

      protected BookingService getBookingService()
      Gets the bookingService
      Returns:
      the bookingService
    • setBookingService

      public void setBookingService(BookingService bookingService)
      Sets the bookingService
      Parameters:
      bookingService - the bookingService