Subversion Repositories SmartDukaan

Rev

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

Rev 35238 Rev 35239
Line 480... Line 480...
480
            // Otherwise, use today
480
            // Otherwise, use today
481
            startOfToday = LocalDate.now().atStartOfDay();
481
            startOfToday = LocalDate.now().atStartOfDay();
482
            previousDay = startOfToday.with(LocalTime.MAX).minusDays(1);
482
            previousDay = startOfToday.with(LocalTime.MAX).minusDays(1);
483
        }
483
        }
484
 
484
 
485
//        Map<Integer, CustomRetailer> customRetailers = retailerService.getAllFofoRetailersInternalFalse();
485
        Map<Integer, CustomRetailer> customRetailers = retailerService.getAllFofoRetailersInternalFalse();
486
 
486
 
487
        /*List<Integer> retailerIds = customRetailers.values().stream()
487
        List<Integer> retailerIds = customRetailers.values().stream()
488
                .filter(retailer -> {
488
                .filter(retailer -> {
489
                    String storeCode = retailer.getCode(); // adjust method name if different
489
                    String storeCode = retailer.getCode(); // adjust method name if different
490
                    return !storeCode.equalsIgnoreCase("UPGBN640") && !storeCode.equalsIgnoreCase("HRYN039");
490
                    return !storeCode.equalsIgnoreCase("UPGBN640") && !storeCode.equalsIgnoreCase("HRYN039");
491
                })
491
                })
492
                .map(CustomRetailer::getPartnerId)
492
                .map(CustomRetailer::getPartnerId)
493
                .collect(Collectors.toList());*/
493
                .collect(Collectors.toList());
494
 
494
 
495
        List<Integer> retailerIds = Arrays.asList(175139993,175139241,172157716);
495
//        List<Integer> retailerIds = Arrays.asList(175139993,175139441,175139442,175140143,175140146);
496
        Map<Integer,CustomRetailer> customRetailers = retailerService.getFofoRetailers(retailerIds);
496
//        Map<Integer,CustomRetailer> customRetailers = retailerService.getFofoRetailers(retailerIds);
497
 
497
 
498
        //partner daily investment
498
        //partner daily investment
499
        List<Loan> defaultLoans = sdCreditService.getDefaultLoans();
499
        List<Loan> defaultLoans = sdCreditService.getDefaultLoans();
500
        Map<Integer,List<Loan>> defaultLoanMap = defaultLoans.stream().collect(Collectors.groupingBy(Loan::getFofoId));
500
        Map<Integer,List<Loan>> defaultLoanMap = defaultLoans.stream().collect(Collectors.groupingBy(Loan::getFofoId));
501
 
501
 
Line 639... Line 639...
639
            }
639
            }
640
            AST ast = astRepository.selectById(customRetailers.get(fofoId).getAstId());
640
            AST ast = astRepository.selectById(customRetailers.get(fofoId).getAstId());
641
 
641
 
642
            LOGGER.info("fofoID--11 {}",fofoId);
642
            LOGGER.info("fofoID--11 {}",fofoId);
643
            PartnerType partnerTypeThisMonth = partnerTypeChangeService.getTypeOnMonth(fofoId, currentMonth);
643
            PartnerType partnerTypeThisMonth = partnerTypeChangeService.getTypeOnMonth(fofoId, currentMonth);
644
            LOGGER.info("PartnerType--11 {}",partnerTypeThisMonth);
-
 
645
 
644
 
646
//            generate retaile detail
645
//            generate retaile detail
647
 
646
 
648
            BIRetailerModel biRetailerModel = new BIRetailerModel();
647
            BIRetailerModel biRetailerModel = new BIRetailerModel();
649
            biRetailerModel.setBmName(bmName);
648
            biRetailerModel.setBmName(bmName);
Line 1203... Line 1202...
1203
            rows.add(row);
1202
            rows.add(row);
1204
        }
1203
        }
1205
 
1204
 
1206
        Map<String, Set<Integer>> storeGuyMap = this.generateBiReportHierarchyWise();
1205
        Map<String, Set<Integer>> storeGuyMap = this.generateBiReportHierarchyWise();
1207
 
1206
 
1208
        /*for (Map.Entry<String, Set<Integer>> storeGuyEntry : storeGuyMap.entrySet()) {
1207
        for (Map.Entry<String, Set<Integer>> storeGuyEntry : storeGuyMap.entrySet()) {
1209
            String storeGuyEmail = storeGuyEntry.getKey();
1208
            String storeGuyEmail = storeGuyEntry.getKey();
1210
            Set<Integer> fofoIds = storeGuyEntry.getValue();
1209
            Set<Integer> fofoIds = storeGuyEntry.getValue();
1211
            String[] sendToArray = new String[]{storeGuyEmail};
1210
            String[] sendToArray = new String[]{storeGuyEmail};
1212
 
1211
 
1213
            List<List<?>> filteredRows = rows.stream()
1212
            List<List<?>> filteredRows = rows.stream()
1214
                    .filter(row -> row.size() > 5 && fofoIds.contains((Integer) row.get(5)))
1213
                    .filter(row -> row.size() > 5 && fofoIds.contains((Integer) row.get(5)))
1215
                    .collect(Collectors.toList());
1214
                    .collect(Collectors.toList());
1216
            this.sendMailToUser(headerGroup,filteredRows,sendToArray);
1215
            this.sendMailToUser(headerGroup,filteredRows,sendToArray);
1217
        }*/
1216
        }
1218
 
1217
 
1219
        this.sendMailToUser(headerGroup,rows,new String[]{"ranu.rajput@smartdukaan.com"});
1218
        this.sendMailToUser(headerGroup,rows,new String[]{"ranu.rajput@smartdukaan.com"});
1220
 
1219
 
1221
 
1220
 
1222
    }
1221
    }