Subversion Repositories SmartDukaan

Rev

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

Rev 34941 Rev 35237
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,175139441,175139442,175140143,175140146);
495
        List<Integer> retailerIds = Arrays.asList(175139993,175139241);
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);
644
 
645
 
645
//            generate retaile detail
646
//            generate retaile detail
646
 
647
 
647
            BIRetailerModel biRetailerModel = new BIRetailerModel();
648
            BIRetailerModel biRetailerModel = new BIRetailerModel();
648
            biRetailerModel.setBmName(bmName);
649
            biRetailerModel.setBmName(bmName);
Line 1202... Line 1203...
1202
            rows.add(row);
1203
            rows.add(row);
1203
        }
1204
        }
1204
 
1205
 
1205
        Map<String, Set<Integer>> storeGuyMap = this.generateBiReportHierarchyWise();
1206
        Map<String, Set<Integer>> storeGuyMap = this.generateBiReportHierarchyWise();
1206
 
1207
 
1207
        for (Map.Entry<String, Set<Integer>> storeGuyEntry : storeGuyMap.entrySet()) {
1208
        /*for (Map.Entry<String, Set<Integer>> storeGuyEntry : storeGuyMap.entrySet()) {
1208
            String storeGuyEmail = storeGuyEntry.getKey();
1209
            String storeGuyEmail = storeGuyEntry.getKey();
1209
            Set<Integer> fofoIds = storeGuyEntry.getValue();
1210
            Set<Integer> fofoIds = storeGuyEntry.getValue();
1210
            String[] sendToArray = new String[]{storeGuyEmail};
1211
            String[] sendToArray = new String[]{storeGuyEmail};
1211
 
1212
 
1212
            List<List<?>> filteredRows = rows.stream()
1213
            List<List<?>> filteredRows = rows.stream()
1213
                    .filter(row -> row.size() > 5 && fofoIds.contains((Integer) row.get(5)))
1214
                    .filter(row -> row.size() > 5 && fofoIds.contains((Integer) row.get(5)))
1214
                    .collect(Collectors.toList());
1215
                    .collect(Collectors.toList());
1215
            this.sendMailToUser(headerGroup,filteredRows,sendToArray);
1216
            this.sendMailToUser(headerGroup,filteredRows,sendToArray);
1216
        }
1217
        }*/
1217
 
1218
 
1218
        this.sendMailToUser(headerGroup,rows,new String[]{"ranu.rajput@smartdukaan.com"});
1219
        this.sendMailToUser(headerGroup,rows,new String[]{"ranu.rajput@smartdukaan.com"});
1219
 
1220
 
1220
 
1221
 
1221
    }
1222
    }