Subversion Repositories SmartDukaan

Rev

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

Rev 25166 Rev 25168
Line 171... Line 171...
171
	private List<BrandStockPrice> getBrandStockPrices(int fofoId) throws Exception {
171
	private List<BrandStockPrice> getBrandStockPrices(int fofoId) throws Exception {
172
		Map<String, BrandStockPrice> brandStockPricesMap = inventoryService.getBrandWiseStockValue(fofoId);
172
		Map<String, BrandStockPrice> brandStockPricesMap = inventoryService.getBrandWiseStockValue(fofoId);
173
		List<InventoryItemAgingModel> models = inventoryService.getItemAgingByInterval(fofoId, Arrays.asList(30));
173
		List<InventoryItemAgingModel> models = inventoryService.getItemAgingByInterval(fofoId, Arrays.asList(30));
174
 
174
 
175
		Map<String, Integer> brandWiseQty = models.stream()
175
		Map<String, Integer> brandWiseQty = models.stream()
176
				.filter(x -> ItemType.SERIALIZED.toString().equals(x.getItemType()))
176
				.filter(x -> ItemType.SERIALIZED.toString().equals(x.getItemType())  && x.getValues().get(1)!=null)
177
				.collect(Collectors.groupingBy(x -> x.getBrand(), Collectors.summingInt(x -> 
177
				.collect(Collectors.groupingBy(x -> x.getBrand(), Collectors.summingInt(x -> 
178
						x.getValues().size() > 1 ? x.getValues().get(1).getQuantity():0)));
178
				x.getValues().get(1).getQuantity())));
179
		Map<String, Double> brandWiseValue = models.stream()
179
		Map<String, Double> brandWiseValue = models.stream()
180
				.filter(x -> x.getItemType().equals(ItemType.SERIALIZED.toString()))
180
				.filter(x -> x.getItemType().equals(ItemType.SERIALIZED.toString()) && x.getValues().get(1)!=null)
181
				.collect(Collectors.groupingBy(x -> x.getBrand(), Collectors.summingDouble(x -> 
181
				.collect(Collectors.groupingBy(x -> x.getBrand(), Collectors.summingDouble(x -> 
182
				x.getValues().size() > 1 ? x.getValues().get(1).getQuantity() * x.getValues().get(1).getPrice():0)));
182
				x.getValues().get(1).getQuantity() * x.getValues().get(1).getPrice())));
183
 
183
 
184
		List<DBObject> mobileBrands = mongoClient.getMongoBrands(fofoId, "", 3);
184
		List<DBObject> mobileBrands = mongoClient.getMongoBrands(fofoId, "", 3);
185
		List<BrandStockPrice> brandStockPrices = new ArrayList<>();
185
		List<BrandStockPrice> brandStockPrices = new ArrayList<>();
186
 
186
 
187
//		Map<String, Integer> brandWiseQty = new HashMap<String, Integer>();
187
//		Map<String, Integer> brandWiseQty = new HashMap<String, Integer>();