+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dataaggre.dao.evaluationindex;
+
+import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @Author sun
+ * @Description 指标统计服务
+ */
+@Mapper
+public interface EvaluationIndexDao {
+
+ /**
+ * @Param formDTO
+ * @Description 按类型、日期查询治理指数下响应解决满意自治四个统计率
+ * @author sun
+ */
+ GovrnRatioResultDTO getAgnecyOrGridGoverRatio(@Param("orgId") String orgId, @Param("orgType") String orgType, @Param("dateId") String dateId);
+}
\ No newline at end of file
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java
index 472bc277b4..8b08a765d2 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java
@@ -152,4 +152,11 @@ public interface DataStatsService {
* @author sun
*/
List subGridGovrnList(GridGovrnFormDTO formDTO);
+
+ /**
+ * @Param formDTO
+ * @Description 治理实况-组织/网格下响应解决满意自治率
+ * @author sun
+ */
+ GovrnRatioResultDTO governRatio(GovrnRatioFormDTO formDTO);
}
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 59bca42a8a..c636d2fe11 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
@@ -14,6 +14,7 @@ import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO;
import com.epmet.dataaggre.entity.datastats.DimAgencyEntity;
import com.epmet.dataaggre.entity.datastats.DimGridEntity;
import com.epmet.dataaggre.service.datastats.DataStatsService;
+import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@@ -39,6 +40,8 @@ import java.util.stream.Collectors;
public class DataStatsServiceImpl implements DataStatsService {
@Autowired
private DataStatsDao dataStatsDao;
+ @Autowired
+ private EvaluationIndexService indexService;
/**
@@ -1243,4 +1246,33 @@ public class DataStatsServiceImpl implements DataStatsService {
return resultList;
}
+ /**
+ * @Param formDTO
+ * @Description 治理实况-组织/网格下响应解决满意自治率
+ * @author sun
+ */
+ @Override
+ public GovrnRatioResultDTO governRatio(GovrnRatioFormDTO formDTO) {
+ GovrnRatioResultDTO resultDTO = new GovrnRatioResultDTO();
+ resultDTO.setOrgId(formDTO.getOrgId());
+ resultDTO.setOrgType(formDTO.getOrgType());
+
+ //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
+ if (StringUtils.isBlank(formDTO.getDateId())) {
+ Date yesterday = DateUtils.addDateDays(new Date(), -1);
+ SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
+ formDTO.setDateId(format.format(yesterday));
+ }
+
+ //1.按类型、日期查询治理指数下响应解决满意自治四个统计率
+ GovrnRatioResultDTO dto = indexService.governRatio(formDTO);
+ if (null != dto) {
+ resultDTO.setResponseRatio(dto.getResponseRatio());
+ resultDTO.setResolvedRatio(dto.getResolvedRatio());
+ resultDTO.setGovernRatio(dto.getGovernRatio());
+ resultDTO.setSatisfactionRatio(dto.getSatisfactionRatio());
+ }
+ return resultDTO;
+ }
+
}
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java
new file mode 100644
index 0000000000..909a3dc208
--- /dev/null
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java
@@ -0,0 +1,18 @@
+package com.epmet.dataaggre.service.evaluationindex;
+
+import com.epmet.dataaggre.dto.datastats.form.GovrnRatioFormDTO;
+import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO;
+
+/**
+ * @Author sun
+ * @Description 指标统计服务
+ */
+public interface EvaluationIndexService {
+
+ /**
+ * @Param formDTO
+ * @Description 治理实况-组织/网格下响应解决满意自治率
+ * @author sun
+ */
+ GovrnRatioResultDTO governRatio(GovrnRatioFormDTO formDTO);
+}
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java
new file mode 100644
index 0000000000..bec7bafd90
--- /dev/null
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java
@@ -0,0 +1,40 @@
+package com.epmet.dataaggre.service.evaluationindex.impl;
+
+import com.epmet.commons.dynamic.datasource.annotation.DataSource;
+import com.epmet.commons.tools.utils.DateUtils;
+import com.epmet.dataaggre.constant.DataSourceConstant;
+import com.epmet.dataaggre.dao.datastats.DataStatsDao;
+import com.epmet.dataaggre.dao.evaluationindex.EvaluationIndexDao;
+import com.epmet.dataaggre.dto.datastats.form.GovrnRatioFormDTO;
+import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO;
+import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * @Author sun
+ * @Description 指标统计服务
+ */
+@Service
+@DataSource(DataSourceConstant.EVALUATION_INDEX)
+@Slf4j
+public class EvaluationIndexServiceImpl implements EvaluationIndexService {
+ @Autowired
+ private EvaluationIndexDao evaluationIndexDao;
+
+ /**
+ * @Param formDTO
+ * @Description 按类型、日期查询治理指数下响应解决满意自治四个统计率
+ * @author sun
+ */
+ @Override
+ public GovrnRatioResultDTO governRatio(GovrnRatioFormDTO formDTO) {
+ return evaluationIndexDao.getAgnecyOrGridGoverRatio(formDTO.getOrgId(),formDTO.getOrgType(),formDTO.getDateId());
+ }
+
+}
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml
index cd8b7b8ef1..ab888fc91c 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml
@@ -131,9 +131,14 @@ dynamic:
password: @datasource.druid.opercrm.password@
datastatistical:
driver-class-name: com.mysql.cj.jdbc.Driver
- url: @datasource.druid.opercrm.url@
- username: @datasource.druid.opercrm.username@
- password: @datasource.druid.opercrm.password@
+ url: @datasource.druid.stats.url@
+ username: @datasource.druid.stats.username@
+ password: @datasource.druid.stats.password@
+ evaluationIndex:
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ url: @datasource.druid.evaluationIndex.url@
+ username: @datasource.druid.evaluationIndex.username@
+ password: @datasource.druid.evaluationIndex.password@
feign:
hystrix:
enabled: true
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
new file mode 100644
index 0000000000..a0c2e0c245
--- /dev/null
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
\ No newline at end of file