Subversion Repositories SmartDukaan

Rev

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

Rev 31267 Rev 31269
Line 1917... Line 1917...
1917
						.map(x -> partnerStats.get(x)).collect(Collectors.toList());
1917
						.map(x -> partnerStats.get(x)).collect(Collectors.toList());
1918
 
1918
 
1919
				Map<Integer, Double> last3MonthSale = fofoOrderItemRepository.selectSumMopGroupByRetailer(
1919
				Map<Integer, Double> last3MonthSale = fofoOrderItemRepository.selectSumMopGroupByRetailer(
1920
						LocalDateTime.now().withDayOfMonth(1).minusMonths(2), LocalDateTime.now(), 0, false);
1920
						LocalDateTime.now().withDayOfMonth(1).minusMonths(2), LocalDateTime.now(), 0, false);
1921
 
1921
 
1922
				Map<String, Long> lmsMap = new HashMap<>();
1922
				Map<Milestone, Long> lmsMap = new HashMap<>();
1923
				if (!last3MonthSale.isEmpty()) {
1923
				if (!last3MonthSale.isEmpty()) {
1924
 
1924
 
1925
					int days = 60 + LocalDateTime.now().getDayOfMonth();
1925
					int days = 60 + LocalDateTime.now().getDayOfMonth();
1926
 
1926
 
1927
					for (Entry<Integer, Double> last3MonthEntry : last3MonthSale.entrySet()) {
1927
					for (Entry<Integer, Double> last3MonthEntry : last3MonthSale.entrySet()) {
Line 1933... Line 1933...
1933
								monthSale = (double) 0;
1933
								monthSale = (double) 0;
1934
 
1934
 
1935
							}
1935
							}
1936
 
1936
 
1937
							double avg3MonthSale = (monthSale / days) * 30;
1937
							double avg3MonthSale = (monthSale / days) * 30;
1938
							String milestone = Milestone.get((int) avg3MonthSale);
1938
							Milestone milestone = Milestone.get((int) avg3MonthSale);
1939
 
1939
 
1940
							long value = 0;
1940
							long value = 0;
1941
 
1941
 
1942
							if (lmsMap.containsKey(milestone)) {
1942
							if (lmsMap.containsKey(milestone)) {
1943
								value = lmsMap.get(milestone) + 1;
1943
								value = lmsMap.get(milestone) + 1;
Line 1950... Line 1950...
1950
 
1950
 
1951
					}
1951
					}
1952
 
1952
 
1953
				}
1953
				}
1954
 
1954
 
1955
				LOGGER.info("partnerDetails" + LocalDateTime.now().withDayOfMonth(1).minusMonths(2));
1955
				LOGGER.info("partnerDetails" + partnerDetails);
1956
 
1956
 
1957
				if (partnerDetails != null) {
1957
				if (partnerDetails != null) {
1958
 
1958
 
1959
					Map<String, Long> mtdMap = partnerDetails.stream()
1959
					Map<Milestone, Long> mtdMap = partnerDetails.stream()
1960
							.collect(Collectors.groupingBy(x -> x.getMtdValue(), Collectors.counting()));
1960
							.collect(Collectors.groupingBy(x -> x.getMtdValue(), Collectors.counting()));
1961
					Map<String, Long> lmtdMap = partnerDetails.stream()
1961
					Map<Milestone, Long> lmtdMap = partnerDetails.stream()
1962
							.collect(Collectors.groupingBy(x -> Milestone.get(x.getLmtd()), Collectors.counting()));
1962
							.collect(Collectors.groupingBy(x -> Milestone.get(x.getLmtd()), Collectors.counting()));
1963
 
1963
 
1964
					LOGGER.info("mtdMap" + mtdMap);
1964
					LOGGER.info("mtdMap" + mtdMap);
1965
 
1965
 
1966
					LOGGER.info("lmtdMap" + lmtdMap);
1966
					LOGGER.info("lmtdMap" + lmtdMap);