Package org.hoteia.qalingo.core.domain

Examples of org.hoteia.qalingo.core.domain.MarketArea


        logger.debug("Found {} Markets", markets.size());
        return PojoUtil.mapAll(dozerBeanMapper, markets, MarketPojo.class);
    }
   
    public MarketAreaPojo getMarketAreaByCode(final String marketAreaCode) {
        final MarketArea marketArea = marketService.getMarketAreaByCode(marketAreaCode);
        logger.debug("Found {} marketArea:", marketArea.getName());
        return dozerBeanMapper.map(marketArea, MarketAreaPojo.class);
    }
View Full Code Here


        }
        return dozerBeanMapper.map(geolocData, GeolocDataPojo.class);
    }
   
    public MarketAreaPojo getMarketAreaByGeolocData(final GeolocDataPojo geolocData) throws Exception {
        MarketArea marketAreaGeoloc = null;
        if(geolocData != null){
            if(geolocData != null && StringUtils.isNotEmpty(geolocData.getCountryIsoCode())){
                List<MarketArea> marketAreas = marketService.getMarketAreaByGeolocCountryCode(geolocData.getCountryIsoCode());
                if(marketAreas != null && marketAreas.size() == 1){
                    marketAreaGeoloc = marketAreas.get(0);
                } else {
                    // WE HAVE MANY MARKET AREA FOR THE CURRENT COUNTRY CODE - WE SELECT THE DEFAULT MARKET PLACE ASSOCIATE
                    for (Iterator<MarketArea> iterator = marketAreas.iterator(); iterator.hasNext();) {
                        MarketArea marketAreaIt = (MarketArea) iterator.next();
                        if(marketAreaIt.getMarket().getMarketPlace().isDefault()){
                            marketAreaGeoloc = marketAreaIt;
                        }
                    }
                }
            }
View Full Code Here

        return OrderDocumentType.ORDER_CONFIRMATION.getPropertyKey() + "-" + order.getOrderNum() + ".pdf";
    }
   
    public void generateOrderConfirmation(final OrderCustomer order) {
        try {
            final MarketArea marketArea = marketService.getMarketAreaById(order.getMarketAreaId());
            final Localization localization = localizationService.getLocalizationById(order.getLocalizationId());
            final Locale locale = localization.getLocale();
           
            // WE SET TO NULL USELESS DATA - BETTER WAY SHOULD BE TO USE A SPECIFIC DOZER RULE
            for (Iterator<OrderItem> iterator = order.getOrderItems().iterator(); iterator.hasNext();) {
View Full Code Here

        return OrderDocumentType.SHIPPING_CONFIRMATION.getPropertyKey() + "-" + order.getOrderNum() + ".pdf";
    }
   
    public void generateShippingConfirmation(final OrderCustomer order) {
        try {
            final MarketArea marketArea = marketService.getMarketAreaById(order.getMarketAreaId());
            final Localization localization = localizationService.getLocalizationById(order.getLocalizationId());
            final Locale locale = localization.getLocale();
           
            // WE SET TO NULL USELESS DATA - BETTER WAY SHOULD BE TO USE A SPECIFIC DOZER RULE
            for (Iterator<OrderItem> iterator = order.getOrderItems().iterator(); iterator.hasNext();) {
View Full Code Here

        return OrderDocumentType.INVOICE.getPropertyKey() + "-" + order.getOrderNum() + ".pdf";
    }
   
    public void generateInvoice(final OrderCustomer order) {
        try {
            final MarketArea marketArea = marketService.getMarketAreaById(order.getMarketAreaId());
            final Localization localization = localizationService.getLocalizationById(order.getLocalizationId());
            final Locale locale = localization.getLocale();
           
            // WE SET TO NULL USELESS DATA - BETTER WAY SHOULD BE TO USE A SPECIFIC DOZER RULE
            for (Iterator<OrderItem> iterator = order.getOrderItems().iterator(); iterator.hasNext();) {
View Full Code Here

    public CommonViewBean buildViewBeanCommon(final RequestData requestData) throws Exception {
        final CommonViewBean commonViewBean = new CommonViewBean();

        final MarketPlace marketPlace = requestData.getMarketPlace();
        final Market market = requestData.getMarket();
        final MarketArea marketArea = requestData.getMarketArea();
        final Localization localization = requestData.getMarketAreaLocalization();
        final Retailer retailer = requestData.getMarketAreaRetailer();
        final CurrencyReferential currency = requestData.getMarketAreaCurrency();

        // NO CACHE FOR THIS PART
View Full Code Here

            final MarketPlace marketPlaceNavigation = (MarketPlace) iteratorMarketPlace.next();
           
            // TODO : why : SET A RELOAD OBJECT MARKET -> event
            // LazyInitializationException: could not initialize proxy - no Session
            final Market reloadedMarket = marketService.getMarketById(marketPlaceNavigation.getDefaultMarket().getId().toString());
            final MarketArea defaultMarketArea = marketService.getMarketAreaByCode(reloadedMarket.getDefaultMarketArea().getCode());
            final Localization defaultLocalization = defaultMarketArea.getDefaultLocalization();
            final Retailer defaultRetailer = defaultMarketArea.getDefaultRetailer();
           
            RequestData requestDataForThisMarketPlace = new RequestData();
            BeanUtils.copyProperties(requestData, requestDataForThisMarketPlace);
            requestDataForThisMarketPlace.setMarketPlace(marketPlaceNavigation);
            requestDataForThisMarketPlace.setMarket(reloadedMarket);
View Full Code Here

            // LazyInitializationException: could not initialize proxy - no Session
            final Market marketNavigationReloaded = marketService.getMarketById(marketNavigation.getId().toString());
           
            if(marketNavigationReloaded.getDefaultMarketArea() != null){
                // RELOAD THE MARKET TO KEEP AN ENTITY WITH RIGHT FETCHS
                final MarketArea defaultMarketArea = marketService.getMarketAreaByCode(marketNavigationReloaded.getDefaultMarketArea().getCode());
                final Localization defaultLocalization = defaultMarketArea.getDefaultLocalization();
                final Retailer defaultRetailer = defaultMarketArea.getDefaultRetailer();

                RequestData requestDataForThisMarket = new RequestData();
                BeanUtils.copyProperties(requestData, requestDataForThisMarket);
                requestDataForThisMarket.setMarket(marketNavigationReloaded);
                requestDataForThisMarket.setMarketArea(defaultMarketArea);
View Full Code Here

    /**
     *
     */
    public List<MarketAreaViewBean> buildListViewBeanMarketArea(final RequestData requestData, final Market market, final List<MarketArea> marketAreas) throws Exception {
        List<MarketAreaViewBean> marketAreaViewBeans = new ArrayList<MarketAreaViewBean>();
        final MarketArea currentMarketArea = requestData.getMarketArea();
        if(marketAreas!= null
                && !marketAreas.isEmpty()){
            for (Iterator<MarketArea> iteratorMarketArea = marketAreas.iterator(); iteratorMarketArea.hasNext();) {
                final MarketArea marketArea = (MarketArea) iteratorMarketArea.next();
               
                // RELOAD THE MARKET TO KEEP AN ENTITY WITH RIGHT FETCHS
                final Market reloadedMarket = marketService.getMarketByCode(marketArea.getMarket().getCode());
                // RELOAD THE MARKETPLACE TO KEEP AN ENTITY WITH RIGHT FETCHS
                final MarketPlace reloadedMarketPlace = marketService.getMarketPlaceByCode(reloadedMarket.getMarketPlace().getCode());
               
                final MarketArea reloadedMarketArea = marketService.getMarketAreaByCode(marketArea.getCode());
                final Localization defaultLocalization = reloadedMarketArea.getDefaultLocalization();
                final Retailer defaultRetailer = reloadedMarketArea.getDefaultRetailer();
                final CurrencyReferential defaultCurrency = reloadedMarketArea.getDefaultCurrency();

                RequestData requestDataForThisMarketArea = new RequestData();
                BeanUtils.copyProperties(requestData, requestDataForThisMarketArea);
                requestDataForThisMarketArea.setMarketPlace(reloadedMarketPlace);
                requestDataForThisMarketArea.setMarket(reloadedMarket);
View Full Code Here

    /**
     *
     */
    public List<LocalizationViewBean> buildListViewBeanLocalizationByMarketArea(final RequestData requestData, final Localization currentLocalization) throws Exception {
        final MarketArea marketArea = requestData.getMarketArea();
        final List<Localization> translationAvailables = new ArrayList<Localization>(marketArea.getLocalizations());
        List<LocalizationViewBean> localizationViewBeans = new ArrayList<LocalizationViewBean>();
        for (Iterator<Localization> iterator = translationAvailables.iterator(); iterator.hasNext();) {
            final Localization localizationAvailable = (Localization) iterator.next();
            localizationViewBeans.add(buildViewBeanLocalization(requestData, localizationAvailable));
        }
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.domain.MarketArea

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.