|
@@ -35,10 +35,6 @@ public class StorageSkuIndexToolsService implements ApplicationEventPublisherAwa |
|
@@ -35,10 +35,6 @@ public class StorageSkuIndexToolsService implements ApplicationEventPublisherAwa |
35
|
|
35
|
|
36
|
@Autowired
|
36
|
@Autowired
|
37
|
private IYohoIndexService indexService;
|
37
|
private IYohoIndexService indexService;
|
38
|
-
|
|
|
39
|
- /**
|
|
|
40
|
- * 代码构建storagesku服务 -- amos.shan add on 2016-10-28
|
|
|
41
|
- */
|
|
|
42
|
@Autowired
|
38
|
@Autowired
|
43
|
private StorageSkuLogicService storageSkuLogicService;
|
39
|
private StorageSkuLogicService storageSkuLogicService;
|
44
|
|
40
|
|
|
@@ -60,7 +56,7 @@ public class StorageSkuIndexToolsService implements ApplicationEventPublisherAwa |
|
@@ -60,7 +56,7 @@ public class StorageSkuIndexToolsService implements ApplicationEventPublisherAwa |
60
|
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
|
56
|
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
|
61
|
this.publisher = applicationEventPublisher;
|
57
|
this.publisher = applicationEventPublisher;
|
62
|
}
|
58
|
}
|
63
|
-
|
59
|
+
|
64
|
private ExecutorService executorService = Executors.newSingleThreadExecutor();
|
60
|
private ExecutorService executorService = Executors.newSingleThreadExecutor();
|
65
|
|
61
|
|
66
|
@PostConstruct
|
62
|
@PostConstruct
|
|
@@ -91,21 +87,21 @@ public class StorageSkuIndexToolsService implements ApplicationEventPublisherAwa |
|
@@ -91,21 +87,21 @@ public class StorageSkuIndexToolsService implements ApplicationEventPublisherAwa |
91
|
// 1、根据sku去取数据库对象
|
87
|
// 1、根据sku去取数据库对象
|
92
|
List<Integer> productSkus = this.getElementsFromArrayBlockingQueue(productSkuQueue, 200);
|
88
|
List<Integer> productSkus = this.getElementsFromArrayBlockingQueue(productSkuQueue, 200);
|
93
|
if (!productSkus.isEmpty()) {
|
89
|
if (!productSkus.isEmpty()) {
|
94
|
- storageSkuBOList.addAll(storageSkuLogicService.getStorageSkuIndexBySkus(productSkus));
|
90
|
+ storageSkuBOList.addAll(storageSkuLogicService.getStorageSkuIndexBySkus(productSkus));
|
95
|
logger.info("doBulkUpdateStorageSkuIndex[getListBySku], storageSkuBOList size is [{}], cost [{}]ms", storageSkuBOList.size(), costStatistics.getCost());
|
91
|
logger.info("doBulkUpdateStorageSkuIndex[getListBySku], storageSkuBOList size is [{}], cost [{}]ms", storageSkuBOList.size(), costStatistics.getCost());
|
96
|
}
|
92
|
}
|
97
|
|
93
|
|
98
|
// 2、根据skc去取数据库对象
|
94
|
// 2、根据skc去取数据库对象
|
99
|
List<Integer> goodsIds = this.getElementsFromArrayBlockingQueue(goodsIdQueue, 200);
|
95
|
List<Integer> goodsIds = this.getElementsFromArrayBlockingQueue(goodsIdQueue, 200);
|
100
|
if (!goodsIds.isEmpty()) {
|
96
|
if (!goodsIds.isEmpty()) {
|
101
|
- storageSkuBOList.addAll(storageSkuLogicService.getStorageSkuIndexBySkcs(goodsIds));
|
97
|
+ storageSkuBOList.addAll(storageSkuLogicService.getStorageSkuIndexBySkcs(goodsIds));
|
102
|
logger.info("doBulkUpdateStorageSkuIndex[getListBySkc], storageSkuBOList size is [{}], cost [{}]ms", storageSkuBOList.size(), costStatistics.getCost());
|
98
|
logger.info("doBulkUpdateStorageSkuIndex[getListBySkc], storageSkuBOList size is [{}], cost [{}]ms", storageSkuBOList.size(), costStatistics.getCost());
|
103
|
}
|
99
|
}
|
104
|
|
100
|
|
105
|
// 3、根据skn去取数据库对象
|
101
|
// 3、根据skn去取数据库对象
|
106
|
List<Integer> productIds = this.getElementsFromArrayBlockingQueue(productIdQueue, 200);
|
102
|
List<Integer> productIds = this.getElementsFromArrayBlockingQueue(productIdQueue, 200);
|
107
|
if (!productIds.isEmpty()) {
|
103
|
if (!productIds.isEmpty()) {
|
108
|
- storageSkuBOList.addAll(storageSkuLogicService.getStorageSkuIndexByProductIds(productIds));
|
104
|
+ storageSkuBOList.addAll(storageSkuLogicService.getStorageSkuIndexByProductIds(productIds));
|
109
|
logger.info("doBulkUpdateStorageSkuIndex[getListBySkn], storageSkuBOList size is [{}], cost [{}]ms", storageSkuBOList.size(), costStatistics.getCost());
|
105
|
logger.info("doBulkUpdateStorageSkuIndex[getListBySkn], storageSkuBOList size is [{}], cost [{}]ms", storageSkuBOList.size(), costStatistics.getCost());
|
110
|
}
|
106
|
}
|
111
|
|
107
|
|