Subversion Repositories SmartDukaan

Rev

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

Rev 37036 Rev 37047
Line 811... Line 811...
811
            Map<Integer, AuthUser> authIdAndAuthUserMap = authRepository.selectByIds(authIds).stream().collect(Collectors.toMap(x -> x.getId(), x -> x));
811
            Map<Integer, AuthUser> authIdAndAuthUserMap = authRepository.selectByIds(authIds).stream().collect(Collectors.toMap(x -> x.getId(), x -> x));
812
            model.addAttribute("authIdAndAuthUserMap", authIdAndAuthUserMap);
812
            model.addAttribute("authIdAndAuthUserMap", authIdAndAuthUserMap);
813
            model.addAttribute("leads", leads);
813
            model.addAttribute("leads", leads);
814
            model.addAttribute("url", "/getPaginatedClosedLeads");
814
            model.addAttribute("url", "/getPaginatedClosedLeads");
815
 
815
 
-
 
816
            List<Integer> allLeadIds = leads.stream().map(Lead::getId).collect(Collectors.toList());
-
 
817
            Map<Integer, LeadLiveLocation> geoLocationMap = leadLiveLocationRepository.selectByLeadIds(allLeadIds).stream()
-
 
818
                    .collect(Collectors.toMap(LeadLiveLocation::getLeadId, x -> x, (a, b) -> a));
-
 
819
            model.addAttribute("geoLocationMap", geoLocationMap);
816
        } else {
820
        } else {
817
            model.addAttribute("leads", leads);
821
            model.addAttribute("leads", leads);
818
 
-
 
-
 
822
            model.addAttribute("geoLocationMap", new HashMap<>());
819
        }
823
        }
820
        return "lead-close-paginated";
824
        return "lead-close-paginated";
821
    }
825
    }
822
 
826
 
823
    @RequestMapping(value = "/searchLeads")
827
    @RequestMapping(value = "/searchLeads")
Line 891... Line 895...
891
                    authIds.add(lead.getAssignTo());
895
                    authIds.add(lead.getAssignTo());
892
                }
896
                }
893
                Map<Integer, AuthUser> authIdAndAuthUserMap = authRepository.selectByIds(authIds).stream().collect(Collectors.toMap(x -> x.getId(), x -> x));
897
                Map<Integer, AuthUser> authIdAndAuthUserMap = authRepository.selectByIds(authIds).stream().collect(Collectors.toMap(x -> x.getId(), x -> x));
894
                model.addAttribute("authIdAndAuthUserMap", authIdAndAuthUserMap);
898
                model.addAttribute("authIdAndAuthUserMap", authIdAndAuthUserMap);
895
                model.addAttribute("leads", leads);
899
                model.addAttribute("leads", leads);
-
 
900
 
-
 
901
                List<Integer> allLeadIds = leads.stream().map(Lead::getId).collect(Collectors.toList());
-
 
902
                Map<Integer, LeadLiveLocation> geoLocationMap = leadLiveLocationRepository.selectByLeadIds(allLeadIds).stream()
-
 
903
                        .collect(Collectors.toMap(LeadLiveLocation::getLeadId, x -> x, (a, b) -> a));
-
 
904
                model.addAttribute("geoLocationMap", geoLocationMap);
896
            }
905
            }
897
        }
906
        }
-
 
907
        if (!model.containsAttribute("geoLocationMap")) {
-
 
908
            model.addAttribute("geoLocationMap", new HashMap<>());
-
 
909
        }
898
 
910
 
899
        return "lead-close-paginated";
911
        return "lead-close-paginated";
900
 
912
 
901
    }
913
    }
902
 
914
 
Line 911... Line 923...
911
            if (!leads.isEmpty()) {
923
            if (!leads.isEmpty()) {
912
                List<Integer> authIds = leads.stream().map(Lead::getAssignTo).collect(Collectors.toList());
924
                List<Integer> authIds = leads.stream().map(Lead::getAssignTo).collect(Collectors.toList());
913
                Map<Integer, AuthUser> authIdAndAuthUserMap = authRepository.selectByIds(authIds).stream()
925
                Map<Integer, AuthUser> authIdAndAuthUserMap = authRepository.selectByIds(authIds).stream()
914
                        .collect(Collectors.toMap(AuthUser::getId, x -> x));
926
                        .collect(Collectors.toMap(AuthUser::getId, x -> x));
915
                model.addAttribute("authIdAndAuthUserMap", authIdAndAuthUserMap);
927
                model.addAttribute("authIdAndAuthUserMap", authIdAndAuthUserMap);
-
 
928
 
-
 
929
                List<Integer> allLeadIds = leads.stream().map(Lead::getId).collect(Collectors.toList());
-
 
930
                Map<Integer, LeadLiveLocation> geoLocationMap = leadLiveLocationRepository.selectByLeadIds(allLeadIds).stream()
-
 
931
                        .collect(Collectors.toMap(LeadLiveLocation::getLeadId, x -> x, (a, b) -> a));
-
 
932
                model.addAttribute("geoLocationMap", geoLocationMap);
916
            }
933
            }
917
        }
934
        }
-
 
935
        if (!model.containsAttribute("geoLocationMap")) {
-
 
936
            model.addAttribute("geoLocationMap", new HashMap<>());
-
 
937
        }
918
        model.addAttribute("leads", leads);
938
        model.addAttribute("leads", leads);
919
        model.addAttribute("searchTerm", searchTerm);
939
        model.addAttribute("searchTerm", searchTerm);
920
        return "lead-close-paginated";
940
        return "lead-close-paginated";
921
    }
941
    }
922
 
942