Authored by hugufei

formatter

... ... @@ -47,9 +47,6 @@ public class StorageSkuIndexService implements ApplicationEventPublisherAware {
@Autowired
private IStorageSkuService storageSkuServiceImpl;
// @Autowired
// private Product15DaySalesNumService product15DaySalesNumService;
// 按Sku更新库存
private ArrayBlockingQueue<Integer> productSkuQueue = new ArrayBlockingQueue<Integer>(200);
... ... @@ -100,11 +97,9 @@ public class StorageSkuIndexService implements ApplicationEventPublisherAware {
List<Integer> productSkus = this.getElementsFromArrayBlockingQueue(productSkuQueue, 200);
if (!productSkus.isEmpty()) {
if (ISearchConstans.BUILD_STORAGESKUINDEX_USE_CODE) {
storageSkuList.addAll(storageSkuServiceImpl
.getStorageSkuIndexBySkus(productSkus));
storageSkuList.addAll(storageSkuServiceImpl.getStorageSkuIndexBySkus(productSkus));
} else {
storageSkuList.addAll(storageSkuService
.selectListProductSkus(productSkus));
storageSkuList.addAll(storageSkuService.selectListProductSkus(productSkus));
}
logger.info("doBulkUpdateStorageSkuIndex[getListBySku], storageSkuList size is [{}], cost [{}]ms", storageSkuList.size(), costStatistics.getCost());
}
... ... @@ -113,11 +108,9 @@ public class StorageSkuIndexService implements ApplicationEventPublisherAware {
List<Integer> goodsIds = this.getElementsFromArrayBlockingQueue(goodsIdQueue, 200);
if (!goodsIds.isEmpty()) {
if (ISearchConstans.BUILD_STORAGESKUINDEX_USE_CODE) {
storageSkuList.addAll(storageSkuServiceImpl
.getStorageSkuIndexBySkcs(goodsIds));
storageSkuList.addAll(storageSkuServiceImpl.getStorageSkuIndexBySkcs(goodsIds));
} else {
storageSkuList.addAll(storageSkuService
.selectListByGoodsIds(goodsIds));
storageSkuList.addAll(storageSkuService.selectListByGoodsIds(goodsIds));
}
logger.info("doBulkUpdateStorageSkuIndex[getListBySkc], storageSkuList size is [{}], cost [{}]ms", storageSkuList.size(), costStatistics.getCost());
}
... ... @@ -126,11 +119,9 @@ public class StorageSkuIndexService implements ApplicationEventPublisherAware {
List<Integer> productIds = this.getElementsFromArrayBlockingQueue(productIdQueue, 200);
if (!productIds.isEmpty()) {
if (ISearchConstans.BUILD_STORAGESKUINDEX_USE_CODE) {
storageSkuList.addAll(storageSkuServiceImpl
.getStorageSkuIndexBySkns(productIds));
storageSkuList.addAll(storageSkuServiceImpl.getStorageSkuIndexBySkns(productIds));
} else {
storageSkuList.addAll(storageSkuService
.selectListByProductIds(productIds));
storageSkuList.addAll(storageSkuService.selectListByProductIds(productIds));
}
logger.info("doBulkUpdateStorageSkuIndex[getListBySkn], storageSkuList size is [{}], cost [{}]ms", storageSkuList.size(), costStatistics.getCost());
}
... ... @@ -254,7 +245,7 @@ public class StorageSkuIndexService implements ApplicationEventPublisherAware {
}
List<ESBluk> results = new ArrayList<ESBluk>();
for (StorageSku storageSku : storageSkuList) {
//特殊处理storageSku的某些字段
// 特殊处理storageSku的某些字段
SpecialDealForIndex.specialDealStorageSku(storageSku);
results.add(new ESBluk(JSONObject.toJSONString(this.beanToMap(storageSku)), storageSku.getProductSku().toString(), indexName, indexName, false));
}
... ...