Subversion Repositories SmartDukaan

Rev

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

Rev 33570 Rev 33571
Line 286... Line 286...
286
            if (excludeBrands.contains(item.getBrand())) {
286
            if (excludeBrands.contains(item.getBrand())) {
287
                continue;
287
                continue;
288
            }
288
            }
289
 
289
 
290
            if (!catalogMap.containsKey(item.getCatalogItemId())) {
290
            if (!catalogMap.containsKey(item.getCatalogItemId())) {
291
                if (!priceModelMap.containsKey(tagListing.getSellingPrice()) && item.getCategoryId() == 10006) {
291
                if (!priceModelMap.containsKey(tagListing.getMop()) && item.getCategoryId() == 10006) {
292
                    priceModelMap.put(tagListing.getSellingPrice(), new ArrayList<>());
292
                    priceModelMap.put(tagListing.getSellingPrice(), new ArrayList<>());
293
                }
293
                }
294
                if (item.getCategoryId() == 10006) {
294
                if (item.getCategoryId() == 10006) {
295
                    List<Integer> priceModels = priceModelMap.get(tagListing.getSellingPrice());
295
                    List<Integer> priceModels = priceModelMap.get(tagListing.getMop());
296
                    priceModels.add(item.getCatalogItemId());
296
                    priceModels.add(item.getCatalogItemId());
297
                }
297
                }
298
 
298
 
299
                Map<String, Object> catalogObj = new HashMap<>();
299
                Map<String, Object> catalogObj = new HashMap<>();
300
                catalogObj.put("stockColor", 0);
300
                catalogObj.put("stockColor", 0);
Line 442... Line 442...
442
                    itemObj.setField("mop_f", taglist.getMop());
442
                    itemObj.setField("mop_f", taglist.getMop());
443
                    itemObj.setField("sellingPrice_f", taglist.getSellingPrice());
443
                    itemObj.setField("sellingPrice_f", taglist.getSellingPrice());
444
                    itemObj.setField("active_b", taglist.isActive());
444
                    itemObj.setField("active_b", taglist.isActive());
445
                    itemObj.setField("hot_deal_b", taglist.isHotDeals());
445
                    itemObj.setField("hot_deal_b", taglist.isHotDeals());
446
                    mop = taglist.getMop();
446
                    mop = taglist.getMop();
447
                    catalogValMap.put("dp", taglist.getSellingPrice());
-
 
448
 
447
 
449
                }
448
                }
450
                itemObjs.add(itemObj);
449
                itemObjs.add(itemObj);
451
            }
450
            }
452
            //logger.info("catalogValMap {}", catalogValMap);
451
            //logger.info("catalogValMap {}", catalogValMap);
Line 496... Line 495...
496
                catalogSolrObj.setField("w" + whId + "_i", color);
495
                catalogSolrObj.setField("w" + whId + "_i", color);
497
            }
496
            }
498
 
497
 
499
            List<Integer> similalarModels = null;
498
            List<Integer> similalarModels = null;
500
            if ((Integer) catalogValMap.get("categoryId") == 3) {
499
            if ((Integer) catalogValMap.get("categoryId") == 3) {
501
                float dp = (Float) catalogValMap.get("dp");
-
 
502
                float starPrice = dp - 500f;
500
                float starPrice = mop - 500f;
503
                float endPrice = dp + 1000f;
501
                float endPrice = mop + 1000f;
504
                similalarModels = new ArrayList<>();
502
                similalarModels = new ArrayList<>();
505
                for (Entry<Float, List<Integer>> floatListEntry : priceModelMap.entrySet()) {
503
                for (Entry<Float, List<Integer>> floatListEntry : priceModelMap.entrySet()) {
506
                    float modelPrice = floatListEntry.getKey();
504
                    float modelPrice = floatListEntry.getKey();
507
                    if (modelPrice >= starPrice && modelPrice <= endPrice) {
505
                    if (modelPrice >= starPrice && modelPrice <= endPrice) {
508
                        List<Integer> instock = floatListEntry.getValue().stream().filter(x->catalogMap.get(x).get("stockColor") != null && (Integer) (catalogMap.get(x).get("stockColor"))>0).collect(Collectors.toList());
506
                        List<Integer> instock = floatListEntry.getValue().stream().filter(x->catalogMap.get(x).get("stockColor") != null && (Integer) (catalogMap.get(x).get("stockColor"))>0).collect(Collectors.toList());
509
                        logger.info("/Entry before - {}, after - {}", floatListEntry.getValue().size(), instock.size());
507
                        logger.info("Entry before - {}, after - {}", floatListEntry.getValue().size(), instock.size());
510
                        similalarModels.addAll(instock);
508
                        similalarModels.addAll(instock);
511
                    }
509
                    }
512
                    if (modelPrice > endPrice) break;
510
                    if (modelPrice > endPrice) break;
513
                }
511
                }
514
                similalarModels.remove(Integer.valueOf(catalogId));
512
                similalarModels.remove(Integer.valueOf(catalogId));