1
|
package com.yoho.search.consumer.index.fullbuild.ufo;
|
1
|
package com.yoho.search.consumer.index.fullbuild.ufo;
|
2
|
|
2
|
|
|
|
3
|
+import com.alibaba.fastjson.JSONArray;
|
3
|
import com.yoho.search.consumer.index.fullbuild.IIndexBuilder;
|
4
|
import com.yoho.search.consumer.index.fullbuild.IIndexBuilder;
|
4
|
import com.yoho.search.consumer.service.bo.CutdownPriceInfoBO;
|
5
|
import com.yoho.search.consumer.service.bo.CutdownPriceInfoBO;
|
5
|
import com.yoho.search.consumer.service.bo.ProductIndexBO;
|
6
|
import com.yoho.search.consumer.service.bo.ProductIndexBO;
|
|
|
7
|
+import com.yoho.search.consumer.service.bo.UfoProductPoolBO;
|
6
|
import com.yoho.search.consumer.service.logicService.CutdownPriceLogicService;
|
8
|
import com.yoho.search.consumer.service.logicService.CutdownPriceLogicService;
|
7
|
import com.yoho.search.consumer.service.logicService.ProductIndexBOToMapService;
|
9
|
import com.yoho.search.consumer.service.logicService.ProductIndexBOToMapService;
|
8
|
import com.yoho.search.consumer.service.logicService.cache.BasicDataCacheService;
|
10
|
import com.yoho.search.consumer.service.logicService.cache.BasicDataCacheService;
|
9
|
import com.yoho.search.consumer.service.logicService.cache.UfoBasicDataCacheService;
|
11
|
import com.yoho.search.consumer.service.logicService.cache.UfoBasicDataCacheService;
|
10
|
import com.yoho.search.consumer.service.logicService.tbl.util.StringUtils;
|
12
|
import com.yoho.search.consumer.service.logicService.tbl.util.StringUtils;
|
|
|
13
|
+import com.yoho.search.consumer.service.logicService.ufo.UfoProductPoolDetailFieldBuilder;
|
11
|
import com.yoho.search.consumer.service.logicService.ufo.ufo2yoho.*;
|
14
|
import com.yoho.search.consumer.service.logicService.ufo.ufo2yoho.*;
|
12
|
import com.yoho.search.consumer.service.utils.IdCheckUtils;
|
15
|
import com.yoho.search.consumer.service.utils.IdCheckUtils;
|
13
|
import com.yoho.search.dal.*;
|
16
|
import com.yoho.search.dal.*;
|
|
@@ -69,6 +72,8 @@ public class UfoToYohoIndexBuilder extends IIndexBuilder { |
|
@@ -69,6 +72,8 @@ public class UfoToYohoIndexBuilder extends IIndexBuilder { |
69
|
private BigdataUfoSalesMoneyMapper bigdataUfoSalesMoneyMapper;
|
72
|
private BigdataUfoSalesMoneyMapper bigdataUfoSalesMoneyMapper;
|
70
|
@Autowired
|
73
|
@Autowired
|
71
|
private CutdownPriceLogicService cutdownPriceLogicService;
|
74
|
private CutdownPriceLogicService cutdownPriceLogicService;
|
|
|
75
|
+ @Autowired
|
|
|
76
|
+ private UfoProductPoolDetailFieldBuilder ufoProductPoolDetailFieldBuilder;
|
72
|
|
77
|
|
73
|
@Override
|
78
|
@Override
|
74
|
public int getTotalCount() throws Exception {
|
79
|
public int getTotalCount() throws Exception {
|
|
@@ -165,6 +170,8 @@ public class UfoToYohoIndexBuilder extends IIndexBuilder { |
|
@@ -165,6 +170,8 @@ public class UfoToYohoIndexBuilder extends IIndexBuilder { |
165
|
Map<Integer, BigDecimal> productSevendayMoneyMap = this.queryProductSevendayMoney(ufoProductIdList);
|
170
|
Map<Integer, BigDecimal> productSevendayMoneyMap = this.queryProductSevendayMoney(ufoProductIdList);
|
166
|
//去查这一批ufo商品的砍价购【cutdown_price_product】
|
171
|
//去查这一批ufo商品的砍价购【cutdown_price_product】
|
167
|
Map<Integer, CutdownPriceInfoBO> cutdownPriceInfoBOMap = cutdownPriceLogicService.selectCutdownPriceInfoBOMap(ufoProductIdList);
|
172
|
Map<Integer, CutdownPriceInfoBO> cutdownPriceInfoBOMap = cutdownPriceLogicService.selectCutdownPriceInfoBOMap(ufoProductIdList);
|
|
|
173
|
+ //去查这一批ufo商品的商品池信息【product_pool_detail】
|
|
|
174
|
+ Map<Integer, UfoProductPoolBO> ufoProductPoolBOMap = ufoProductPoolDetailFieldBuilder.buildUfoProductPoolBOMap(ufoProductIdList);
|
168
|
|
175
|
|
169
|
//构造ProductIndexBO
|
176
|
//构造ProductIndexBO
|
170
|
for (Product product : productList) {
|
177
|
for (Product product : productList) {
|
|
@@ -175,7 +182,6 @@ public class UfoToYohoIndexBuilder extends IIndexBuilder { |
|
@@ -175,7 +182,6 @@ public class UfoToYohoIndexBuilder extends IIndexBuilder { |
175
|
// 构建ProductIndexBO并加入结果集
|
182
|
// 构建ProductIndexBO并加入结果集
|
176
|
ProductIndexBO productIndexBO = new ProductIndexBO();
|
183
|
ProductIndexBO productIndexBO = new ProductIndexBO();
|
177
|
productIndexBOList.add(productIndexBO);
|
184
|
productIndexBOList.add(productIndexBO);
|
178
|
-
|
|
|
179
|
// 一般字段
|
185
|
// 一般字段
|
180
|
ufoToYohoGeneralService.build(productIndexBO, product, ufoBrandSeriesMap);
|
186
|
ufoToYohoGeneralService.build(productIndexBO, product, ufoBrandSeriesMap);
|
181
|
// 品牌
|
187
|
// 品牌
|
|
@@ -200,6 +206,15 @@ public class UfoToYohoIndexBuilder extends IIndexBuilder { |
|
@@ -200,6 +206,15 @@ public class UfoToYohoIndexBuilder extends IIndexBuilder { |
200
|
productIndexBO.setCutdownPriceActivityIds(StringUtils.join(cutdownPriceInfoBO.getActivityIds(), ","));
|
206
|
productIndexBO.setCutdownPriceActivityIds(StringUtils.join(cutdownPriceInfoBO.getActivityIds(), ","));
|
201
|
productIndexBO.setCutdownPriceOrder(cutdownPriceInfoBO.getOrder());
|
207
|
productIndexBO.setCutdownPriceOrder(cutdownPriceInfoBO.getOrder());
|
202
|
}
|
208
|
}
|
|
|
209
|
+ //商品池
|
|
|
210
|
+ UfoProductPoolBO ufoProductPoolBO = ufoProductPoolBOMap.get(productIndexBO.getProductSkn());
|
|
|
211
|
+ if (ufoProductPoolBO == null) {
|
|
|
212
|
+ productIndexBO.setPoolIds("");
|
|
|
213
|
+ productIndexBO.setPools(new JSONArray());
|
|
|
214
|
+ } else {
|
|
|
215
|
+ productIndexBO.setPoolIds(ufoProductPoolBO.getPoolIds());
|
|
|
216
|
+ productIndexBO.setPools(ufoProductPoolBO.getPools());
|
|
|
217
|
+ }
|
203
|
}
|
218
|
}
|
204
|
return productIndexBOList;
|
219
|
return productIndexBOList;
|
205
|
} catch (Exception e) {
|
220
|
} catch (Exception e) {
|