develop
hanrenchun 7 months ago
parent 2f8c6c77a2
commit ae6c6fe204

@ -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) {

@ -64,14 +64,14 @@ public class JcjJjxxTask {
JjxxTag = true;
int count = countJjxx / oncesCounts;
CountDownLatch latch = new CountDownLatch(count);
ExecutorService JjxxPool = Executors.newFixedThreadPool(50);
// CountDownLatch latch = new CountDownLatch(count);
// ExecutorService JjxxPool = Executors.newFixedThreadPool(50);
for (int i = 0; i <= count; i++) {
Map JjxxMap = new HashMap();
JjxxMap.put("rowStart", i * oncesCounts);
JjxxMap.put("rowEnd", (i + 1) * oncesCounts);
JjxxPool.submit(() -> {
// JjxxPool.submit(() -> {
try {
List<JcjJjxxViewOracle> Jjxxs = jcjJjxxViewOracleService.getJjxxList(JjxxMap);
for (JcjJjxxViewOracle Jjxx : Jjxxs) {
@ -90,19 +90,19 @@ public class JcjJjxxTask {
} catch (Exception e) {
logger.info("Jjxxs:" + StringKit.getTrace(e));
}
latch.countDown();
});
// latch.countDown();
// });
logger.info("JjxxMap数据总量:" + countJjxx + "," + "当前处理下标:" + JjxxMap.get("rowStart") + "/" + JjxxMap.get("rowEnd"));
}
try {
// Wait for all threads to complete
latch.await();
} catch (InterruptedException e) {
e.printStackTrace();
}
// 关闭线程池
JjxxPool.shutdown();
// try {
// // Wait for all threads to complete
// latch.await();
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// // 关闭线程池
// JjxxPool.shutdown();
}
} catch (Exception e) {

Loading…
Cancel
Save