Authored by hugufei

StorageSkuLogicService 增加 @Autowried

... ... @@ -57,9 +57,9 @@ public class ProductMqListener extends AbstractMqListener implements ChannelAwar
private ProductPriceService productPriceService;
@Autowired
private ProductIndexLogicService productIndexLogicService;
@Autowired
private StorageSkuLogicService storageSkuLogicService;
static PerformanceMonitor updateProductIToEsMonitor = new PerformanceMonitor("UpdateProductIToEs");
@Override
... ...
... ... @@ -35,10 +35,6 @@ public class StorageSkuIndexToolsService implements ApplicationEventPublisherAwa
@Autowired
private IYohoIndexService indexService;
/**
* 代码构建storagesku服务 -- amos.shan add on 2016-10-28
*/
@Autowired
private StorageSkuLogicService storageSkuLogicService;
... ... @@ -60,7 +56,7 @@ public class StorageSkuIndexToolsService implements ApplicationEventPublisherAwa
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
this.publisher = applicationEventPublisher;
}
private ExecutorService executorService = Executors.newSingleThreadExecutor();
@PostConstruct
... ... @@ -91,21 +87,21 @@ public class StorageSkuIndexToolsService implements ApplicationEventPublisherAwa
// 1、根据sku去取数据库对象
List<Integer> productSkus = this.getElementsFromArrayBlockingQueue(productSkuQueue, 200);
if (!productSkus.isEmpty()) {
storageSkuBOList.addAll(storageSkuLogicService.getStorageSkuIndexBySkus(productSkus));
storageSkuBOList.addAll(storageSkuLogicService.getStorageSkuIndexBySkus(productSkus));
logger.info("doBulkUpdateStorageSkuIndex[getListBySku], storageSkuBOList size is [{}], cost [{}]ms", storageSkuBOList.size(), costStatistics.getCost());
}
// 2、根据skc去取数据库对象
List<Integer> goodsIds = this.getElementsFromArrayBlockingQueue(goodsIdQueue, 200);
if (!goodsIds.isEmpty()) {
storageSkuBOList.addAll(storageSkuLogicService.getStorageSkuIndexBySkcs(goodsIds));
storageSkuBOList.addAll(storageSkuLogicService.getStorageSkuIndexBySkcs(goodsIds));
logger.info("doBulkUpdateStorageSkuIndex[getListBySkc], storageSkuBOList size is [{}], cost [{}]ms", storageSkuBOList.size(), costStatistics.getCost());
}
// 3、根据skn去取数据库对象
List<Integer> productIds = this.getElementsFromArrayBlockingQueue(productIdQueue, 200);
if (!productIds.isEmpty()) {
storageSkuBOList.addAll(storageSkuLogicService.getStorageSkuIndexByProductIds(productIds));
storageSkuBOList.addAll(storageSkuLogicService.getStorageSkuIndexByProductIds(productIds));
logger.info("doBulkUpdateStorageSkuIndex[getListBySkn], storageSkuBOList size is [{}], cost [{}]ms", storageSkuBOList.size(), costStatistics.getCost());
}
... ...