Subversion Repositories SmartDukaan

Rev

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

Rev 25157 Rev 25164
Line 169... Line 169...
169
	}
169
	}
170
 
170
 
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
		/*Map<String, Integer> brandWiseQty = models.stream()
175
		Map<String, Integer> brandWiseQty = models.stream()
175
				.filter(x -> x.getItemType().equals(ItemType.SERIALIZED.toString())).collect(Collectors
176
				.filter(x -> x.getItemType().equals(ItemType.SERIALIZED.toString())).collect(Collectors
176
						.groupingBy(x -> x.getBrand(), Collectors.summingInt(x -> x.getValues().get(1).getQuantity())));
177
						.groupingBy(x -> x.getBrand(), Collectors.summingInt(x -> x.getValues().get(1).getQuantity())));
177
		Map<String, Double> brandWiseValue = models.stream()
178
		Map<String, Double> brandWiseValue = models.stream()
178
				.filter(x -> x.getItemType().equals(ItemType.SERIALIZED.toString()))
179
				.filter(x -> x.getItemType().equals(ItemType.SERIALIZED.toString()))
179
				.collect(Collectors.groupingBy(x -> x.getBrand(), Collectors
180
				.collect(Collectors.groupingBy(x -> x.getBrand(), Collectors
180
						.summingDouble(x -> x.getValues().get(1).getQuantity() * x.getValues().get(1).getPrice())));*/
181
						.summingDouble(x -> x.getValues().get(1).getQuantity() * x.getValues().get(1).getPrice())));
-
 
182
 
181
		List<DBObject> mobileBrands = mongoClient.getMongoBrands(fofoId, "", 3);
183
		List<DBObject> mobileBrands = mongoClient.getMongoBrands(fofoId, "", 3);
182
		List<BrandStockPrice> brandStockPrices = new ArrayList<>();
184
		List<BrandStockPrice> brandStockPrices = new ArrayList<>();
183
 
185
 
184
		Map<String, Integer> brandWiseQty = new HashMap<String, Integer>();
186
//		Map<String, Integer> brandWiseQty = new HashMap<String, Integer>();
185
		Map<String, Double> brandWiseValue = new HashMap<String, Double>();
187
//		Map<String, Double> brandWiseValue = new HashMap<String, Double>();
186
		mobileBrands.stream().forEach(x -> {
188
		mobileBrands.stream().forEach(x -> {
187
			String brand = (String) x.get("name");
189
			String brand = (String) x.get("name");
188
			if (brandStockPricesMap.containsKey(brand)) {
190
			if (brandStockPricesMap.containsKey(brand)) {
189
				BrandStockPrice brandStockPrice = brandStockPricesMap.get(brand);
191
				BrandStockPrice brandStockPrice = brandStockPricesMap.get(brand);
190
				if (brandWiseQty.get(brand) != null) {
192
				if (brandWiseQty.get(brand) != null) {