Authored by wangnan9279

是否是视频商品标志位

... ... @@ -105,9 +105,11 @@ public class GoodsImagesMqListener extends AbstractMqListener {
logger.info("[func=getProductGoodsByProductId][productId={}][cost={}ms]", productId, costStatistics.getCost());
// 2、更新图片的时候检查下是否存在视频
String specialSearchFieldVideo = "";
String isVideo = "N";
Set<Integer> hasVideosProductIds = videosBuilder.queryHasVideosProductIds(Arrays.asList(productId));
if (hasVideosProductIds.contains(productId)) {
specialSearchFieldVideo = specialSearchFieldLogicService.getSpecialSearchFieldVideo(true);
isVideo = "Y";
}
// 3、更新商品索引
Map<String, Object> indexData = new HashMap<String, Object>();
... ... @@ -115,6 +117,7 @@ public class GoodsImagesMqListener extends AbstractMqListener {
indexData.put(ProductIndexEsField.defaultImages, defaultImageUrl);
indexData.put(ProductIndexEsField.goodsList, goodInfoList);
indexData.put(ProductIndexEsField.specialSearchFieldVideo, specialSearchFieldVideo);
indexData.put(ProductIndexEsField.isVideo, isVideo);
indexData.put(ProductIndexEsField.cover_1, productGoodsBO.getCover_1());
indexData.put(ProductIndexEsField.cover_2, productGoodsBO.getCover_2());
this.updateProductIndexWithDataMap(indexData, productId);
... ...
... ... @@ -722,6 +722,9 @@
},
"isZeroHelp": {
"type": "keyword"
},
"isVideo": {
"type": "keyword"
}
}
}
... ...
... ... @@ -116,6 +116,7 @@ public class ProductIndexBO extends ProductIBO implements Serializable {
// from videos
private String specialSearchFieldVideo;
private String isVideo;
// from product_heat_values
private BigDecimal heatValue;
... ... @@ -168,6 +169,14 @@ public class ProductIndexBO extends ProductIBO implements Serializable {
//from in_storage_time
private Integer inStorageTime;
public String getIsVideo() {
return isVideo;
}
public void setIsVideo(String isVideo) {
this.isVideo = isVideo;
}
public String getIsCollage() {
return isCollage;
}
... ... @@ -176,8 +185,6 @@ public class ProductIndexBO extends ProductIBO implements Serializable {
this.isCollage = isCollage;
}
public String getUfoProductCode() {
return ufoProductCode;
}
... ...
... ... @@ -9,7 +9,6 @@ import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import retrofit2.http.HEAD;
import java.util.HashMap;
import java.util.Map;
... ... @@ -234,6 +233,7 @@ public class ProductIndexBOToMapService {
map.put(ProductIndexEsField.cutdownPriceOrder, productIndexBO.getCutdownPriceOrder());
map.put(ProductIndexEsField.pools, productIndexBO.getPools());
map.put(ProductIndexEsField.isZeroHelp, productIndexBO.getIsZeroHelp());
map.put(ProductIndexEsField.isVideo, productIndexBO.getIsVideo());
return map;
}
... ...
... ... @@ -36,6 +36,7 @@ public class VideosBuilder implements IndexFieldBuilder {
boolean hasVideo = productIdSet.contains(pi.getProductId());
String specialSearchFieldVideo = specialSearchFieldLogicService.getSpecialSearchFieldVideo(hasVideo);
pi.setSpecialSearchFieldVideo(specialSearchFieldVideo);
pi.setIsVideo(hasVideo ? "Y" : "N");
}
}
... ... @@ -45,7 +46,7 @@ public class VideosBuilder implements IndexFieldBuilder {
if (CollectionUtils.isEmpty(goodsImagesList)) {
return productIdSet;
}
List<Integer> videosIds = goodsImagesList.stream().filter(a-> a.getVedioUrlId()!=null).map(GoodsImages::getVedioUrlId).collect(Collectors.toList());
List<Integer> videosIds = goodsImagesList.stream().filter(a -> a.getVedioUrlId() != null).map(GoodsImages::getVedioUrlId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(videosIds)) {
return productIdSet;
}
... ...