Authored by hugufei

fix bug

@@ -60,6 +60,9 @@ public class UfoProductIndexBuilder extends IIndexBuilder implements Application @@ -60,6 +60,9 @@ public class UfoProductIndexBuilder extends IIndexBuilder implements Application
60 * 增量 60 * 增量
61 */ 61 */
62 public List<UfoProductIndexBO> buildUfoProductIndexBOIncrease(List<Integer> ids) { 62 public List<UfoProductIndexBO> buildUfoProductIndexBOIncrease(List<Integer> ids) {
  63 + if(ids==null || ids.isEmpty()){
  64 + return new ArrayList<>();
  65 + }
63 List<Product> productList = ufoProductMapper.selectByIdList(ids); 66 List<Product> productList = ufoProductMapper.selectByIdList(ids);
64 if (productList == null || productList.isEmpty()) { 67 if (productList == null || productList.isEmpty()) {
65 return new ArrayList<>(); 68 return new ArrayList<>();
@@ -87,10 +87,8 @@ public class UfoCommonBulkService implements ApplicationEventPublisherAware { @@ -87,10 +87,8 @@ public class UfoCommonBulkService implements ApplicationEventPublisherAware {
87 } 87 }
88 88
89 //5、批量更新 89 //5、批量更新
90 - yohoIndexService.bulk(toUpdateDataList);  
91 -  
92 - //6、记录日志  
93 if (CollectionUtils.isNotEmpty(toUpdateDataList)) { 90 if (CollectionUtils.isNotEmpty(toUpdateDataList)) {
  91 + yohoIndexService.bulk(toUpdateDataList);
94 logger.info("doBulk, the blukList size is {} and cost {} ms,", toUpdateDataList.size(), System.currentTimeMillis() - begin); 92 logger.info("doBulk, the blukList size is {} and cost {} ms,", toUpdateDataList.size(), System.currentTimeMillis() - begin);
95 Thread.sleep(100); 93 Thread.sleep(100);
96 } else { 94 } else {
@@ -105,6 +103,9 @@ public class UfoCommonBulkService implements ApplicationEventPublisherAware { @@ -105,6 +103,9 @@ public class UfoCommonBulkService implements ApplicationEventPublisherAware {
105 } 103 }
106 104
107 private Map<Integer, ESBluk> queryBulkDataByIdList(List<Integer> ufoProductIdList) { 105 private Map<Integer, ESBluk> queryBulkDataByIdList(List<Integer> ufoProductIdList) {
  106 + if(ufoProductIdList==null || ufoProductIdList.isEmpty()){
  107 + return new HashMap<>();
  108 + }
108 List<UfoProductIndexBO> ufoProductIndexBOList = ufoProductIndexBuilder.buildUfoProductIndexBOIncrease(ufoProductIdList); 109 List<UfoProductIndexBO> ufoProductIndexBOList = ufoProductIndexBuilder.buildUfoProductIndexBOIncrease(ufoProductIdList);
109 if (ufoProductIndexBOList == null || ufoProductIndexBOList.isEmpty()) { 110 if (ufoProductIndexBOList == null || ufoProductIndexBOList.isEmpty()) {
110 return new HashMap<>(); 111 return new HashMap<>();