Subversion Repositories SmartDukaan

Rev

Rev 33957 | Rev 34098 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 33957 Rev 33966
Line 645... Line 645...
645
    }
645
    }
646
 
646
 
647
    @RequestMapping(value = "/featurePanel", method = RequestMethod.GET)
647
    @RequestMapping(value = "/featurePanel", method = RequestMethod.GET)
648
    public String FeaturePanel(HttpServletRequest request, Model model) throws Exception {
648
    public String FeaturePanel(HttpServletRequest request, Model model) throws Exception {
649
 
649
 
650
        List<TagRanking> tagRanking = null;
-
 
651
        tagRanking = tagRankingRepository.getAllTagRanking();
650
        List<TagRanking> tagRanking = tagRankingRepository.getAllTagRanking();
652
        LOGGER.info("tagRanking" + tagRanking);
651
        LOGGER.info("tagRanking" + tagRanking);
653
        if (!tagRanking.isEmpty()) {
652
        if (!tagRanking.isEmpty()) {
654
            Set<Integer> catalogIds = tagRanking.stream().map(x -> x.getCatalogItemId()).collect(Collectors.toSet());
653
            Set<Integer> catalogIds = tagRanking.stream().map(x -> x.getCatalogItemId()).collect(Collectors.toSet());
655
            List<Item> items = itemRepository.selectAllByCatalogIds(catalogIds);
654
            List<Item> items = itemRepository.selectAllByCatalogIds(catalogIds);
656
            Map<Integer, String> catalogDescription = items.stream().collect(Collectors.toMap(x -> x.getCatalogItemId(), x -> x.getItemDescription(), (description1, description2) -> description1));
655
            Map<Integer, String> catalogDescriptionMap = items.stream().collect(Collectors.toMap(x -> x.getCatalogItemId(), x -> x.getItemDescription(), (description1, description2) -> description1));
657
 
656
 
658
            LOGGER.info("catalogDescription" + catalogDescription);
657
            LOGGER.info("catalogDescription" + catalogDescriptionMap);
659
            model.addAttribute("tagRanking", tagRanking);
-
 
660
            model.addAttribute("catalogDescription", catalogDescription);
658
            model.addAttribute("catalogDescriptionsMap", catalogDescriptionMap);
661
 
-
 
662
        } else {
-
 
663
            model.addAttribute("tagRanking", tagRanking);
-
 
664
 
659
 
665
        }
660
        }
-
 
661
        model.addAttribute("tagRanking", tagRanking);
666
 
662
 
667
        return "feature";
663
        return "feature";
668
 
664
 
669
    }
665
    }
670
 
666