|
|
@ -64,14 +64,14 @@ public class TjksbglTask {
|
|
|
|
jksbTag = true;
|
|
|
|
jksbTag = true;
|
|
|
|
|
|
|
|
|
|
|
|
int count = countjksb / oncesCounts;
|
|
|
|
int count = countjksb / oncesCounts;
|
|
|
|
CountDownLatch latch = new CountDownLatch(count);
|
|
|
|
// CountDownLatch latch = new CountDownLatch(count);
|
|
|
|
ExecutorService jksbPool = Executors.newFixedThreadPool(50);
|
|
|
|
// ExecutorService jksbPool = Executors.newFixedThreadPool(50);
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i <= count; i++) {
|
|
|
|
for (int i = 0; i <= count; i++) {
|
|
|
|
Map jksbMap = new HashMap();
|
|
|
|
Map jksbMap = new HashMap();
|
|
|
|
jksbMap.put("rowStart", i * oncesCounts);
|
|
|
|
jksbMap.put("rowStart", i * oncesCounts);
|
|
|
|
jksbMap.put("rowEnd", (i + 1) * oncesCounts);
|
|
|
|
jksbMap.put("rowEnd", (i + 1) * oncesCounts);
|
|
|
|
jksbPool.submit(() -> {
|
|
|
|
// jksbPool.submit(() -> {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
List<TJksbglOracle> jksbs = jksbOracleService.getJKsbList(jksbMap);
|
|
|
|
List<TJksbglOracle> jksbs = jksbOracleService.getJKsbList(jksbMap);
|
|
|
|
for (TJksbglOracle jksb : jksbs) {
|
|
|
|
for (TJksbglOracle jksb : jksbs) {
|
|
|
@ -90,19 +90,19 @@ public class TjksbglTask {
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
logger.info("jksbs:" + StringKit.getTrace(e));
|
|
|
|
logger.info("jksbs:" + StringKit.getTrace(e));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
latch.countDown();
|
|
|
|
// latch.countDown();
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
logger.info("jksbMap数据总量:" + countjksb + "," + "当前处理下标:" + jksbMap.get("rowStart") + "/" + jksbMap.get("rowEnd"));
|
|
|
|
logger.info("jksbMap数据总量:" + countjksb + "," + "当前处理下标:" + jksbMap.get("rowStart") + "/" + jksbMap.get("rowEnd"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
// 关闭线程池
|
|
|
|
// 关闭线程池
|
|
|
|
jksbPool.shutdown();
|
|
|
|
// jksbPool.shutdown();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|