本文主要是介绍分批处理,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
//以开业店铺切片分组取值(按现有索引效率最快)List<String> allBusinessStores = userInfoManager.getAllBusinessStores();if (!CollectionUtils.isEmpty(allBusinessStores)) {Iterable<List<String>> subSets = Iterables.partition(allBusinessStores, 100);List bar = new ArrayList();subSets.forEach(o->{bar.addAll(getExportSaleSkubyPip(o, query, DataOSShopIPRequireDTOS));});finalList= bar;}
if (StringUtils.isNotEmpty(skuQuery.getShopNo())) {List<String> shopNos = Arrays.asList(skuQuery.getShopNo().split(","));skuQuery.setShopNo(null);skuQuery.setShopNoList(shopNos);int pageSize = 500;int currentPage = 1;List<IcShopSkuInventoryDTO> query;skuQuery.setPageSize(pageSize);do {skuQuery.setCurrentPage(currentPage);query = icShopSkuInventoryDAO.querySkuInventory(skuQuery);returnList.addAll(query);currentPage++;} while ((!org.springframework.util.CollectionUtils.isEmpty(query)) && query.size() == pageSize);}
这篇关于分批处理的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!