Subversion Repositories SmartDukaan

Rev

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

Rev 35112 Rev 35113
Line 4011... Line 4011...
4011
    }
4011
    }
4012
 
4012
 
4013
    private void sendDueDateCrossLoanAlert(List<Loan> dueDateCrossLoans,List<Loan> allActiveLoans) throws Exception {
4013
    private void sendDueDateCrossLoanAlert(List<Loan> dueDateCrossLoans,List<Loan> allActiveLoans) throws Exception {
4014
        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);
4014
        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);
4015
 
4015
 
4016
        for (Entry<String, Set<Integer>> storeGuyEntry : csService.getAuthUserPartnerIdMappingByCategoryIds(categoryIds, false).entrySet()) {
4016
        /*for (Entry<String, Set<Integer>> storeGuyEntry : csService.getAuthUserPartnerIdMappingByCategoryIds(categoryIds, false).entrySet()) {
4017
            List<Loan> filteredRows = new ArrayList<>();
4017
            List<Loan> filteredRows = new ArrayList<>();
4018
            for (Loan loan : dueDateCrossLoans) {
4018
            for (Loan loan : dueDateCrossLoans) {
4019
 
4019
 
4020
                if (storeGuyEntry.getValue().contains(loan.getFofoId())) {
4020
                if (storeGuyEntry.getValue().contains(loan.getFofoId())) {
4021
 
4021
 
Line 4055... Line 4055...
4055
 
4055
 
4056
 
4056
 
4057
 
4057
 
4058
            }
4058
            }
4059
 
4059
 
-
 
4060
        }*/
-
 
4061
 
-
 
4062
        String messageText = this.getMessageForDueDateCross(dueDateCrossLoans);
-
 
4063
        ByteArrayOutputStream byteArrayOutputStream = this.generateLoanCsv(allActiveLoans);
-
 
4064
        Utils.Attachment attachment = null;
-
 
4065
        if(byteArrayOutputStream != null){
-
 
4066
            attachment  = new Utils.Attachment("partnner-credit.csv", new ByteArrayResource(byteArrayOutputStream.toByteArray()));
-
 
4067
 
4060
        }
4068
        }
4061
 
4069
 
-
 
4070
        if(attachment != null){
4062
//        String messageText = this.getMessageForDueDateCross(dueDateCrossLoans);
4071
            Utils.sendMailWithAttachments(googleMailSender, new String[]{"tarun.verma@smartdukaan.com", "sdtech@smartdukaan.com"}, null, null, "Partner Credit Report", messageText, true, attachment);
-
 
4072
        }else {
4063
//        this.sendMailOfHtmlFormat(googleMailSender, new String[]{"puneet.wahi@smartdukaan.com", "rahul.latwal@smartdukaan.com", "sdtech@smartdukaan.com"}, messageText, null, "Due Date Cross");
4073
            this.sendMailOfHtmlFormat(googleMailSender, new String[]{"tarun.verma@smartdukaan.com", "sdtech@smartdukaan.com"}, messageText, null, "Due Date Cross");
-
 
4074
        }
4064
 
4075
 
4065
 
4076
 
4066
        if (!dueDateCrossLoans.isEmpty()) {
4077
        if (!dueDateCrossLoans.isEmpty()) {
4067
            for (Loan loan : dueDateCrossLoans) {
4078
            for (Loan loan : dueDateCrossLoans) {
4068
 
4079