Subversion Repositories SmartDukaan

Rev

Rev 35568 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35568 Rev 35591
Line 4068... Line 4068...
4068
 
4068
 
4069
    public void sendDefaultLoanAlert(List<Loan> defaultLoans) throws
4069
    public void sendDefaultLoanAlert(List<Loan> defaultLoans) throws
4070
            ProfitMandiBusinessException, MessagingException, IOException {
4070
            ProfitMandiBusinessException, MessagingException, IOException {
4071
        String subject = "Default Partners";
4071
        String subject = "Default Partners";
4072
 
4072
 
4073
        List<Integer> categoryIds = Arrays.asList(ProfitMandiConstants.TICKET_CATEGORY_CATEGORY, ProfitMandiConstants.TICKET_CATEGORY_RBM, ProfitMandiConstants.TICKET_CATEGORY_SALES, ProfitMandiConstants.TICKET_CATEGORY_ABM, ProfitMandiConstants.TICKET_CATEGORY_ACCOUNTS, ProfitMandiConstants.TICKET_CATEGORY_BUSINESSINTELLIGENT);
4073
        List<Integer> categoryIds = Arrays.asList(ProfitMandiConstants.TICKET_CATEGORY_CATEGORY, ProfitMandiConstants.TICKET_CATEGORY_RBM, ProfitMandiConstants.TICKET_CATEGORY_SALES, ProfitMandiConstants.TICKET_CATEGORY_ABM, ProfitMandiConstants.TICKET_CATEGORY_BUSINESSINTELLIGENT);
4074
 
4074
 
4075
        for (Entry<String, Set<Integer>> storeGuyEntry : csService.getAuthUserPartnerIdMappingByCategoryIds(categoryIds, false).entrySet()) {
4075
        for (Entry<String, Set<Integer>> storeGuyEntry : csService.getAuthUserPartnerIdMappingByCategoryIds(categoryIds, false).entrySet()) {
4076
            List<Loan> filteredRows = new ArrayList<>();
4076
            List<Loan> filteredRows = new ArrayList<>();
4077
            for (Loan loan : defaultLoans) {
4077
            for (Loan loan : defaultLoans) {
4078
 
4078
 
Line 4080... Line 4080...
4080
 
4080
 
4081
                    filteredRows.add(loan);
4081
                    filteredRows.add(loan);
4082
                }
4082
                }
4083
            }
4083
            }
4084
            if (!filteredRows.isEmpty()) {
4084
            if (!filteredRows.isEmpty()) {
4085
                String[] email = new String[]{storeGuyEntry.getKey()};
4085
                String[] email = new String[]{storeGuyEntry.getKey(),"neeraj.gupta@smartdukaan.com"};
4086
                String messageText = this.getMessageForDueDateExtend(filteredRows);
4086
                String messageText = this.getMessageForDueDateExtend(filteredRows);
4087
                this.sendMailOfHtmlFormat(googleMailSender, email, messageText, null, subject);
4087
                this.sendMailOfHtmlFormat(googleMailSender, email, messageText, null, subject);
4088
 
4088
 
4089
            }
4089
            }
4090
 
4090
 
Line 4238... Line 4238...
4238
        }
4238
        }
4239
 
4239
 
4240
    }
4240
    }
4241
 
4241
 
4242
    private void sendDueDateCrossLoanAlert(List<Loan> dueDateCrossLoans, List<Loan> allActiveLoans) throws Exception {
4242
    private void sendDueDateCrossLoanAlert(List<Loan> dueDateCrossLoans, List<Loan> allActiveLoans) throws Exception {
4243
        List<Integer> categoryIds = Arrays.asList(ProfitMandiConstants.TICKET_CATEGORY_CATEGORY, ProfitMandiConstants.TICKET_CATEGORY_RBM, ProfitMandiConstants.TICKET_CATEGORY_SALES, ProfitMandiConstants.TICKET_CATEGORY_ABM, ProfitMandiConstants.TICKET_CATEGORY_ACCOUNTS, ProfitMandiConstants.TICKET_CATEGORY_BUSINESSINTELLIGENT);
4243
        List<Integer> categoryIds = Arrays.asList(ProfitMandiConstants.TICKET_CATEGORY_CATEGORY, ProfitMandiConstants.TICKET_CATEGORY_RBM, ProfitMandiConstants.TICKET_CATEGORY_SALES, ProfitMandiConstants.TICKET_CATEGORY_ABM, ProfitMandiConstants.TICKET_CATEGORY_BUSINESSINTELLIGENT);
4244
 
4244
 
4245
        for (Entry<String, Set<Integer>> storeGuyEntry : csService.getAuthUserPartnerIdMappingByCategoryIds(categoryIds, false).entrySet()) {
4245
        for (Entry<String, Set<Integer>> storeGuyEntry : csService.getAuthUserPartnerIdMappingByCategoryIds(categoryIds, false).entrySet()) {
4246
            List<Loan> filteredRows = new ArrayList<>();
4246
            List<Loan> filteredRows = new ArrayList<>();
4247
            for (Loan loan : dueDateCrossLoans) {
4247
            for (Loan loan : dueDateCrossLoans) {
4248
 
4248
 
Line 4270... Line 4270...
4270
            }
4270
            }
4271
 
4271
 
4272
 
4272
 
4273
            if (!filteredRows.isEmpty()) {
4273
            if (!filteredRows.isEmpty()) {
4274
                String messageText = this.getMessageForDueDateCross(filteredRows);
4274
                String messageText = this.getMessageForDueDateCross(filteredRows);
4275
                String[] email = new String[]{storeGuyEntry.getKey()};
4275
                String[] email = new String[]{storeGuyEntry.getKey(),"neeraj.gupta@smartdukaan.com"};
4276
 
4276
 
4277
                if (attachment1 != null) {
4277
                if (attachment1 != null) {
4278
                    Utils.sendMailWithAttachments(googleMailSender, email, null, null, "Partner Credit Report", messageText, true, attachment1);
4278
                    Utils.sendMailWithAttachments(googleMailSender, email, null, null, "Partner Credit Report", messageText, true, attachment1);
4279
                } else {
4279
                } else {
4280
                    this.sendMailOfHtmlFormat(googleMailSender, email, messageText, null, "Due Date Cross");
4280
                    this.sendMailOfHtmlFormat(googleMailSender, email, messageText, null, "Due Date Cross");