Authored by hugufei

fix bug

... ... @@ -60,6 +60,9 @@ public class UfoProductIndexBuilder extends IIndexBuilder implements Application
* 增量
*/
public List<UfoProductIndexBO> buildUfoProductIndexBOIncrease(List<Integer> ids) {
if(ids==null || ids.isEmpty()){
return new ArrayList<>();
}
List<Product> productList = ufoProductMapper.selectByIdList(ids);
if (productList == null || productList.isEmpty()) {
return new ArrayList<>();
... ...
... ... @@ -87,10 +87,8 @@ public class UfoCommonBulkService implements ApplicationEventPublisherAware {
}
//5、批量更新
yohoIndexService.bulk(toUpdateDataList);
//6、记录日志
if (CollectionUtils.isNotEmpty(toUpdateDataList)) {
yohoIndexService.bulk(toUpdateDataList);
logger.info("doBulk, the blukList size is {} and cost {} ms,", toUpdateDataList.size(), System.currentTimeMillis() - begin);
Thread.sleep(100);
} else {
... ... @@ -105,6 +103,9 @@ public class UfoCommonBulkService implements ApplicationEventPublisherAware {
}
private Map<Integer, ESBluk> queryBulkDataByIdList(List<Integer> ufoProductIdList) {
if(ufoProductIdList==null || ufoProductIdList.isEmpty()){
return new HashMap<>();
}
List<UfoProductIndexBO> ufoProductIndexBOList = ufoProductIndexBuilder.buildUfoProductIndexBOIncrease(ufoProductIdList);
if (ufoProductIndexBOList == null || ufoProductIndexBOList.isEmpty()) {
return new HashMap<>();
... ...