From 251648da70bea240ae7cb5dd3e7c65617dc162eb Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 1 Jul 2021 15:41:31 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E9=83=BD=E5=B7=B2=E7=BB=8F=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/db/migration/V0.0.20__add_satisfaction_score.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.20__add_satisfaction_score.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.20__add_satisfaction_score.sql index cfc365f038..5daf6faa5a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.20__add_satisfaction_score.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.20__add_satisfaction_score.sql @@ -1,5 +1,5 @@ -- epmet_evaluation_index库执行以下sql: 增加群众不满得分 -alter table screen_project_data add COLUMN `SATISFACTION_SCORE` decimal(10,6) DEFAULT NULL COMMENT '满意度得分' AFTER LATITUDE; +alter table `epmet_evaluation_index`.screen_project_data add COLUMN `SATISFACTION_SCORE` decimal(10,6) DEFAULT NULL COMMENT '满意度得分' AFTER LATITUDE; ALTER TABLE `epmet_evaluation_index`.`screen_govern_rank_data_daily` ADD COLUMN `RESPONSE_COUNT` int(11) NULL COMMENT '响应次数' AFTER `RESPONSE_RATIO`, From 8407fe1cc0011876b6407714bdce7553222c57e4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 1 Jul 2021 16:36:01 +0800 Subject: [PATCH 2/4] temp --- .../com/epmet/controller/IndexCalculateController.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java index 9f2a4b06cd..8471300c71 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -147,7 +147,12 @@ public class IndexCalculateController { long start = System.currentTimeMillis(); Boolean aBoolean = indexCalculateService.indexCalculate(formDTO); if (aBoolean) { - log.error("客户Id:{},monthId:{},全部指标计算完成,结果:{},总耗时:{}秒", formDTO.getCustomerId(), formDTO.getMonthId(), aBoolean, (System.currentTimeMillis() - start) / 1000); + log.error("客户Id:{},monthId:{},全部指标计算完成,结果:{},总耗时:{}秒,customerAreaCode:{}", + formDTO.getCustomerId(), + formDTO.getMonthId(), + aBoolean, + (System.currentTimeMillis() - start) / 1000, + formDTO.getCustomerAreaCode()); } redisUtils.delete(RedisKeys.getCustomerStatsCalFlag(formDTO.getCustomerId())); From 7771142c70d72d2cc37f2ed58ecd9bd49d68d3e8 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 1 Jul 2021 16:44:49 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datastats/impl/DataStatsServiceImpl.java | 77 ++++++++++--------- 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 9c9e8b0333..de2d896d08 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1130,37 +1130,38 @@ public class DataStatsServiceImpl implements DataStatsService { } ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getAgencyId()); if (CollectionUtils.isNotEmpty(customerRelation.haveSubCustomer(agencyDTO.getCustomerId()))) { - - List subAgencyIds = indexService.getAgencyByAreaCodeAgencyId(formDTO.getAgencyId(), agencyDTO.getAreaCode()); - if (CollectionUtils.isEmpty(subAgencyIds)) { - subAgencyIds = new ArrayList<>(); - } - subAgencyIds.add(formDTO.getAgencyId()); - List list = dataStatsDao.getAgencyGovernDaily(subAgencyIds, formDTO.getDateId()); - if (CollectionUtils.isNotEmpty(list)) { - //问题解决总数 - Integer problemResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getProblemResolvedCount).sum(); - //未出小组即未转议题的:话题关闭已解决数 - Integer inGroupTopicResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getInGroupTopicResolvedCount).sum(); - //未出小组即未转议题的:话题关闭无需解决数 - Integer inGroupTopicUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getInGroupTopicUnResolvedCount).sum(); - //未出当前网格的,结案项目数 - Integer gridSelfGovernProjectTotal = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getGridSelfGovernProjectTotal).sum(); - //由社区结案的项目总数 - Integer communityClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getCommunityClosedCount).sum(); - //由街道结案的项目总数 - Integer streetClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getStreetClosedCount).sum(); - //由区直部门结案的项目总数 - Integer districtDeptClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getDistrictDeptClosedCount).sum(); - - resultDTO.setProblemResolvedCount(problemResolvedCount); - resultDTO.setGroupSelfGovernRatio(getPercentage(inGroupTopicResolvedCount + inGroupTopicUnResolvedCount, problemResolvedCount)); - resultDTO.setGridSelfGovernRatio(getPercentage(gridSelfGovernProjectTotal, problemResolvedCount)); - resultDTO.setCommunityResolvedRatio(getPercentage(communityClosedCount, problemResolvedCount)); - resultDTO.setStreetResolvedRatio(getPercentage(streetClosedCount, problemResolvedCount)); - resultDTO.setDistrictDeptResolvedRatio(getPercentage(districtDeptClosedCount, problemResolvedCount)); - - return resultDTO; + if (OrgConstant.PROVINCE.equals(agencyDTO.getLevel()) || OrgConstant.CITY.equals(agencyDTO.getLevel()) || OrgConstant.DISTRICT.equals(agencyDTO.getLevel())) { + List subAgencyIds = indexService.getAgencyByAreaCodeAgencyId(formDTO.getAgencyId(), agencyDTO.getAreaCode()); + if (CollectionUtils.isEmpty(subAgencyIds)) { + subAgencyIds = new ArrayList<>(); + } + subAgencyIds.add(formDTO.getAgencyId()); + List list = dataStatsDao.getAgencyGovernDaily(subAgencyIds, formDTO.getDateId()); + if (CollectionUtils.isNotEmpty(list)) { + //问题解决总数 + Integer problemResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getProblemResolvedCount).sum(); + //未出小组即未转议题的:话题关闭已解决数 + Integer inGroupTopicResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getInGroupTopicResolvedCount).sum(); + //未出小组即未转议题的:话题关闭无需解决数 + Integer inGroupTopicUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getInGroupTopicUnResolvedCount).sum(); + //未出当前网格的,结案项目数 + Integer gridSelfGovernProjectTotal = list.stream().mapToInt(FactAgencyGovernDailyEntity::getGridSelfGovernProjectTotal).sum(); + //由社区结案的项目总数 + Integer communityClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getCommunityClosedCount).sum(); + //由街道结案的项目总数 + Integer streetClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getStreetClosedCount).sum(); + //由区直部门结案的项目总数 + Integer districtDeptClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getDistrictDeptClosedCount).sum(); + + resultDTO.setProblemResolvedCount(problemResolvedCount); + resultDTO.setGroupSelfGovernRatio(getPercentage(inGroupTopicResolvedCount + inGroupTopicUnResolvedCount, problemResolvedCount)); + resultDTO.setGridSelfGovernRatio(getPercentage(gridSelfGovernProjectTotal, problemResolvedCount)); + resultDTO.setCommunityResolvedRatio(getPercentage(communityClosedCount, problemResolvedCount)); + resultDTO.setStreetResolvedRatio(getPercentage(streetClosedCount, problemResolvedCount)); + resultDTO.setDistrictDeptResolvedRatio(getPercentage(districtDeptClosedCount, problemResolvedCount)); + + return resultDTO; + } } } //1.按日期查询当前组织事件治理指数 @@ -1381,12 +1382,14 @@ public class DataStatsServiceImpl implements DataStatsService { if (OrgConstant.AGENCY.equals(formDTO.getOrgType())) { ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getOrgId()); if (CollectionUtils.isNotEmpty(customerRelation.haveSubCustomer(agencyDTO.getCustomerId()))) { - ScreenGovernRankDataDailyDTO governData = indexService.getGovernRank(formDTO.getOrgId(), agencyDTO.getAreaCode(), formDTO.getDateId()); - resultDTO.setGovernRatio(getPercentage(governData.getGovernCount(), governData.getClosedCount())); - resultDTO.setResolvedRatio(getPercentage(governData.getResolvedCount(), governData.getClosedCount())); - resultDTO.setResponseRatio(getPercentage(governData.getResponseCount(), governData.getTransferCount())); - resultDTO.setSatisfactionRatio(getPercentage(governData.getSatisfactionCount(), governData.getClosedProjectCount())); - return resultDTO; + if (OrgConstant.PROVINCE.equals(agencyDTO.getLevel()) || OrgConstant.CITY.equals(agencyDTO.getLevel()) || OrgConstant.DISTRICT.equals(agencyDTO.getLevel())) { + ScreenGovernRankDataDailyDTO governData = indexService.getGovernRank(formDTO.getOrgId(), agencyDTO.getAreaCode(), formDTO.getDateId()); + resultDTO.setGovernRatio(getPercentage(governData.getGovernCount(), governData.getClosedCount())); + resultDTO.setResolvedRatio(getPercentage(governData.getResolvedCount(), governData.getClosedCount())); + resultDTO.setResponseRatio(getPercentage(governData.getResponseCount(), governData.getTransferCount())); + resultDTO.setSatisfactionRatio(getPercentage(governData.getSatisfactionCount(), governData.getClosedProjectCount())); + return resultDTO; + } } } From d7a92f2f9295c6199d1f33306e8ee5edf2836612 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 1 Jul 2021 16:46:40 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/evaluationindex/EvaluationIndexDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml index ccc4ef9b35..af92260ab7 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml @@ -84,7 +84,7 @@ SUM(RESOLVED_COUNT) AS resolvedCount, SUM(CLOSED_COUNT) AS closedCount, SUM(GOVERN_COUNT) AS governCount, - SUM(SATISFACTION_PROJECT_COUNT) AS satisfactionProjectCount, + SUM(SATISFACTION_COUNT) AS satisfactionProjectCount, SUM(CLOSED_PROJECT_COUNT) AS closedProjectCount FROM screen_govern_rank_data_daily