Subversion Repositories SmartDukaan

Rev

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

Rev 33533 Rev 33827
Line 51... Line 51...
51
import java.math.RoundingMode;
51
import java.math.RoundingMode;
52
import java.time.Duration;
52
import java.time.Duration;
53
import java.time.LocalDate;
53
import java.time.LocalDate;
54
import java.time.LocalDateTime;
54
import java.time.LocalDateTime;
55
import java.time.LocalTime;
55
import java.time.LocalTime;
56
import java.time.temporal.ChronoUnit;
-
 
57
import java.util.*;
56
import java.util.*;
58
import java.util.Map.Entry;
57
import java.util.Map.Entry;
59
import java.util.stream.Collectors;
58
import java.util.stream.Collectors;
60
 
59
 
61
@Controller
60
@Controller
Line 439... Line 438...
439
        LOGGER.info("fofoIds" + fofoIds);
438
        LOGGER.info("fofoIds" + fofoIds);
440
        if (fofoIds == null) {
439
        if (fofoIds == null) {
441
            throw new ProfitMandiBusinessException("you are not authorized", "", "you are not authorized" + " " + "");
440
            throw new ProfitMandiBusinessException("you are not authorized", "", "you are not authorized" + " " + "");
442
        }
441
        }
443
 
442
 
444
        List<Loan> loans = loanRepository.selectAllLoans(new ArrayList<>(fofoIds));
443
        List<LoanCountByFofoIdModel> loanCountByFofoIdModels = loanRepository.getAllLoanCountByFofoId(fofoIds);
-
 
444
        Map<Integer, Long> loanCountMap = loanCountByFofoIdModels.stream().collect(Collectors.toMap(LoanCountByFofoIdModel::getFofoId, LoanCountByFofoIdModel::getLoanCount));
445
 
445
 
-
 
446
//        List<Loan> loans = loanRepository.selectAllLoans(new ArrayList<>(fofoIds));
-
 
447
 
446
        List<Integer> loanFofoIds = loans.stream().map(x -> x.getFofoId()).collect(Collectors.toList());
448
        List<Integer> loanFofoIds = loanCountByFofoIdModels.stream().map(x -> x.getFofoId()).collect(Collectors.toList());
447
 
449
 
448
        List<SDCreditRequirement> sdCreditRequirements = sdCreditRequirementRepository.selectByFofoIds(new ArrayList<>(loanFofoIds));
450
        List<SDCreditRequirement> sdCreditRequirements = sdCreditRequirementRepository.selectByFofoIds(new ArrayList<>(loanFofoIds));
449
 
451
 
450
        Map<Integer, Long> loanCountMap = loans.stream().collect(Collectors.groupingBy(x -> x.getFofoId(), Collectors.counting()));
452
//        Map<Integer, Long> loanCountMap = loans.stream().collect(Collectors.groupingBy(x -> x.getFofoId(), Collectors.counting()));
451
        LOGGER.info("loanCountMap" + loanCountMap);
453
//        LOGGER.info("loanCountMap" + loanCountMap);
452
 
454
 
453
        Map<Integer, UserWallet> userWalletMap = userWalletRepository.selectByRetailerIds(fofoIds).stream().collect(Collectors.toMap(x -> x.getUserId(), x -> x));
455
        Map<Integer, UserWallet> userWalletMap = userWalletRepository.selectByRetailerIds(fofoIds).stream().collect(Collectors.toMap(x -> x.getUserId(), x -> x));
454
        Map<Integer, CurrentPartnerDailyInvestment> currentPartnerDailyInvestmentMap = currentPartnerDailyInvestmentRepository.selectAll().stream().collect(Collectors.toMap(x -> x.getFofoId(), x -> x));
456
        Map<Integer, CurrentPartnerDailyInvestment> currentPartnerDailyInvestmentMap = currentPartnerDailyInvestmentRepository.selectAll().stream().collect(Collectors.toMap(x -> x.getFofoId(), x -> x));
455
 
457
 
456
        model.addAttribute("userWalletMap", userWalletMap);
458
        model.addAttribute("userWalletMap", userWalletMap);