Subversion Repositories SmartDukaan

Rev

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

Rev 34922 Rev 34925
Line 475... Line 475...
475
            // Otherwise, use today
475
            // Otherwise, use today
476
            startOfToday = LocalDate.now().atStartOfDay();
476
            startOfToday = LocalDate.now().atStartOfDay();
477
            previousDay = startOfToday.with(LocalTime.MAX).minusDays(1);
477
            previousDay = startOfToday.with(LocalTime.MAX).minusDays(1);
478
        }
478
        }
479
 
479
 
480
        Map<Integer, CustomRetailer> customRetailers = retailerService.getAllFofoRetailersInternalFalse();
480
        /*Map<Integer, CustomRetailer> customRetailers = retailerService.getAllFofoRetailersInternalFalse();
481
 
481
 
482
        List<Integer> retailerIds = customRetailers.values().stream()
482
        List<Integer> retailerIds = customRetailers.values().stream()
483
                .filter(retailer -> {
483
                .filter(retailer -> {
484
                    String storeCode = retailer.getCode(); // adjust method name if different
484
                    String storeCode = retailer.getCode(); // adjust method name if different
485
                    return !storeCode.equalsIgnoreCase("UPGBN640") && !storeCode.equalsIgnoreCase("HRYN039");
485
                    return !storeCode.equalsIgnoreCase("UPGBN640") && !storeCode.equalsIgnoreCase("HRYN039");
486
                })
486
                })
487
                .map(CustomRetailer::getPartnerId)
487
                .map(CustomRetailer::getPartnerId)
488
                .collect(Collectors.toList());
488
                .collect(Collectors.toList());*/
489
 
489
 
490
//        List<Integer> retailerIds = customRetailers.values().stream().map(CustomRetailer::getPartnerId).collect(Collectors.toList());
-
 
491
 
-
 
492
/*        List<Integer> retailerIds = Arrays.asList(175139440,175139441,175139442);
490
        List<Integer> retailerIds = Arrays.asList(175139993,175139441,175139442,175140143,175140146);
493
        Map<Integer,CustomRetailer> customRetailers = retailerService.getFofoRetailers(retailerIds);*/
491
        Map<Integer,CustomRetailer> customRetailers = retailerService.getFofoRetailers(retailerIds);
494
 
492
 
495
        //partner daily investment
493
        //partner daily investment
496
        List<Loan> defaultLoans = sdCreditService.getDefaultLoans();
494
        List<Loan> defaultLoans = sdCreditService.getDefaultLoans();
497
        Map<Integer,List<Loan>> defaultLoanMap = defaultLoans.stream().collect(Collectors.groupingBy(Loan::getFofoId));
495
        Map<Integer,List<Loan>> defaultLoanMap = defaultLoans.stream().collect(Collectors.groupingBy(Loan::getFofoId));
498
 
496
 
Line 502... Line 500...
502
        if (!partnerDailyInvestments.isEmpty()) {
500
        if (!partnerDailyInvestments.isEmpty()) {
503
            partnerDailyInvestmentMap = partnerDailyInvestments.stream()
501
            partnerDailyInvestmentMap = partnerDailyInvestments.stream()
504
                    .collect(Collectors.toMap(x -> x.getFofoId(), x -> x));
502
                    .collect(Collectors.toMap(x -> x.getFofoId(), x -> x));
505
        }
503
        }
506
 
504
 
507
 
-
 
-
 
505
        LOGGER.info("partnerDailyInvestmentMap {}",partnerDailyInvestmentMap);
508
 
506
 
509
    //  this month return data
507
    //  this month return data
510
 
508
 
511
        YearMonth currentMonth;
509
        YearMonth currentMonth;
512
        LocalDateTime currentMonthStartDate;
510
        LocalDateTime currentMonthStartDate;
Line 1200... Line 1198...
1200
            rows.add(row);
1198
            rows.add(row);
1201
        }
1199
        }
1202
 
1200
 
1203
        Map<String, Set<Integer>> storeGuyMap = this.generateBiReportHierarchyWise();
1201
        Map<String, Set<Integer>> storeGuyMap = this.generateBiReportHierarchyWise();
1204
 
1202
 
1205
        for (Map.Entry<String, Set<Integer>> storeGuyEntry : storeGuyMap.entrySet()) {
1203
        /*for (Map.Entry<String, Set<Integer>> storeGuyEntry : storeGuyMap.entrySet()) {
1206
            String storeGuyEmail = storeGuyEntry.getKey();
1204
            String storeGuyEmail = storeGuyEntry.getKey();
1207
            Set<Integer> fofoIds = storeGuyEntry.getValue();
1205
            Set<Integer> fofoIds = storeGuyEntry.getValue();
1208
            String[] sendToArray = new String[]{storeGuyEmail};
1206
            String[] sendToArray = new String[]{storeGuyEmail};
1209
 
1207
 
1210
            List<List<?>> filteredRows = rows.stream()
1208
            List<List<?>> filteredRows = rows.stream()
1211
                    .filter(row -> row.size() > 5 && fofoIds.contains((Integer) row.get(5)))
1209
                    .filter(row -> row.size() > 5 && fofoIds.contains((Integer) row.get(5)))
1212
                    .collect(Collectors.toList());
1210
                    .collect(Collectors.toList());
1213
            this.sendMailToUser(headerGroup,filteredRows,sendToArray);
1211
            this.sendMailToUser(headerGroup,filteredRows,sendToArray);
1214
        }
1212
        }*/
1215
 
1213
 
1216
        this.sendMailToUser(headerGroup,rows,new String[]{"ranu.rajput@smartdukaan.com"});
1214
        this.sendMailToUser(headerGroup,rows,new String[]{"ranu.rajput@smartdukaan.com"});
1217
 
1215
 
1218
 
1216
 
1219
    }
1217
    }