| Line 730... |
Line 730... |
| 730 |
@RequestMapping(value = "/getAuthUserPartners", method = RequestMethod.GET)
|
730 |
@RequestMapping(value = "/getAuthUserPartners", method = RequestMethod.GET)
|
| 731 |
public String AuthUserPartnersDetail(HttpServletRequest request, Model model, @RequestParam int authId)
|
731 |
public String AuthUserPartnersDetail(HttpServletRequest request, Model model, @RequestParam int authId)
|
| 732 |
throws Exception {
|
732 |
throws Exception {
|
| 733 |
|
733 |
|
| 734 |
Map<Integer, List<Integer>> pp = csService.getAuthUserIdPartnerIdMapping();
|
734 |
Map<Integer, List<Integer>> pp = csService.getAuthUserIdPartnerIdMapping();
|
| 735 |
Map<Integer, CustomRetailer> fofoIdAndPartnerMap = null;
|
735 |
Map<Integer, CustomRetailer> fofoIdAndPartnerMap = retailerService.getFofoRetailers();
|
| 736 |
|
736 |
|
| 737 |
Map<Integer, PartnerDetailModel> fofoIdAndallValues = partnerStatsService.getAllPartnerStats();
|
737 |
Map<Integer, PartnerDetailModel> fofoIdAndallValues = partnerStatsService.getAllPartnerStats();
|
| 738 |
if (authId != 0) {
|
738 |
if (authId != 0) {
|
| 739 |
List<Integer> fofoIds = pp.get(authId);
|
739 |
List<Integer> fofoIds = pp.get(authId);
|
| 740 |
fofoIdAndallValues = fofoIdAndallValues.entrySet().stream().filter(x -> fofoIds.contains(x.getKey()))
|
740 |
fofoIdAndallValues = fofoIdAndallValues.entrySet().stream().filter(x -> fofoIds.contains(x.getKey()))
|
| 741 |
.collect(Collectors.toMap(x -> x.getKey(), x -> x.getValue()));
|
741 |
.collect(Collectors.toMap(x -> x.getKey(), x -> x.getValue()));
|
| 742 |
fofoIdAndPartnerMap = retailerService.getFofoRetailers(fofoIds);
|
- |
|
| 743 |
} else {
|
742 |
} else {
|
| 744 |
fofoIdAndPartnerMap = retailerService.getFofoRetailers();
|
- |
|
| 745 |
}
|
743 |
}
|
| 746 |
|
744 |
|
| 747 |
|
745 |
|
| 748 |
model.addAttribute("fofoIdAndallValues", fofoIdAndallValues);
|
746 |
model.addAttribute("fofoIdAndallValues", fofoIdAndallValues);
|
| 749 |
model.addAttribute("fofoIdAndPartnerMap", fofoIdAndPartnerMap);
|
747 |
model.addAttribute("fofoIdAndPartnerMap", fofoIdAndPartnerMap);
|