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