Subversion Repositories SmartDukaan

Rev

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

Rev 36461 Rev 36462
Line 4288... Line 4288...
4288
        }
4288
        }
4289
        return suggestedAmount;
4289
        return suggestedAmount;
4290
    }
4290
    }
4291
 
4291
 
4292
    public void notifyDefaultLoans() throws ProfitMandiBusinessException, MessagingException, IOException {
4292
    public void notifyDefaultLoans() throws ProfitMandiBusinessException, MessagingException, IOException {
4293
       // synchronized (SD_CREDIT_LOCK) {
4293
        synchronized (SD_CREDIT_LOCK) {
4294
            sdCreditService.updateRisk();
4294
            sdCreditService.updateRisk();
4295
            List<Loan> defaultLoans = sdCreditService.getDefaultLoans();
4295
            List<Loan> defaultLoans = sdCreditService.getDefaultLoans();
4296
            if (!defaultLoans.isEmpty()) {
4296
            if (!defaultLoans.isEmpty()) {
4297
                this.sendDefaultLoanAlert(defaultLoans);
4297
                this.sendDefaultLoanAlert(defaultLoans);
4298
            }
4298
            }
4299
        //}
4299
        }
4300
    }
4300
    }
4301
 
4301
 
4302
    public void sendDefaultLoanAlert(List<Loan> defaultLoans) throws
4302
    public void sendDefaultLoanAlert(List<Loan> defaultLoans) throws
4303
            ProfitMandiBusinessException, MessagingException, IOException {
4303
            ProfitMandiBusinessException, MessagingException, IOException {
4304
        String subject = "Default Partners";
4304
        String subject = "Default Partners";
Line 4315... Line 4315...
4315
                }
4315
                }
4316
            }
4316
            }
4317
            if (!filteredRows.isEmpty()) {
4317
            if (!filteredRows.isEmpty()) {
4318
                String[] email = new String[]{storeGuyEntry.getKey(),"neeraj.gupta@smartdukaan.com"};
4318
                String[] email = new String[]{storeGuyEntry.getKey(),"neeraj.gupta@smartdukaan.com"};
4319
                String messageText = this.getMessageForDueDateExtend(filteredRows);
4319
                String messageText = this.getMessageForDueDateExtend(filteredRows);
4320
                this.sendMailOfHtmlFormat(googleMailSender, email, messageText, null, subject);
4320
                this.sendMailOfHtmlFormat(gmailRelaySender, email, messageText, null, subject);
4321
 
4321
 
4322
            }
4322
            }
4323
 
4323
 
4324
        }
4324
        }
4325
        String messageText = this.getMessageForDueDateExtend(defaultLoans);
4325
        String messageText = this.getMessageForDueDateExtend(defaultLoans);
4326
        this.sendMailOfHtmlFormat(googleMailSender, new String[]{"puneet.wahi@smartdukaan.com", "rahul.latwal@smartdukaan.com", "dilbag.singh@smartdukaan.com"}, messageText, null, subject);
4326
        this.sendMailOfHtmlFormat(gmailRelaySender, new String[]{"puneet.wahi@smartdukaan.com", "rahul.latwal@smartdukaan.com", "dilbag.singh@smartdukaan.com"}, messageText, null, subject);
4327
 
4327
 
4328
        for (Loan defaultLoan : defaultLoans) {
4328
        for (Loan defaultLoan : defaultLoans) {
4329
            double principal = defaultLoan.getPendingAmount().doubleValue();
4329
            double principal = defaultLoan.getPendingAmount().doubleValue();
4330
            double interest = defaultLoan.getInterestAccrued().doubleValue() - defaultLoan.getInterestPaid().doubleValue();
4330
            double interest = defaultLoan.getInterestAccrued().doubleValue() - defaultLoan.getInterestPaid().doubleValue();
4331
            double total = principal + interest;
4331
            double total = principal + interest;