Subversion Repositories SmartDukaan

Rev

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

Rev 25968 Rev 26050
Line 210... Line 210...
210
			throw new ProfitMandiBusinessException("", "", "Could not connect to host");
210
			throw new ProfitMandiBusinessException("", "", "Could not connect to host");
211
		}
211
		}
212
		JSONObject solrResponseJSONObj = new JSONObject(response).getJSONObject("response");
212
		JSONObject solrResponseJSONObj = new JSONObject(response).getJSONObject("response");
213
		JSONArray docs = solrResponseJSONObj.getJSONArray("docs");
213
		JSONArray docs = solrResponseJSONObj.getJSONArray("docs");
214
		List<FofoCatalogResponse> dealResponse = getCatalogSingleSkuResponse(docs, itemIdsQtyMap, false);
214
		List<FofoCatalogResponse> dealResponse = getCatalogSingleSkuResponse(docs, itemIdsQtyMap, false);
-
 
215
		
-
 
216
		
215
		dealResponse = dealResponse.stream()
217
		dealResponse = dealResponse.stream()
216
				// .filter(x->itemIdsQtyMap.keySet().contains((int)(x.getItems().get(0).getItem_id())))
218
				// .filter(x->itemIdsQtyMap.keySet().contains((int)(x.getItems().get(0).getItem_id())))
217
				.map(x -> {
219
				.map(x -> {
218
					FofoAvailabilityInfo fai = x.getItems().get(0);
220
					FofoAvailabilityInfo fai = x.getItems().get(0);
219
					fai.setAvailability(5);
221
					fai.setAvailability(5);
Line 698... Line 700...
698
					if (item.getCategoryId() == 10020) {
700
					if (item.getCategoryId() == 10020) {
699
						fdi.setMinBuyQuantity(10);
701
						fdi.setMinBuyQuantity(10);
700
					} else {
702
					} else {
701
						fdi.setMinBuyQuantity(1);
703
						fdi.setMinBuyQuantity(1);
702
					}
704
					}
703
					if (hotDeal || !tl.isActive()) {
-
 
704
 
-
 
705
						int totalAvailability = 0; // Using item availability
-
 
706
						// cache for now but can be
-
 
707
						// changed to
-
 
708
						// use caching later.
-
 
709
						try {
-
 
710
							ItemAvailabilityCache iac = itemAvailabilityCacheRepository.selectByItemId(itemId);
-
 
711
							totalAvailability = iac.getTotalAvailability();
-
 
712
							fdi.setAvailability(totalAvailability);
705
					fdi.setAvailability(itemFilter.get(itemId));
713
						} catch (Exception e) {
-
 
714
							continue;
-
 
715
						}
-
 
716
						if (totalAvailability <= 0) {
-
 
717
							continue;
-
 
718
						}
-
 
719
					} else {
-
 
720
						// For accessories item availability should at be ordered for Rs.1000
-
 
721
						fdi.setAvailability(100);
-
 
722
					}
-
 
723
					fdi.setQuantityStep(1);
706
					fdi.setQuantityStep(1);
724
					fdi.setMaxQuantity(Math.min(fdi.getAvailability(), 100));
707
					fdi.setMaxQuantity(Math.min(fdi.getAvailability(), 100));
725
					fofoAvailabilityInfoMap.put(itemId, fdi);
708
					fofoAvailabilityInfoMap.put(itemId, fdi);
726
				}
709
				}
727
			}
710
			}