...
|
...
|
@@ -6,15 +6,17 @@ import com.yoho.search.base.utils.EventReportEnum; |
|
|
import com.yoho.search.base.utils.ISearchConstants;
|
|
|
import com.yoho.search.base.utils.ProductIndexEsField;
|
|
|
import com.yoho.search.consumer.common.CostStatistics;
|
|
|
import com.yoho.search.consumer.index.increment.AbstractStorageRelatedMqListener;
|
|
|
import com.yoho.search.consumer.index.increment.AbstractMqListener;
|
|
|
import com.yoho.search.consumer.service.daoService.GoodsService;
|
|
|
import com.yoho.search.consumer.service.daoService.ProductService;
|
|
|
import com.yoho.search.consumer.service.logicService.StorageRelatedLogicService;
|
|
|
import com.yoho.search.dal.model.Goods;
|
|
|
import com.yoho.search.dal.model.Product;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
...
|
...
|
@@ -24,9 +26,13 @@ import java.util.List; |
|
|
import java.util.Map;
|
|
|
|
|
|
@Component
|
|
|
public class GoodsMqListener extends AbstractStorageRelatedMqListener {
|
|
|
@RabbitListener(queues = "#{'${data_update_channel_goods}'}" )
|
|
|
public class GoodsMqListener extends AbstractMqListener {
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(GoodsMqListener.class);
|
|
|
|
|
|
@Autowired
|
|
|
private StorageRelatedLogicService storageRelatedLogicService;
|
|
|
@Autowired
|
|
|
private GoodsService goodsService;
|
|
|
@Autowired
|
...
|
...
|
@@ -92,10 +98,10 @@ public class GoodsMqListener extends AbstractStorageRelatedMqListener { |
|
|
CostStatistics costStatistics = new CostStatistics();
|
|
|
Map<String, Object> indexData = new HashMap<String, Object>();
|
|
|
// 第一步:获取goodsList,组装goods数据
|
|
|
this.fillColor(indexData, productId);
|
|
|
storageRelatedLogicService.fillColor(indexData, productId);
|
|
|
logger.info("[func=updateProductIndex][step2(1/4)fillColor][productId={}][cost={}]", productId, costStatistics.getCost());
|
|
|
// 第二步、组装库存数据
|
|
|
this.fillStorageNumAndSizeInfo(productId, indexData);
|
|
|
storageRelatedLogicService.fillStorageNumAndSizeInfo(productId, indexData);
|
|
|
logger.info("[func=updateProductIndex][step2(2/4)fillStorageNumAndSizeInfo][productId={}][cost={}]", productId, costStatistics.getCost());
|
|
|
// 第三步,判断skn状态
|
|
|
this.checkSknStatus(productId, indexData);
|
...
|
...
|
|