From c763596423c6819ee3b907256314c18fcb21ddf6 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 4 Dec 2021 15:31:11 +0800 Subject: [PATCH 1/3] bugfix --- .../impl/IndexCollDistrictDepartmentServiceImpl.java | 11 ++++++++--- .../impl/FactOriginProjectLogDailyServiceImpl.java | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictDepartmentServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictDepartmentServiceImpl.java index 3ccdfa136f..04ab678c75 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictDepartmentServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictDepartmentServiceImpl.java @@ -118,11 +118,16 @@ public class IndexCollDistrictDepartmentServiceImpl implements IndexCollDistrict if (CollectionUtils.isNotEmpty(handle)) { list.forEach(entity -> handle.stream().filter(dto -> dto.getOrgId().equals(entity.getDeptId())).forEach(item -> { if (item.getCount() != NumConstant.ZERO) { - BigDecimal count = new BigDecimal(item.getCount()); + BigDecimal count = null != item.getCount() && NumConstant.ZERO != item.getCount() ? new BigDecimal(item.getCount()) : BigDecimal.ZERO; BigDecimal sum = new BigDecimal(item.getSum()); BigDecimal one = new BigDecimal(NumConstant.ONE); - entity.setClosedProjectRatio(one.divide(sum.divide(count), NumConstant.SIX, RoundingMode.HALF_UP)); - entity.setClosedProjectRatio(sum.divide(count).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + //entity.setClosedProjectRatio(one.divide(sum.divide(count), NumConstant.SIX, RoundingMode.HALF_UP)); + if (count.compareTo(BigDecimal.ZERO) == 1) { + //如果count>0 + entity.setClosedProjectRatio(sum.divide(count).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } else { + entity.setClosedProjectRatio(BigDecimal.ZERO); + } } })); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java index b0c794e759..9bb920fe54 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java @@ -270,7 +270,7 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl Date: Sat, 4 Dec 2021 16:22:14 +0800 Subject: [PATCH 2/3] =?UTF-8?q?indexorigin/extractall=E5=8A=A0=E4=B8=AA?= =?UTF-8?q?=E9=92=89=E9=92=89=E8=AF=95=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IndexOriginExtractServiceImpl.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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 f6038e0e4e..b1e48c25d5 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 @@ -86,7 +86,9 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService final String monthId = param.getMonthId(); threadPool.submit(() -> { try { + long startCpc = System.currentTimeMillis(); calCpcIndexService.calCpcPartyAbility(customerId, monthId); + log.error("党员相关-党建能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startCpc, param.getCustomerId()); } catch (Exception e) { log.error("抽取【党员相关数据】发生异常,参数:" + JSON.toJSONString(param), e); }finally { @@ -95,35 +97,47 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService }); threadPool.submit(() -> { try { + long startGridGovern = System.currentTimeMillis(); calGridIndexService.calGridIndexGovernAbility(customerId, monthId); + log.error("网格相关-治理能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startGridGovern, param.getCustomerId()); } catch (Exception e) { log.error("抽取【网格治理能力数据】发生异常,参数:" + JSON.toJSONString(param), e); } try { + long startGridParty = System.currentTimeMillis(); calGridIndexService.calGridIndexPartyAbility(customerId, monthId); + log.error("网格相关-党建能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startGridParty, param.getCustomerId()); } catch (Exception e) { log.error("抽取【网格党建能力数据】发生异常,参数:" + JSON.toJSONString(param), e); } try { + long startGridService = System.currentTimeMillis(); calGridIndexService.calGridIndexServiceAbility(customerId, monthId); + log.error("网格相关-服务能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startGridService, param.getCustomerId()); } catch (Exception e) { log.error("抽取【网格服务能力数据】发生异常,参数:" + JSON.toJSONString(param), e); } try{ //dimAgency + long startStreet = System.currentTimeMillis(); indexCollStreetService.saveStreetAbility(customerId, monthId); + log.error("街道相关-三大能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startStreet, param.getCustomerId()); }catch (Exception e){ log.error("抽取【街道治理能力-街道党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e); } try{ //dimAgency + long startCommunity = System.currentTimeMillis(); indexCollCommunityService.saveCommunityAbility(customerId, monthId); + log.error("街道相关-三大能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startCommunity, param.getCustomerId()); }catch (Exception e){ log.error("抽取【社区治理能力-社区党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e); } try{ //dimAgency + long startDistrict = System.currentTimeMillis(); indexCollDistrictService.saveDistrictAbility(customerId, monthId); + log.error("全区相关-三大能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startDistrict, param.getCustomerId()); }catch (Exception e){ log.error("抽取【全区治理能力-全区党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e); } @@ -135,6 +149,6 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService } catch (InterruptedException e) { log.error("indexOriginExtractAll countDownLatch exception", e); } - log.warn("indexOriginExtractAll执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-start, param.getCustomerId()); + log.error("indexOriginExtractAll执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-start, param.getCustomerId()); } } From 5006f00326a1f8d80707e71c7a326cfb638d8ba9 Mon Sep 17 00:00:00 2001 From: jianjun Date: Sat, 4 Dec 2021 17:14:19 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/evaluationindex/screen/impl/IndexServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index 6e102c0366..209e776ee7 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java @@ -440,6 +440,7 @@ public class IndexServiceImpl implements IndexService { indexRank.setOrgType("street"); indexRank.setTotalIndex(getRound(indexRank.getPartyDevAbility() + indexRank.getGovernAbility() + indexRank.getServiceAbility())); }); + streetList.sort(Comparator.comparing(SubAgencyIndexRankResultDTO::getTotalIndex).reversed()); return streetList; } // 网格会根据中央区选择具体某个街道,变化