Commit 17ae467d by 涂亚平

回家同步

1 parent 101a8dab
......@@ -103,36 +103,36 @@ public class MoniMajorServiceImpl extends ServiceImpl<MoniMajorMapper, MoniMajor
List<OutPutVO> outPuts = simulationSeekerDTO.getOutPuts();
// 定义线程池的大小,根据你的需要来设置
// ExecutorService executor = Executors.newFixedThreadPool(outPuts.size());
ExecutorService executor = Executors.newFixedThreadPool(outPuts.size());
// 用于存放Future对象的列表,Future对象可以用来检查任务是否完成
// List<Future<?>> futures = new ArrayList<>();
List<Future<?>> futures = new ArrayList<>();
for (OutPutVO outPutVO : outPuts) {
// Future<?> future = executor.submit(new Callable() {
// @Override
// public Object call() throws Exception {
Future<?> future = executor.submit(new Callable() {
@Override
public Object call() throws Exception {
// 这里执行你的任务
dataProcess(outPutVO);
// return null;
// }
// });
return null;
}
});
// 将Future对象添加到列表中
// futures.add(future);
futures.add(future);
}
// 关闭ExecutorService,不再接受新任务
// executor.shutdown();
// // 等待所有任务完成
// for (Future<?> future : futures) {
// try {
// // get方法会阻塞直到任务完成
// future.get();
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
executor.shutdown();
// 等待所有任务完成
for (Future<?> future : futures) {
try {
// get方法会阻塞直到任务完成
future.get();
} catch (Exception e) {
e.printStackTrace();
}
}
//
// Collections.shuffle(data);
// ExcelUtil.writeMapExcel(excelFieldVOS, data);
......
......@@ -56,7 +56,6 @@
LEFT JOIN moni_company t2 ON t.job_type = t2.job_major
WHERE
t.major_type = #{majorType}
limit 700000
</select>
</mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!