Subversion Repositories SmartDukaan

Rev

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

Rev 27867 Rev 27893
Line 1580... Line 1580...
1580
				.getSecondaryModel().stream()
1580
				.getSecondaryModel().stream()
1581
				.collect(Collectors.groupingBy(x -> new BrandRegionModel(x.getWarehouseId(), x.getBrand()),
1581
				.collect(Collectors.groupingBy(x -> new BrandRegionModel(x.getWarehouseId(), x.getBrand()),
1582
						Collectors.collectingAndThen(Collectors.toList(),
1582
						Collectors.collectingAndThen(Collectors.toList(),
1583
								x -> x.stream().collect(Collectors.toMap(y -> y.getBillingTimestamp(), y -> y)))));
1583
								x -> x.stream().collect(Collectors.toMap(y -> y.getBillingTimestamp(), y -> y)))));
1584
 
1584
 
-
 
1585
		Map<LocalDate, Integer> dateWiseTotal = sr.getSecondaryModel().stream().collect(
-
 
1586
				Collectors.groupingBy(x -> x.getBillingTimestamp(), Collectors.summingInt(x -> (int) x.getValue())));
-
 
1587
 
-
 
1588
		Map<LocalDate, Integer> dateWiseQtyTotal = sr.getSecondaryModel().stream().collect(
-
 
1589
				Collectors.groupingBy(x -> x.getBillingTimestamp(), Collectors.summingInt(x -> (int) x.getQty())));
-
 
1590
 
-
 
1591
		LOGGER.info("dateWiseTotal" + dateWiseTotal);
-
 
1592
 
1585
		brandWarehouseOrderMap.entrySet().stream().forEach(x -> {
1593
		brandWarehouseOrderMap.entrySet().stream().forEach(x -> {
1586
			x.getKey().setTotal(
1594
			x.getKey().setTotal(x.getValue().entrySet().stream()
1587
					x.getValue().entrySet().stream().collect(Collectors.summingLong(y -> y.getValue().getValue())));
1595
					.collect(Collectors.summingInt(y -> (int) y.getValue().getValue())));
1588
		});
1596
		});
1589
 
1597
 
-
 
1598
		brandWarehouseOrderMap.entrySet().stream().forEach(x -> {
-
 
1599
			x.getKey().setQty(
-
 
1600
					x.getValue().entrySet().stream().collect(Collectors.summingInt(y -> (int) y.getValue().getQty())));
-
 
1601
		});
1590
		LOGGER.info("brandWarehouseOrderMap" + brandWarehouseOrderMap);
1602
		LOGGER.info("brandWarehouseOrderMap" + brandWarehouseOrderMap);
1591
 
1603
 
1592
		model.addAttribute("brandWarehouseOrderMap", brandWarehouseOrderMap);
1604
		model.addAttribute("brandWarehouseOrderMap", brandWarehouseOrderMap);
-
 
1605
		model.addAttribute("dateWiseTotal", dateWiseTotal);
-
 
1606
		model.addAttribute("dateWiseQtyTotal", dateWiseQtyTotal);
1593
		model.addAttribute("dateRange", sr.getDateRange());
1607
		model.addAttribute("dateRange", sr.getDateRange());
1594
		model.addAttribute("warehouseMap", warehouseMap);
1608
		model.addAttribute("warehouseMap", warehouseMap);
1595
		return "secondary-warehouse-billing-order";
1609
		return "secondary-warehouse-billing-order";
1596
 
1610
 
1597
	}
1611
	}
Line 1617... Line 1631...
1617
 
1631
 
1618
	@RequestMapping(value = "/getSecondaryBillingItemByBrand", method = RequestMethod.GET)
1632
	@RequestMapping(value = "/getSecondaryBillingItemByBrand", method = RequestMethod.GET)
1619
	public String getSecondaryBillingItemByBrand(HttpServletRequest request,
1633
	public String getSecondaryBillingItemByBrand(HttpServletRequest request,
1620
			@RequestParam(name = "warehouseId", required = true, defaultValue = "0") int warehouseId,
1634
			@RequestParam(name = "warehouseId", required = true, defaultValue = "0") int warehouseId,
1621
			@RequestParam(name = "brand", required = true, defaultValue = "") String brand,
1635
			@RequestParam(name = "brand", required = true, defaultValue = "") String brand,
1622
			@RequestParam LocalDate date, Model model) throws Exception {
1636
			@RequestParam List<LocalDate> date, Model model) throws Exception {
1623
 
1637
 
1624
		List<SecondaryOrderItemBillingModel> orderItemBilling = orderRepository
1638
		List<SecondaryOrderItemBillingModel> orderItemBilling = orderRepository
1625
				.selectAllBilledOrderItemByBrand(warehouseId, brand, date);
1639
				.selectAllBilledOrderItemByBrand(warehouseId, brand, date);
1626
 
1640
 
1627
		LOGGER.info("orderItemBilling" + orderItemBilling);
1641
		LOGGER.info("orderItemBilling" + orderItemBilling);