|
@@ -31,12 +31,13 @@ public class TReportYlrqServiceImpl implements ITReportYlrqService {
|
|
List<Long> longs = this.tReportYlrqMapper.queryNeedInsertIds();
|
|
List<Long> longs = this.tReportYlrqMapper.queryNeedInsertIds();
|
|
if (longs.size() > 0) {
|
|
if (longs.size() > 0) {
|
|
List<TSpecdevYlrq> tSpecdevYlrqs = this.tSpecdevYlrqMapper.selectTSpecdevYlrqByIds(longs);
|
|
List<TSpecdevYlrq> tSpecdevYlrqs = this.tSpecdevYlrqMapper.selectTSpecdevYlrqByIds(longs);
|
|
- ExecutorService executorService = Executors.newCachedThreadPool();
|
|
|
|
|
|
+ ExecutorService executorService = Executors.newFixedThreadPool(100);
|
|
for (TSpecdevYlrq specdevYlrq : tSpecdevYlrqs) {
|
|
for (TSpecdevYlrq specdevYlrq : tSpecdevYlrqs) {
|
|
executorService.execute(()->{
|
|
executorService.execute(()->{
|
|
this.tReportYlrqMapper.insertByTSpecdevYlrq(specdevYlrq);
|
|
this.tReportYlrqMapper.insertByTSpecdevYlrq(specdevYlrq);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ executorService.shutdown();
|
|
}
|
|
}
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
@@ -46,12 +47,13 @@ public class TReportYlrqServiceImpl implements ITReportYlrqService {
|
|
List<Long> longs = this.tReportYlrqMapper.queryNeedUpdateIds();
|
|
List<Long> longs = this.tReportYlrqMapper.queryNeedUpdateIds();
|
|
if (longs.size() > 0) {
|
|
if (longs.size() > 0) {
|
|
List<TSpecdevYlrq> tSpecdevYlrqs = this.tSpecdevYlrqMapper.selectTSpecdevYlrqByIds(longs);
|
|
List<TSpecdevYlrq> tSpecdevYlrqs = this.tSpecdevYlrqMapper.selectTSpecdevYlrqByIds(longs);
|
|
- ExecutorService executorService = Executors.newCachedThreadPool();
|
|
|
|
|
|
+ ExecutorService executorService = Executors.newFixedThreadPool(100);
|
|
for (TSpecdevYlrq tSpecdevYlrq : tSpecdevYlrqs) {
|
|
for (TSpecdevYlrq tSpecdevYlrq : tSpecdevYlrqs) {
|
|
executorService.execute(()->{
|
|
executorService.execute(()->{
|
|
this.tReportYlrqMapper.updateByTSpecdevYlrq(tSpecdevYlrq);
|
|
this.tReportYlrqMapper.updateByTSpecdevYlrq(tSpecdevYlrq);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ executorService.shutdown();
|
|
}
|
|
}
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|