| Line 709... |
Line 709... |
| 709 |
webListing.setFofoCatalogResponses(getDealResponses(userInfo, webListing));
|
709 |
webListing.setFofoCatalogResponses(getDealResponses(userInfo, webListing));
|
| 710 |
}
|
710 |
}
|
| 711 |
return responseSender.ok(webListings);
|
711 |
return responseSender.ok(webListings);
|
| 712 |
}
|
712 |
}
|
| 713 |
|
713 |
|
| 714 |
@RequestMapping(value = "/partner/listing", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
- |
|
| 715 |
public ResponseEntity<?> getPartnersListing(HttpServletRequest request) throws Exception {
|
- |
|
| 716 |
List<WebListing> webListings = webListingRepository.selectAllWebListingByType(Optional.of(true),
|
- |
|
| 717 |
WebListingType.partner);
|
- |
|
| 718 |
UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
|
- |
|
| 719 |
for (WebListing webListing : webListings) {
|
- |
|
| 720 |
webListing.setFofoCatalogResponses(getDealResponses(userInfo, webListing));
|
- |
|
| 721 |
}
|
- |
|
| 722 |
return responseSender.ok(webListings);
|
- |
|
| 723 |
}
|
- |
|
| 724 |
|
- |
|
| 725 |
private List<FofoCatalogResponse> getDealResponses(UserInfo userInfo, WebListing webListing)
|
714 |
private List<FofoCatalogResponse> getDealResponses(UserInfo userInfo, WebListing webListing)
|
| 726 |
throws ProfitMandiBusinessException {
|
715 |
throws ProfitMandiBusinessException {
|
| 727 |
List<Integer> webProducts = webProductListingRepository.selectAllByWebListingId(webListing.getId()).stream()
|
716 |
List<Integer> webProducts = webProductListingRepository.selectAllByWebListingId(webListing.getId()).stream()
|
| 728 |
.filter(x -> x.getRank() > 0).map(x -> x.getEntityId()).collect(Collectors.toList());
|
717 |
.filter(x -> x.getRank() > 0).map(x -> x.getEntityId()).collect(Collectors.toList());
|
| 729 |
if (webProducts.size() == 0) {
|
718 |
if (webProducts.size() == 0) {
|