Commit fbab9492 by 刘宇峰

同步商品

1 parent 4fedff32
......@@ -205,11 +205,11 @@ public class GoodsService implements InitializingBean {
Integer totalCount = totalListResponse.getTotalCount();
Integer totalPage = totalListResponse.getTotalPage();
log.info("商品数据{}条,{}页", totalCount, totalPage);
Integer syncCnt = 0;
if (CollectionUtils.isNotEmpty(totalListResponse.getGoodsSkuList())) {
List<String> goodsSkuCodeList = totalListResponse.getGoodsSkuList().stream().map(GoodsSkuListItem::getGoodsSkuCode).collect(Collectors.toList());
//同步第一页
Integer syncCnt = syncGoodsInfoData(goodsSkuCodeList, false);
syncCnt = syncGoodsInfoData(goodsSkuCodeList, false);
for (int i = 2; i <= totalPage; i++) {
QueryGoodsListResponse goodsListPageResponse = cloudCraneService.queryGoodsList(new QueryGoodsListRequest(i, totalListResponse.getPageSize()));
......@@ -219,9 +219,9 @@ public class GoodsService implements InitializingBean {
log.info("开始同步{}页商品数据", i);
syncCnt += syncGoodsInfoData(goodsSkuCodeList, false);
}
return syncCnt;
}
return 0;
log.info("同步全部商品数据完成,同步商品数量:{}", syncCnt);
return syncCnt;
}
/**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!