...
|
...
|
@@ -6,10 +6,7 @@ import com.yoho.search.consumer.service.logicService.ProductIndexBOToMapService; |
|
|
import com.yoho.search.consumer.service.logicService.cache.BasicDataCacheService;
|
|
|
import com.yoho.search.consumer.service.logicService.ufo.yoho.*;
|
|
|
import com.yoho.search.consumer.service.utils.IdCheckUtils;
|
|
|
import com.yoho.search.dal.UfoGoodsMapper;
|
|
|
import com.yoho.search.dal.UfoProductMapper;
|
|
|
import com.yoho.search.dal.UfoStorageMapper;
|
|
|
import com.yoho.search.dal.UfoStoragePriceMapper;
|
|
|
import com.yoho.search.dal.*;
|
|
|
import com.yoho.search.dal.model.*;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.slf4j.Logger;
|
...
|
...
|
@@ -55,6 +52,8 @@ public class UfoToYohoIndexBuilder extends IIndexBuilder { |
|
|
private UfoStorageMapper ufoStorageMapper;
|
|
|
@Autowired
|
|
|
private UfoStoragePriceMapper ufoStoragePriceMapper;
|
|
|
@Autowired
|
|
|
private UfoScoreProductRuleMapper ufoScoreProductRuleMapper;
|
|
|
|
|
|
@Override
|
|
|
public int getTotalCount() throws Exception {
|
...
|
...
|
@@ -138,6 +137,12 @@ public class UfoToYohoIndexBuilder extends IIndexBuilder { |
|
|
if (CollectionUtils.isNotEmpty(ufoStoragePriceList)) {
|
|
|
ufoStoragePriceMap = ufoStoragePriceList.stream().collect(Collectors.groupingBy(UfoStoragePrice::getProductId));
|
|
|
}
|
|
|
//去查这一批ufo商品的ufo_score_product_rule Set
|
|
|
List<Integer> ufoScoreProductRuleList = ufoScoreProductRuleMapper.selectByIdList(ufoProductIdList);
|
|
|
Set<Integer> ufoScoreProductRuleSet = new HashSet<>();
|
|
|
if (CollectionUtils.isNotEmpty(ufoScoreProductRuleList)) {
|
|
|
ufoScoreProductRuleSet = ufoScoreProductRuleList.stream().collect(Collectors.toSet());
|
|
|
}
|
|
|
|
|
|
for (UfoProduct ufoProduct : ufoProductList) {
|
|
|
//不合法id直接丢掉
|
...
|
...
|
@@ -157,6 +162,8 @@ public class UfoToYohoIndexBuilder extends IIndexBuilder { |
|
|
ufoToYohoSizeService.build(productIndexBO, ufoProduct, ufoSizeMap, yohoSizeNameMap, ufoStorageMap);
|
|
|
//价格
|
|
|
ufoToYohoPriceService.build(productIndexBO, ufoProduct, ufoStoragePriceMap);
|
|
|
//直通车
|
|
|
productIndexBO.setToAddScore(ufoScoreProductRuleSet.contains(ufoProduct.getId()) ? "Y" : "N");
|
|
|
productIndexBOList.add(productIndexBO);
|
|
|
}
|
|
|
return productIndexBOList;
|
...
|
...
|
|