Subversion Repositories SmartDukaan

Rev

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

Rev 27893 Rev 27895
Line 717... Line 717...
717
 
717
 
718
		LOGGER.info("cur Date" + curDate.withDayOfMonth(1));
718
		LOGGER.info("cur Date" + curDate.withDayOfMonth(1));
719
 
719
 
720
		LOGGER.info("curDateYear" + curDate.with(LocalTime.MAX));
720
		LOGGER.info("curDateYear" + curDate.with(LocalTime.MAX));
721
 
721
 
722
		Map<String, Double> brandwisesale = fofoOrderItemRepository
722
		Map<String, Double> brandwiseSale = fofoOrderItemRepository
723
				.selectSumAmountGroupByBrand(curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), fofoId);
723
				.selectSumAmountGroupByBrand(curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), fofoId);
724
 
724
 
725
		LOGGER.info("brandwisesale" + brandwisesale);
725
		LOGGER.info("brandwisesale" + brandwiseSale);
726
 
726
 
727
		Map<Integer, Double> accesoriesmtdsale = fofoOrderRepository.selectSumSaleGroupByFofoIdsForMobileOrAccessories(
727
		Map<Integer, Double> accesoriesmtdsale = fofoOrderRepository.selectSumSaleGroupByFofoIdsForMobileOrAccessories(
728
				fofoId, curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), Optional.of(false));
728
				fofoId, curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), Optional.of(false));
729
		brandwisesale.put("Accessories", accesoriesmtdsale.get(fofoId));
729
		brandwiseSale.put("Accessories", accesoriesmtdsale.get(fofoId));
-
 
730
		
730
		Map<String, Double> activatedImeisWithSellingPriceMTD = fofoOrderRepository
731
		Map<String, Double> activatedImeisWithSellingPriceMTD = fofoOrderRepository
731
				.selectValueOfActivatedImeis(curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), fofoId).stream()
732
				.selectValueOfActivatedImeis(curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), fofoId).stream()
732
				.collect(Collectors.toMap(x -> x.getBrand(), x -> (double) x.getSellingPrice()));
733
				.collect(Collectors.toMap(x -> x.getBrand(), x -> (double) x.getSellingPrice()));
733
 
-
 
734
		Map<String, Double> activatedImeisWithSellingPriceLMTD = fofoOrderRepository
734
		Map<String, Double> activatedImeisWithSellingPriceLMTD = fofoOrderRepository
735
				.selectValueOfActivatedImeis(curDate.withDayOfMonth(1).minusMonths(1),
735
				.selectValueOfActivatedImeis(curDate.withDayOfMonth(1).minusMonths(1),
736
						curDate.with(LocalTime.MAX).minusMonths(1), fofoId)
736
						curDate.with(LocalTime.MAX).minusMonths(1), fofoId)
737
				.stream().collect(Collectors.toMap(x -> x.getBrand(), x -> (double) x.getSellingPrice()));
737
				.stream().collect(Collectors.toMap(x -> x.getBrand(), x -> (double) x.getSellingPrice()));
738
 
738
 
Line 746... Line 746...
746
		lmtdBrandWiseSale.put("Accessories", accesorieslmtdsale.get(fofoId));
746
		lmtdBrandWiseSale.put("Accessories", accesorieslmtdsale.get(fofoId));
747
 
747
 
748
		ChartModel cm = new ChartModel();
748
		ChartModel cm = new ChartModel();
749
 
749
 
750
		HashSet<String> labels = new HashSet<String>();
750
		HashSet<String> labels = new HashSet<String>();
751
		labels.addAll(brandwisesale.keySet());
751
		labels.addAll(brandwiseSale.keySet());
752
		labels.addAll(lmtdBrandWiseSale.keySet());
752
		labels.addAll(lmtdBrandWiseSale.keySet());
753
 
753
 
754
		List<String> labelList = new ArrayList<>(labels);
754
		List<String> labelList = new ArrayList<>(labels);
755
 
755
 
756
		List<Double> mtdActivatedImeisValues = new ArrayList<>();
756
		List<Double> mtdActivatedImeisValues = new ArrayList<>();
Line 764... Line 764...
764
			mtdActivatedImeisValues.add(activatedImeisWithSellingPriceMTD.get(label) == null ? 0
764
			mtdActivatedImeisValues.add(activatedImeisWithSellingPriceMTD.get(label) == null ? 0
765
					: activatedImeisWithSellingPriceMTD.get(label));
765
					: activatedImeisWithSellingPriceMTD.get(label));
766
			lmtdActivatedImeisValues.add(activatedImeisWithSellingPriceLMTD.get(label) == null ? 0
766
			lmtdActivatedImeisValues.add(activatedImeisWithSellingPriceLMTD.get(label) == null ? 0
767
					: activatedImeisWithSellingPriceLMTD.get(label));
767
					: activatedImeisWithSellingPriceLMTD.get(label));
768
 
768
 
769
			mtdValues.add(brandwisesale.get(label) == null ? 0 : brandwisesale.get(label));
769
			mtdValues.add(brandwiseSale.get(label) == null ? 0 : brandwiseSale.get(label));
770
			if (brandwisesale.get(label) != null) {
770
			if (brandwiseSale.get(label) != null) {
771
				mtdUnActivatedImeisValues
771
				mtdUnActivatedImeisValues
772
						.add(brandwisesale.get(label) - (activatedImeisWithSellingPriceMTD.get(label) == null ? 0
772
						.add(brandwiseSale.get(label) - (activatedImeisWithSellingPriceMTD.get(label) == null ? 0
773
								: activatedImeisWithSellingPriceMTD.get(label)));
773
								: activatedImeisWithSellingPriceMTD.get(label)));
774
			} else {
774
			} else {
775
				mtdUnActivatedImeisValues.add(0.0);
775
				mtdUnActivatedImeisValues.add(0.0);
776
			}
776
			}
777
			if (lmtdBrandWiseSale.get(label) != null) {
777
			if (lmtdBrandWiseSale.get(label) != null) {