|
|
|
@ -50,9 +50,9 @@ public class JcjCjxxTask {
|
|
|
|
|
// String value = DeviceCache.get("32092451211328052004");
|
|
|
|
|
// System.out.println();
|
|
|
|
|
|
|
|
|
|
if (cjxxTag) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// if (cjxxTag) {
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
if (!"true".equals(ConfigParam.cjxxSwitch)) {
|
|
|
|
|
return;
|
|
|
|
@ -68,14 +68,14 @@ public class JcjCjxxTask {
|
|
|
|
|
cjxxTag = true;
|
|
|
|
|
|
|
|
|
|
int count = countcjxx / oncesCounts;
|
|
|
|
|
CountDownLatch latch = new CountDownLatch(count);
|
|
|
|
|
ExecutorService cjxxPool = Executors.newFixedThreadPool(50);
|
|
|
|
|
// CountDownLatch latch = new CountDownLatch(count);
|
|
|
|
|
// ExecutorService cjxxPool = Executors.newFixedThreadPool(50);
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i <= count; i++) {
|
|
|
|
|
Map cjxxMap = new HashMap();
|
|
|
|
|
cjxxMap.put("rowStart", i * oncesCounts);
|
|
|
|
|
cjxxMap.put("rowEnd", (i + 1) * oncesCounts);
|
|
|
|
|
cjxxPool.submit(() -> {
|
|
|
|
|
// cjxxPool.submit(() -> {
|
|
|
|
|
try {
|
|
|
|
|
List<JcjCjxxViewOracle> cjxxs = cjxxOracleService.getCjxxList(cjxxMap);
|
|
|
|
|
for (JcjCjxxViewOracle cjxx : cjxxs) {
|
|
|
|
@ -111,19 +111,19 @@ public class JcjCjxxTask {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.info("cjxxs:" + e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
latch.countDown();
|
|
|
|
|
});
|
|
|
|
|
// latch.countDown();
|
|
|
|
|
// });
|
|
|
|
|
logger.info("cjxxMap数据总量:" + countcjxx + "," + "当前处理下标:" + cjxxMap.get("rowStart") + "/" + cjxxMap.get("rowEnd"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
// Wait for all threads to complete
|
|
|
|
|
latch.await();
|
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
// try {
|
|
|
|
|
// // Wait for all threads to complete
|
|
|
|
|
// latch.await();
|
|
|
|
|
// } catch (InterruptedException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// }
|
|
|
|
|
// 关闭线程池
|
|
|
|
|
cjxxPool.shutdown();
|
|
|
|
|
// cjxxPool.shutdown();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|