|
|
package com.yoho.search.consumer.index.fullbuild.ufo;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.yoho.search.consumer.index.fullbuild.IIndexBuilder;
|
|
|
import com.yoho.search.consumer.service.bo.CutdownPriceInfoBO;
|
|
|
import com.yoho.search.consumer.service.bo.ProductIndexBO;
|
|
|
import com.yoho.search.consumer.service.bo.UfoProductPoolBO;
|
|
|
import com.yoho.search.consumer.service.logicService.CutdownPriceLogicService;
|
|
|
import com.yoho.search.consumer.service.logicService.ProductIndexBOToMapService;
|
|
|
import com.yoho.search.consumer.service.logicService.cache.BasicDataCacheService;
|
|
|
import com.yoho.search.consumer.service.logicService.cache.UfoBasicDataCacheService;
|
|
|
import com.yoho.search.consumer.service.logicService.tbl.util.StringUtils;
|
|
|
import com.yoho.search.consumer.service.logicService.ufo.UfoProductPoolDetailFieldBuilder;
|
|
|
import com.yoho.search.consumer.service.logicService.ufo.ufo2yoho.*;
|
|
|
import com.yoho.search.consumer.service.utils.IdCheckUtils;
|
|
|
import com.yoho.search.dal.*;
|
...
|
...
|
@@ -69,6 +72,8 @@ public class UfoToYohoIndexBuilder extends IIndexBuilder { |
|
|
private BigdataUfoSalesMoneyMapper bigdataUfoSalesMoneyMapper;
|
|
|
@Autowired
|
|
|
private CutdownPriceLogicService cutdownPriceLogicService;
|
|
|
@Autowired
|
|
|
private UfoProductPoolDetailFieldBuilder ufoProductPoolDetailFieldBuilder;
|
|
|
|
|
|
@Override
|
|
|
public int getTotalCount() throws Exception {
|
...
|
...
|
@@ -165,6 +170,8 @@ public class UfoToYohoIndexBuilder extends IIndexBuilder { |
|
|
Map<Integer, BigDecimal> productSevendayMoneyMap = this.queryProductSevendayMoney(ufoProductIdList);
|
|
|
//去查这一批ufo商品的砍价购【cutdown_price_product】
|
|
|
Map<Integer, CutdownPriceInfoBO> cutdownPriceInfoBOMap = cutdownPriceLogicService.selectCutdownPriceInfoBOMap(ufoProductIdList);
|
|
|
//去查这一批ufo商品的商品池信息【product_pool_detail】
|
|
|
Map<Integer, UfoProductPoolBO> ufoProductPoolBOMap = ufoProductPoolDetailFieldBuilder.buildUfoProductPoolBOMap(ufoProductIdList);
|
|
|
|
|
|
//构造ProductIndexBO
|
|
|
for (Product product : productList) {
|
...
|
...
|
@@ -175,7 +182,6 @@ public class UfoToYohoIndexBuilder extends IIndexBuilder { |
|
|
// 构建ProductIndexBO并加入结果集
|
|
|
ProductIndexBO productIndexBO = new ProductIndexBO();
|
|
|
productIndexBOList.add(productIndexBO);
|
|
|
|
|
|
// 一般字段
|
|
|
ufoToYohoGeneralService.build(productIndexBO, product, ufoBrandSeriesMap);
|
|
|
// 品牌
|
...
|
...
|
@@ -200,6 +206,15 @@ public class UfoToYohoIndexBuilder extends IIndexBuilder { |
|
|
productIndexBO.setCutdownPriceActivityIds(StringUtils.join(cutdownPriceInfoBO.getActivityIds(), ","));
|
|
|
productIndexBO.setCutdownPriceOrder(cutdownPriceInfoBO.getOrder());
|
|
|
}
|
|
|
//商品池
|
|
|
UfoProductPoolBO ufoProductPoolBO = ufoProductPoolBOMap.get(productIndexBO.getProductSkn());
|
|
|
if (ufoProductPoolBO == null) {
|
|
|
productIndexBO.setPoolIds("");
|
|
|
productIndexBO.setPools(new JSONArray());
|
|
|
} else {
|
|
|
productIndexBO.setPoolIds(ufoProductPoolBO.getPoolIds());
|
|
|
productIndexBO.setPools(ufoProductPoolBO.getPools());
|
|
|
}
|
|
|
}
|
|
|
return productIndexBOList;
|
|
|
} catch (Exception e) {
|
...
|
...
|
|