Subversion Repositories SmartDukaan

Rev

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

Rev 25740 Rev 25747
Line 331... Line 331...
331
 
331
 
332
			}
332
			}
333
		}
333
		}
334
 
334
 
335
		LocalDateTime currentMonthStart = LocalDateTime.now().withDayOfMonth(1);
335
		LocalDateTime currentMonthStart = LocalDateTime.now().withDayOfMonth(1);
-
 
336
		LocalDateTime lastMonthStart = currentMonthStart.minusMonths(1);
336
		LocalDateTime currentMonthEnd = currentMonthStart.plusMonths(1).withDayOfMonth(1);
337
		LocalDateTime currentMonthEnd = currentMonthStart.plusMonths(1).withDayOfMonth(1);
337
		double currentMonthRating = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), currentMonthStart,
338
		double currentMonthRating = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), currentMonthStart,
338
				currentMonthEnd) / 2;
339
				currentMonthEnd) / 2;
339
		double lastMonthRating = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), currentMonthStart,
340
		double lastMonthRating = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), lastMonthStart,
340
				currentMonthEnd) / 2;
341
				currentMonthStart) / 2;
341
		double ratingTillDate = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), currentMonthStart,
342
		double ratingTillDate = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), LocalDateTime.MIN,
342
				currentMonthEnd) / 2;
343
				currentMonthEnd) / 2;
343
		model.addAttribute("currentMonthRating", (float) Math.round(currentMonthRating * 10) / 10);
344
		model.addAttribute("currentMonthRating", (float) Math.round(currentMonthRating * 10) / 10);
344
		model.addAttribute("lastMonthRating", (float) Math.round(lastMonthRating * 10) / 10);
345
		model.addAttribute("lastMonthRating", (float) Math.round(lastMonthRating * 10) / 10);
345
		model.addAttribute("ratingTillDate", (float) Math.round(ratingTillDate * 10) / 10);
346
		model.addAttribute("ratingTillDate", (float) Math.round(ratingTillDate * 10) / 10);
346
 
347