Subversion Repositories SmartDukaan

Rev

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

Rev 33833 Rev 33834
Line 1048... Line 1048...
1048
    GstProService gstProService;
1048
    GstProService gstProService;
1049
 
1049
 
1050
    @Autowired
1050
    @Autowired
1051
    WarehouseProviderRepository warehouseProviderRepository;
1051
    WarehouseProviderRepository warehouseProviderRepository;
1052
    public void test() throws Exception {
1052
    public void test() throws Exception {
1053
        //sdCreditService.createLoan(175139295,93000,0,"Amount added for loan adjustment");
1053
        sdCreditService.createLoan(175139295,90000,0,"Amount added for loan adjustment");
1054
        //this.checkfocusedModelInPartnerStock();
1054
        //this.checkfocusedModelInPartnerStock();
1055
       // List<SDCreditRequirement> sdCreditRequirements = sdCreditRequirementRepository.selectAll();
1055
       // List<SDCreditRequirement> sdCreditRequirements = sdCreditRequirementRepository.selectAll();
1056
        /*for (SDCreditRequirement sdCreditRequirement : sdCreditRequirements) {
1056
        /*for (SDCreditRequirement sdCreditRequirement : sdCreditRequirements) {
1057
            long utilizationAmount = sdCreditService.getUtilizationAmount(sdCreditRequirement.getFofoId());
1057
            long utilizationAmount = sdCreditService.getUtilizationAmount(sdCreditRequirement.getFofoId());
1058
            if (Math.abs(sdCreditRequirement.getUtilizedAmount().doubleValue() - utilizationAmount) > 5) {
1058
            if (Math.abs(sdCreditRequirement.getUtilizedAmount().doubleValue() - utilizationAmount) > 5) {
Line 3710... Line 3710...
3710
            throw new ProfitMandiBusinessException("loanstament", loanStatement.getLoanId(), "Invalid LoanId");
3710
            throw new ProfitMandiBusinessException("loanstament", loanStatement.getLoanId(), "Invalid LoanId");
3711
        }
3711
        }
3712
    }
3712
    }
3713
 
3713
 
3714
    public void loanSettlement() throws Exception {
3714
    public void loanSettlement() throws Exception {
3715
        List<Integer> loanIds = Arrays.asList(21217,21220,21222);
3715
        //List<Integer> loanIds = Arrays.asList(21217,21220,21222);
3716
        List<Loan> blockedLoans = loanRepository.selectAllActiveLoan().stream().filter(x -> x.getFreeDays() >= 365).collect(toList());
3716
        List<Loan> blockedLoans = loanRepository.selectAllActiveLoan().stream().filter(x -> x.getFreeDays() >= 365).collect(toList());
3717
        List<Loan> loans = loanRepository.selectAllActiveLoan().stream().filter(x -> x.getFreeDays() < 365).collect(toList());
3717
        List<Loan> loans = loanRepository.selectAllActiveLoan().stream().filter(x -> x.getFreeDays() < 365).collect(toList());
3718
        //Settle blocked loans only when normal loans are settled
3718
        //Settle blocked loans only when normal loans are settled
3719
 
3719
 
3720
        for(int loanid : loanIds){
3720
        //for(int loanid : loanIds){
3721
            loans.addAll(blockedLoans);
3721
            loans.addAll(blockedLoans);
3722
            //TODO:Remove this code
3722
            //TODO:Remove this code
3723
            Loan specificLoan = loanRepository.selectByLoanId(loanid);
3723
            Loan specificLoan = loanRepository.selectByLoanId(20258);
3724
            loans.add(0, specificLoan);
3724
            loans.add(0, specificLoan);
3725
            //TODO:Upto here
3725
            //TODO:Upto here
3726
            if (!loans.isEmpty()) {
3726
            if (!loans.isEmpty()) {
3727
 
3727
 
3728
                for (Loan loan : loans) {
3728
                for (Loan loan : loans) {
Line 3751... Line 3751...
3751
 
3751
 
3752
                    }
3752
                    }
3753
                }
3753
                }
3754
 
3754
 
3755
            }
3755
            }
3756
        }
3756
        //}
3757
 
3757
 
3758
 
3758
 
3759
 
3759
 
3760
    }
3760
    }
3761
 
3761