| Line 925... |
Line 925... |
| 925 |
|
925 |
|
| 926 |
}
|
926 |
}
|
| 927 |
|
927 |
|
| 928 |
@RequestMapping(value = "/getLeadDetail", method = RequestMethod.GET)
|
928 |
@RequestMapping(value = "/getLeadDetail", method = RequestMethod.GET)
|
| 929 |
public String getLeadDetail(HttpServletRequest request, Model model) throws Exception {
|
929 |
public String getLeadDetail(HttpServletRequest request, Model model) throws Exception {
|
| 930 |
|
- |
|
| - |
|
930 |
List<Integer> followUpleadIds = leadRepository.selectAllByStatus(LeadStatus.followUp).stream()
|
| - |
|
931 |
.map(x -> x.getId()).collect(Collectors.toList());
|
| 931 |
List<LeadDetail> leadDetails = leadDetailRepository.selectAll();
|
932 |
List<LeadDetail> leadDetails = leadDetailRepository.selectByLeadIds(followUpleadIds);
|
| 932 |
|
933 |
|
| 933 |
List<DBObject> mobileBrands = mongoClient.getAllBrandsToDisplay(3);
|
934 |
List<DBObject> mobileBrands = mongoClient.getAllBrandsToDisplay(3);
|
| 934 |
|
935 |
|
| 935 |
List<String> brands = mobileBrands.stream().map(x -> (String) x.get("name")).collect(Collectors.toList());
|
936 |
List<String> brands = mobileBrands.stream().map(x -> (String) x.get("name")).collect(Collectors.toList());
|
| 936 |
|
937 |
|
| Line 940... |
Line 941... |
| 940 |
List<Integer> detailsIds = leadDetails.stream().map(x -> x.getId()).collect(Collectors.toList());
|
941 |
List<Integer> detailsIds = leadDetails.stream().map(x -> x.getId()).collect(Collectors.toList());
|
| 941 |
|
942 |
|
| 942 |
List<Integer> leadIds = leadDetails.stream().map(x -> x.getLeadId()).collect(Collectors.toList());
|
943 |
List<Integer> leadIds = leadDetails.stream().map(x -> x.getLeadId()).collect(Collectors.toList());
|
| 943 |
|
944 |
|
| 944 |
Map<Integer, Lead> leadMap = leadRepository.selectAllByIds(leadIds).stream()
|
945 |
Map<Integer, Lead> leadMap = leadRepository.selectAllByIds(leadIds).stream()
|
| - |
|
946 |
.filter(x -> x.getStatus().equals(LeadStatus.followUp))
|
| 945 |
.collect(Collectors.toMap(x -> x.getId(), x -> x));
|
947 |
.collect(Collectors.toMap(x -> x.getId(), x -> x));
|
| 946 |
|
948 |
|
| 947 |
Map<Integer, Optional<LeadActivity>> leadActivityMap = leadActivityRepository.selectAllByleadIds(leadIds)
|
949 |
Map<Integer, Optional<LeadActivity>> leadActivityMap = leadActivityRepository.selectAllByleadIds(leadIds)
|
| 948 |
.stream().collect(Collectors.groupingBy(x -> x.getLeadId(),
|
950 |
.stream().collect(Collectors.groupingBy(x -> x.getLeadId(),
|
| 949 |
Collectors.maxBy(Comparator.comparing(LeadActivity::getId))));
|
951 |
Collectors.maxBy(Comparator.comparing(LeadActivity::getId))));
|