develop
hanrenchun 9 months ago
parent dcf9829a1d
commit 905581d13d

@ -55,24 +55,24 @@ public class AlarmInfoTask {
Page<JcjJjxxViewMysql> page = new Page<>(1, 200); Page<JcjJjxxViewMysql> page = new Page<>(1, 200);
List<JcjJjxxViewMysql> resultList = jjxxViewMysqlService.page(page, queryWrapper).getRecords(); List<JcjJjxxViewMysql> resultList = jjxxViewMysqlService.page(page, queryWrapper).getRecords();
CountDownLatch latch = new CountDownLatch(resultList.size()); // CountDownLatch latch = new CountDownLatch(resultList.size());
ExecutorService JjxxPool = Executors.newFixedThreadPool(5); // ExecutorService JjxxPool = Executors.newFixedThreadPool(5);
for (JcjJjxxViewMysql bean : resultList) { for (JcjJjxxViewMysql bean : resultList) {
JjxxPool.submit(() -> { // JjxxPool.submit(() -> {
cleanJjxx(bean); cleanJjxx(bean);
logger.info("清洗完成"); logger.info("清洗完成");
latch.countDown(); // latch.countDown();
}); // });
} }
try { // try {
// Wait for all threads to complete // // Wait for all threads to complete
latch.await(); // latch.await();
} catch (InterruptedException e) { // } catch (InterruptedException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
// 关闭线程池 // 关闭线程池
JjxxPool.shutdown(); // JjxxPool.shutdown();
} catch (Exception e) { } catch (Exception e) {
logger.info(StringKit.getTrace(e)); logger.info(StringKit.getTrace(e));
} }

Loading…
Cancel
Save