master:搜索框内广告商品 返回值加上档口名称;

pull/1121/head
liujiang 2025-10-08 21:46:44 +08:00
parent c467ea2eb3
commit 7bcaff71d6
3 changed files with 10 additions and 0 deletions

View File

@ -19,6 +19,8 @@ public class PCIndexSearchRecommendProdVO {
private Long storeProdId;
@ApiModelProperty(value = "档口ID")
private Long storeId;
@ApiModelProperty(value = "档口名称")
private String storeName;
@ApiModelProperty(value = "商品货号")
private String prodArtNum;
@ApiModelProperty(value = "排序")

View File

@ -19,6 +19,8 @@ public class PCIndexSearchRecommendProdDTO {
private Long storeProdId;
@ApiModelProperty(value = "档口ID")
private Long storeId;
@ApiModelProperty(value = "档口名称")
private String storeName;
@ApiModelProperty(value = "商品货号")
private String prodArtNum;
@ApiModelProperty(value = "排序")

View File

@ -965,6 +965,10 @@ public class WebsitePCServiceImpl implements IWebsitePCService {
if (CollectionUtils.isEmpty(oneMonthList)) {
return new ArrayList<>();
}
List<Store> storeList = this.storeMapper.selectList(new LambdaQueryWrapper<Store>().eq(Store::getDelFlag, Constants.UNDELETED)
.in(Store::getId, oneMonthList.stream().map(AdvertRound::getStoreId).collect(Collectors.toList())));
Map<Long, Store> storeMap = CollectionUtils.isEmpty(storeList) ? new HashMap<>()
: storeList.stream().collect(Collectors.toMap(Store::getId, Function.identity()));
final List<Long> storeProdIdList = oneMonthList.stream()
.filter(x -> StringUtils.isNotBlank(x.getProdIdStr())).map(x -> Long.parseLong(x.getProdIdStr())).distinct().collect(Collectors.toList());
// 档口商品的价格及商品主图map
@ -984,6 +988,7 @@ public class WebsitePCServiceImpl implements IWebsitePCService {
AdvertRound advertRound = list.get(0);
final Long storeProdId = Long.parseLong(advertRound.getProdIdStr());
tempList.add(new PCIndexSearchRecommendProdDTO().setDisplayType(AdDisplayType.PRODUCT.getValue()).setStoreProdId(storeProdId).setStoreId(advertRound.getStoreId())
.setStoreName(storeMap.containsKey(advertRound.getStoreId()) ? storeMap.get(advertRound.getStoreId()).getStoreName() : "")
.setProdArtNum(ObjectUtils.isNotEmpty(prodPriceAndMainPicMap.get(storeProdId)) ? prodPriceAndMainPicMap.get(storeProdId).getProdArtNum() : "")
.setMainPicUrl(ObjectUtils.isNotEmpty(prodPriceAndMainPicMap.get(storeProdId)) ? prodPriceAndMainPicMap.get(storeProdId).getMainPicUrl() : ""));
});
@ -996,6 +1001,7 @@ public class WebsitePCServiceImpl implements IWebsitePCService {
final Long storeProdId = Long.parseLong(advertRound.getProdIdStr());
return new PCIndexSearchRecommendProdDTO().setDisplayType(AdDisplayType.PRODUCT.getValue()).setStoreProdId(storeProdId)
.setOrderNum(this.positionToNumber(advertRound.getPosition())).setStoreId(advertRound.getStoreId())
.setStoreName(storeMap.containsKey(advertRound.getStoreId()) ? storeMap.get(advertRound.getStoreId()).getStoreName() : "")
.setProdArtNum(ObjectUtils.isNotEmpty(prodPriceAndMainPicMap.get(storeProdId)) ? prodPriceAndMainPicMap.get(storeProdId).getProdArtNum() : "")
.setMainPicUrl(ObjectUtils.isNotEmpty(prodPriceAndMainPicMap.get(storeProdId)) ? prodPriceAndMainPicMap.get(storeProdId).getMainPicUrl() : "");
}).collect(Collectors.toList());