@Test
public void test() throws InterruptedException, ExecutionException {
String resStr = "{\"languageCode\":\"en-US\",\"categoryType\":\"\",\"categoryLevel\":\"\"}";
GoodsPriceSellListDTO condition = JSON.parseObject(resStr, GoodsPriceSellListDTO.class);
ExecutorService executorService = Executors.newFixedThreadPool(5);
int pageSize = 20;
AtomicInteger pageNumber = new AtomicInteger(1);
BlockingQueue<List<GoodsPriceSellListDTO>> queue = new ArrayBlockingQueue<>(1000);
List<GoodsPriceSellListDTO> goodsPriceSellListDTOList = null;
while (true) {
if (null != goodsPriceSellListDTOList) {
goodsPriceSellListDTOList.clear();
}
System.out.println("遍历查询:" + pageNumber.get());
// 线程返回值
Future&
java 多线程分页读取放入队列,多线程写入EasyExcel
最新推荐文章于 2025-04-08 21:58:25 发布