Subversion Repositories SmartDukaan

Rev

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

Rev 29578 Rev 29580
Line 720... Line 720...
720
		LocalDateTime curDate = LocalDate.now().atStartOfDay();
720
		LocalDateTime curDate = LocalDate.now().atStartOfDay();
721
		LocalDateTime startOfMonth = curDate.withDayOfMonth(1).minusMonths(6);
721
		LocalDateTime startOfMonth = curDate.withDayOfMonth(1).minusMonths(6);
722
 
722
 
723
		List<YearMonth> yms = new ArrayList<YearMonth>();
723
		List<YearMonth> yms = new ArrayList<YearMonth>();
724
 
724
 
725
		for (int i = 1; i <= 6; i++) {
725
		for (int i = 0; i <= 5; i++) {
726
			yms.add(YearMonth.from(curDate.withDayOfMonth(1).minusMonths(i)));
726
			yms.add(YearMonth.from(curDate.withDayOfMonth(1).minusMonths(i)));
727
		}
727
		}
728
		Collections.reverse(yms);
728
		Collections.reverse(yms);
729
		model.addAttribute("yms", yms);
729
		model.addAttribute("yms", yms);
730
		LOGGER.info("ym" + yms);
730
		LOGGER.info("ym" + yms);
Line 772... Line 772...
772
 
772
 
773
		model.addAttribute("brands", brands);
773
		model.addAttribute("brands", brands);
774
 
774
 
775
		for (String brand : brands) {
775
		for (String brand : brands) {
776
			Map<YearMonth, Double> yearMonthValue = activationBrandMonthMap.get(brand);
776
			Map<YearMonth, Double> yearMonthValue = activationBrandMonthMap.get(brand);
777
			for (int i = 6; i >= 1; i--) {
777
			for (int i = 5; i >= 0; i--) {
778
				LocalDateTime startMonth = curDate.withDayOfMonth(1).minusMonths(i);
778
				LocalDateTime startMonth = curDate.withDayOfMonth(1).minusMonths(i);
779
				if (yearMonthValue != null) {
779
				if (yearMonthValue != null) {
780
					if (yearMonthValue.get(YearMonth.from(startMonth)) == null) {
780
					if (yearMonthValue.get(YearMonth.from(startMonth)) == null) {
781
						yearMonthValue.put(YearMonth.from(startMonth), 0.0);
781
						yearMonthValue.put(YearMonth.from(startMonth), 0.0);
782
					}
782
					}
Line 789... Line 789...
789
			Map<YearMonth, Double> sortedMonthBrandValue = new TreeMap<>(yearMonthValue);
789
			Map<YearMonth, Double> sortedMonthBrandValue = new TreeMap<>(yearMonthValue);
790
			activationBrandMonthMap.put(brand, sortedMonthBrandValue);
790
			activationBrandMonthMap.put(brand, sortedMonthBrandValue);
791
			sortedBrandValue.put(brand, sortedMonthBrandValue.values().stream().collect(Collectors.toList()));
791
			sortedBrandValue.put(brand, sortedMonthBrandValue.values().stream().collect(Collectors.toList()));
792
		}
792
		}
793
 
793
 
-
 
794
		LOGGER.info("sortedBrandValue" + sortedBrandValue);
794
		model.addAttribute("sortedBrandValue", sortedBrandValue);
795
		model.addAttribute("sortedBrandValue", sortedBrandValue);
795
		model.addAttribute("fofoId", fofoId);
796
		model.addAttribute("fofoId", fofoId);
796
		return "activation-tabular";
797
		return "activation-tabular";
797
	}
798
	}
798
 
799