Subversion Repositories SmartDukaan

Rev

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

Rev 31709 Rev 31757
Line 646... Line 646...
646
			String limit) throws Exception {
646
			String limit) throws Exception {
647
 
647
 
648
		RestClient rc = new RestClient();
648
		RestClient rc = new RestClient();
649
		Map<String, String> params = new HashMap<>();
649
		Map<String, String> params = new HashMap<>();
650
		List<String> mandatoryQ = new ArrayList<>();
650
		List<String> mandatoryQ = new ArrayList<>();
651
		mandatoryQ.add("show_default_b:true");
-
 
652
 
651
      
653
		FofoStore fs = fofoStoreRepository.selectByRetailerId(userInfo.getRetailerId());
652
		FofoStore fs = fofoStoreRepository.selectByRetailerId(userInfo.getRetailerId());
654
 
653
 
655
		params.put("sort", "w" + fs.getWarehouseId() + "_i desc");
654
		params.put("sort", "w" + fs.getWarehouseId() + "_i desc");
656
 
655
 
657
		List<Integer> webProducts = null;
656
		List<Integer> webProducts = null;
658
		if (webListing.getType().equals(WebListingType.solr)) {
657
		if (webListing.getType().equals(WebListingType.solr)) {
659
			logger.info("solrtype {}", webListing.getSolrQuery());
658
			logger.info("solrtype {}", webListing.getSolrQuery());
660
			mandatoryQ.add(String.format("+{!parent which=\"" + webListing.getSolrQuery() + "\"} AND active_b:true"));
659
			mandatoryQ.add(String.format("+{!parent which=\"" + webListing.getSolrQuery() + "\"} AND active_b:true AND show_default_b:true"));
661
		} else {
660
		} else {
662
			logger.info("solrtype2 {}", webListing.getSolrQuery());
661
			logger.info("solrtype2 {}", webListing.getSolrQuery());
663
 
662
 
664
			webProducts = webProductListingRepository
663
			webProducts = webProductListingRepository
665
					.selectAllByWebListingId(webListing.getId(), Integer.parseInt(offset), Integer.parseInt(limit))
664
					.selectAllByWebListingId(webListing.getId(), Integer.parseInt(offset), Integer.parseInt(limit))
Line 668... Line 667...
668
			if (webProducts.size() == 0) {
667
			if (webProducts.size() == 0) {
669
				return new ArrayList<>();
668
				return new ArrayList<>();
670
			}
669
			}
671
 
670
 
672
			mandatoryQ.add(String.format(
671
			mandatoryQ.add(String.format(
673
					"+{!parent which=\"catalogId_i:" + StringUtils.join(webProducts, " ") + "\"} AND active_b:true"));
672
					"+{!parent which=\"catalogId_i:" + StringUtils.join(webProducts, " ") + "\"} AND active_b:true AND show_default_b:true"));
674
 
673
 
675
		}
674
		}
676
		params.put("q", StringUtils.join(mandatoryQ, " "));
675
		params.put("q", StringUtils.join(mandatoryQ, " "));
677
		params.put("fl", "*, [child parentFilter=id:catalog* childFilter=active_b:true ]");
676
		params.put("fl", "*, [child parentFilter=id:catalog* childFilter=active_b:true ]");
678
 
677