Package de.hybris.platform.order.impl
Class DefaultZoneDeliveryModeService
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.service.AbstractService
-
- de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
-
- de.hybris.platform.order.impl.DefaultDeliveryModeService
-
- de.hybris.platform.order.impl.DefaultZoneDeliveryModeService
-
- All Implemented Interfaces:
DeliveryModeService,ZoneDeliveryModeService,java.io.Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
public class DefaultZoneDeliveryModeService extends DefaultDeliveryModeService implements ZoneDeliveryModeService
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
AbstractService.SerializableDTO
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManager
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant
-
-
Constructor Summary
Constructors Constructor Description DefaultZoneDeliveryModeService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<ZoneModel>getAllZones()Gets allZoneModels.java.util.Collection<CurrencyModel>getCurrencies(ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode)Gets all currencies for which values are defined in the zone and in the delivery mode.ZoneDeliveryModeValueModelgetDeliveryValue(ZoneModel zone, CurrencyModel currency, java.lang.Double min, ZoneDeliveryModeModel zoneDeliveryMode)Gets specificZoneDeliveryModeValueModelfor the given zone, currency, minimum value, and zone delivery mode.java.util.Map<java.lang.Double,java.lang.Double>getDeliveryValues(CurrencyModel currency, ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode)Gets all delivery cost values for the currency in the zone and with the specific delivery mode.ZoneModelgetZoneForCode(java.lang.String code)Gets theZoneModelwith the specified code.java.util.Collection<ZoneModel>getZonesForZoneDeliveryMode(ZoneDeliveryModeModel zoneDeliveryMode)Gets all zones for which price values are defined in the delivery mode.booleanisUsingPrice(ZoneDeliveryModeModel zoneDeliveryMode)Checks whether theZoneDeliveryModeModeluses the order subtotal as calculation base.booleanisZoneAllowed(ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode)Checks whether the zone is allowed to be used for adding new values to the delivery mode.ZoneDeliveryModeValueModelsetDeliveryCost(CurrencyModel currency, java.lang.Double min, java.lang.Double value, ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode)Sets the delivery cost for the given zone, currency, minimum value, and zone delivery mode.voidsetUsingPrice(ZoneDeliveryModeModel zoneDeliveryMode)Sets the special price property name for theZoneDeliveryModeModelconveniently.voidsetZdmvConsistencyStrategy(ZDMVConsistencyStrategy zdmvConsistencyStrategy)voidsetZoneDeliveryModeDao(ZoneDeliveryModeDao zoneDeliveryModeDao)voidsetZoneDeliveryModeValueDao(ZoneDeliveryModeValueDao zoneDeliveryModeValueDao)-
Methods inherited from class de.hybris.platform.order.impl.DefaultDeliveryModeService
getAllDeliveryModes, getDeliveryModeForCode, getSupportedDeliveryModes, setDeliveryModeDao
-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManager
-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.order.DeliveryModeService
getAllDeliveryModes, getDeliveryModeForCode, getSupportedDeliveryModes
-
-
-
-
Method Detail
-
getZoneForCode
public ZoneModel getZoneForCode(java.lang.String code)
Description copied from interface:ZoneDeliveryModeServiceGets theZoneModelwith the specified code.- Specified by:
getZoneForCodein interfaceZoneDeliveryModeService- Parameters:
code- the zone code- Returns:
- the found
ZoneModelwith the specified code
-
getAllZones
public java.util.Collection<ZoneModel> getAllZones()
Description copied from interface:ZoneDeliveryModeServiceGets allZoneModels.- Specified by:
getAllZonesin interfaceZoneDeliveryModeService- Returns:
- a
Collectionof allZoneModels
-
getZonesForZoneDeliveryMode
public java.util.Collection<ZoneModel> getZonesForZoneDeliveryMode(ZoneDeliveryModeModel zoneDeliveryMode)
Description copied from interface:ZoneDeliveryModeServiceGets all zones for which price values are defined in the delivery mode.- Specified by:
getZonesForZoneDeliveryModein interfaceZoneDeliveryModeService- Parameters:
zoneDeliveryMode- the zone delivery mode- Returns:
- all
ZoneModels for the delivery mode
-
getCurrencies
public java.util.Collection<CurrencyModel> getCurrencies(ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode)
Description copied from interface:ZoneDeliveryModeServiceGets all currencies for which values are defined in the zone and in the delivery mode.- Specified by:
getCurrenciesin interfaceZoneDeliveryModeService- Parameters:
zone- the zonezoneDeliveryMode- the zone delivery mode- Returns:
- all found
CurrencyModels
-
isZoneAllowed
public boolean isZoneAllowed(ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode)
Description copied from interface:ZoneDeliveryModeServiceChecks whether the zone is allowed to be used for adding new values to the delivery mode. This is necessary because two zones may share countries so the delivery mode can no longer calculate distinct prices for a specific country.- Specified by:
isZoneAllowedin interfaceZoneDeliveryModeService- Parameters:
zone- the zone to be checkedzoneDeliveryMode- the zone delivery mode- Returns:
- true if the zone is allowed for the delivery mode, false otherwise
-
getDeliveryValues
public java.util.Map<java.lang.Double,java.lang.Double> getDeliveryValues(CurrencyModel currency, ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode)
Description copied from interface:ZoneDeliveryModeServiceGets all delivery cost values for the currency in the zone and with the specific delivery mode.- Specified by:
getDeliveryValuesin interfaceZoneDeliveryModeService- Parameters:
currency- the currencyzone- the zonezoneDeliveryMode- the zone delivery mode- Returns:
- All delivery cost values consisting of minimum threshold value and cost value.
-
getDeliveryValue
public ZoneDeliveryModeValueModel getDeliveryValue(ZoneModel zone, CurrencyModel currency, java.lang.Double min, ZoneDeliveryModeModel zoneDeliveryMode)
Description copied from interface:ZoneDeliveryModeServiceGets specificZoneDeliveryModeValueModelfor the given zone, currency, minimum value, and zone delivery mode.- Specified by:
getDeliveryValuein interfaceZoneDeliveryModeService- Parameters:
zone- the zonecurrency- the currencymin- the minimum valuezoneDeliveryMode- the zone delivery mode- Returns:
- found
ZoneDeliveryModeValueModel
-
setDeliveryCost
public ZoneDeliveryModeValueModel setDeliveryCost(CurrencyModel currency, java.lang.Double min, java.lang.Double value, ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode) throws DeliveryModeInterceptorException
Description copied from interface:ZoneDeliveryModeServiceSets the delivery cost for the given zone, currency, minimum value, and zone delivery mode. Creates a newZoneDeliveryModeValueModelif noZoneDeliveryModeValueModelcan be found.- Specified by:
setDeliveryCostin interfaceZoneDeliveryModeService- Parameters:
currency- the currencymin- the minimum valuevalue- the delivery cost valuezone- the zonezoneDeliveryMode- the zone delivery mode- Returns:
- changed
ZoneDeliveryModeValueModelwith new delivery cost value or the createdZoneDeliveryModeValueModel - Throws:
DeliveryModeInterceptorException- if there is ambiguous zone for theZoneDeliveryModeModel
-
setUsingPrice
public void setUsingPrice(ZoneDeliveryModeModel zoneDeliveryMode)
Description copied from interface:ZoneDeliveryModeServiceSets the special price property name for theZoneDeliveryModeModelconveniently. If the property is set, theZoneDeliveryModeModelwould use order's subtotal as calculation base.- Specified by:
setUsingPricein interfaceZoneDeliveryModeService- Parameters:
zoneDeliveryMode- the zone delivery mode
-
isUsingPrice
public boolean isUsingPrice(ZoneDeliveryModeModel zoneDeliveryMode)
Description copied from interface:ZoneDeliveryModeServiceChecks whether theZoneDeliveryModeModeluses the order subtotal as calculation base.- Specified by:
isUsingPricein interfaceZoneDeliveryModeService- Parameters:
zoneDeliveryMode- the zone delivery mode
-
setZoneDeliveryModeValueDao
public void setZoneDeliveryModeValueDao(ZoneDeliveryModeValueDao zoneDeliveryModeValueDao)
-
setZdmvConsistencyStrategy
public void setZdmvConsistencyStrategy(ZDMVConsistencyStrategy zdmvConsistencyStrategy)
-
setZoneDeliveryModeDao
public void setZoneDeliveryModeDao(ZoneDeliveryModeDao zoneDeliveryModeDao)
-
-