diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java index b21eee911b..f6038e0e4e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java @@ -80,6 +80,8 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService private void submitJob(ExtractIndexFormDTO param) { + CountDownLatch countDownLatch = new CountDownLatch(2); + long start = System.currentTimeMillis(); final String customerId = param.getCustomerId(); final String monthId = param.getMonthId(); threadPool.submit(() -> { @@ -87,6 +89,8 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService calCpcIndexService.calCpcPartyAbility(customerId, monthId); } catch (Exception e) { log.error("抽取【党员相关数据】发生异常,参数:" + JSON.toJSONString(param), e); + }finally { + countDownLatch.countDown(); } }); threadPool.submit(() -> { @@ -123,6 +127,14 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService }catch (Exception e){ log.error("抽取【全区治理能力-全区党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e); } + countDownLatch.countDown(); }); + + try { + countDownLatch.await(); + } catch (InterruptedException e) { + log.error("indexOriginExtractAll countDownLatch exception", e); + } + log.warn("indexOriginExtractAll执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-start, param.getCustomerId()); } }