Subversion Repositories SmartDukaan

Rev

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

Rev 32558 Rev 32626
Line 456... Line 456...
456
                List<CreateOfferRequest> publishedOffers = offerService.getPublishedOffers(loginDetails.getFofoId(), YearMonth.from(LocalDateTime.now()));
456
                List<CreateOfferRequest> publishedOffers = offerService.getPublishedOffers(loginDetails.getFofoId(), YearMonth.from(LocalDateTime.now()));
457
                model.addAttribute("publishedOffers", publishedOffers);
457
                model.addAttribute("publishedOffers", publishedOffers);
458
                model.addAttribute("investments", fofoUser.getInvestments(loginDetails.getFofoId()));
458
                model.addAttribute("investments", fofoUser.getInvestments(loginDetails.getFofoId()));
459
                model.addAttribute("isInvestmentOk", partnerInvestmentService.isInvestmentOk(loginDetails.getFofoId(), ProfitMandiConstants.MIN_INVESTMENT_PERCENTAGE, ProfitMandiConstants.CUTOFF_INVESTMENT));
459
                model.addAttribute("isInvestmentOk", partnerInvestmentService.isInvestmentOk(loginDetails.getFofoId(), ProfitMandiConstants.MIN_INVESTMENT_PERCENTAGE, ProfitMandiConstants.CUTOFF_INVESTMENT));
460
 
460
 
461
                double currentMonthRating = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), currentMonthStart, currentMonthEnd) / 2;
461
                double currentMonthRating = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), DateRangeModel.of(currentMonthStart, currentMonthEnd)) / 2;
462
                double lastMonthRating = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), lastMonthStart, currentMonthStart) / 2;
462
                double lastMonthRating = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), DateRangeModel.of(lastMonthStart, currentMonthStart)) / 2;
463
                double ratingTillDate = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), LocalDateTime.MIN, currentMonthEnd) / 2;
463
                double ratingTillDate = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), DateRangeModel.withEndDate(currentMonthEnd)) / 2;
464
                model.addAttribute("currentMonthRating", (float) Math.round(currentMonthRating * 10) / 10);
464
                model.addAttribute("currentMonthRating", (float) Math.round(currentMonthRating * 10) / 10);
465
                model.addAttribute("lastMonthRating", (float) Math.round(lastMonthRating * 10) / 10);
465
                model.addAttribute("lastMonthRating", (float) Math.round(lastMonthRating * 10) / 10);
466
                model.addAttribute("ratingTillDate", (float) Math.round(ratingTillDate * 10) / 10);
466
                model.addAttribute("ratingTillDate", (float) Math.round(ratingTillDate * 10) / 10);
467
 
467
 
468
                long hygieneCount = hygieneDataRepository.selectHygieneCount(loginDetails.getFofoId(), true, currentMonthStart, currentMonthEnd);
468
                long hygieneCount = hygieneDataRepository.selectHygieneCount(loginDetails.getFofoId(), true, currentMonthStart, currentMonthEnd);
Line 678... Line 678...
678
        Map<String, Object> investment = fofoUser.getInvestmentsMonths(fofoId, month);
678
        Map<String, Object> investment = fofoUser.getInvestmentsMonths(fofoId, month);
679
 
679
 
680
        LocalDateTime currentMonthStart = LocalDateTime.now().withDayOfMonth(1);
680
        LocalDateTime currentMonthStart = LocalDateTime.now().withDayOfMonth(1);
681
        LocalDateTime lastMonthStart = currentMonthStart.minusMonths(1);
681
        LocalDateTime lastMonthStart = currentMonthStart.minusMonths(1);
682
        LocalDateTime currentMonthEnd = currentMonthStart.plusMonths(1).withDayOfMonth(1);
682
        LocalDateTime currentMonthEnd = currentMonthStart.plusMonths(1).withDayOfMonth(1);
683
        double currentMonthRating = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), currentMonthStart, currentMonthEnd) / 2;
683
        double currentMonthRating = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), DateRangeModel.of(currentMonthStart, currentMonthEnd)) / 2;
684
        double lastMonthRating = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), lastMonthStart, currentMonthStart) / 2;
684
        double lastMonthRating = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), DateRangeModel.of(lastMonthStart, currentMonthStart)) / 2;
685
        double ratingTillDate = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), LocalDateTime.MIN, currentMonthEnd) / 2;
685
        double ratingTillDate = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), DateRangeModel.withEndDate(currentMonthEnd)) / 2;
686
        model.addAttribute("currentMonthRating", (float) Math.round(currentMonthRating * 10) / 10);
686
        model.addAttribute("currentMonthRating", (float) Math.round(currentMonthRating * 10) / 10);
687
        model.addAttribute("lastMonthRating", (float) Math.round(lastMonthRating * 10) / 10);
687
        model.addAttribute("lastMonthRating", (float) Math.round(lastMonthRating * 10) / 10);
688
        model.addAttribute("ratingTillDate", (float) Math.round(ratingTillDate * 10) / 10);
688
        model.addAttribute("ratingTillDate", (float) Math.round(ratingTillDate * 10) / 10);
689
 
689
 
690
        long hygieneCount = hygieneDataRepository.selectHygieneCount(loginDetails.getFofoId(), true, currentMonthStart.minusMonths(month), currentMonthEnd.minusMonths(month));
690
        long hygieneCount = hygieneDataRepository.selectHygieneCount(loginDetails.getFofoId(), true, currentMonthStart.minusMonths(month), currentMonthEnd.minusMonths(month));