diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java index b5395e65b6..ce186bfffc 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java @@ -28,4 +28,6 @@ public interface DataSourceConstant { String OPER_CRM="opercrm"; String DATA_STATISTICAL="datastatistical"; + + String EVALUATION_INDEX = "evaluationIndex"; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GovrnRatioFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GovrnRatioFormDTO.java new file mode 100644 index 0000000000..7e5407a8ef --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GovrnRatioFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 治理实况-组织/网格下响应解决满意自治率-接口入参 + * @Auth sun + */ +@Data +public class GovrnRatioFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 组织Id + */ + @NotBlank(message = "组织或网格Id不能为空", groups = GovrnRatioFormDTO.AgencyGrid.class) + private String orgId; + /** + * 组织:agency 网格:grid + */ + @NotBlank(message = "网格Id不能为空", groups = GovrnRatioFormDTO.AgencyGrid.class) + private String orgType; + /** + * 日维度Id[日期,不传值默认查前一天的【格式:20210101】] + */ + private String dateId; + public interface AgencyGrid extends CustomerClientShowGroup {} + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GovrnRatioResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GovrnRatioResultDTO.java new file mode 100644 index 0000000000..75a6f5ee1b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GovrnRatioResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 治理实况-组织/网格下响应解决满意自治率-接口返参 + * @Auth sun + */ +@Data +public class GovrnRatioResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + //组织或网格Id + private String orgId; + //组织:agency 网格:grid + private String orgType; + //响应率 + private String responseRatio = "0%"; + //解决率 + private String resolvedRatio = "0%"; + //自治率 + private String governRatio = "0%"; + //满意率 + private String satisfactionRatio = "0%"; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/pom.xml b/epmet-module/data-aggregator/data-aggregator-server/pom.xml index a2cc3bc297..ab8c36be1a 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/pom.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/pom.xml @@ -158,11 +158,18 @@ EpmEt-db-UsEr - + - - epmet_data_statistical_user - EpmEt-db-UsEr + + epmet_data_statistical_user + EpmEt-db-UsEr + + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr 0 @@ -246,11 +253,18 @@ EpmEt-db-UsEr - + - - epmet_data_statistical_user - EpmEt-db-UsEr + + epmet_data_statistical_user + EpmEt-db-UsEr + + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr 0 @@ -334,11 +348,18 @@ elink@833066 - + - - epmet - elink@833066 + + epmet + elink@833066 + + + + + + epmet + elink@833066 0 @@ -422,11 +443,18 @@ EpmEt-db-UsEr - + - - epmet_data_statistical_user - EpmEt-db-UsEr + + epmet_data_statistical_user + EpmEt-db-UsEr + + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr 0 diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java index 74b2552e43..a56d769119 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java @@ -1,5 +1,6 @@ package com.epmet.dataaggre.controller; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dataaggre.dto.datastats.form.*; @@ -200,4 +201,18 @@ public class DataStatsController { return new Result>().ok(dataStatsService.subGridGovrnList(formDTO)); } + /** + * @Param formDTO + * @Description 治理实况-组织/网格下响应解决满意自治率 + * @author sun + */ + @PostMapping("governratio") + public Result governRatio(@RequestBody GovrnRatioFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GovrnRatioFormDTO.AgencyGrid.class); + if (!"agency".equals(formDTO.getOrgType()) && !"grid".equals(formDTO.getOrgType())) { + throw new RenException(String.format("入参格式错误,错误的组织或网格类型:%s", formDTO.getOrgType())); + } + return new Result().ok(dataStatsService.governRatio(formDTO)); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java new file mode 100644 index 0000000000..c9084a0b4b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java @@ -0,0 +1,37 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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 diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectMainDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectMainDailyDTO.java index 9d1484b5f4..13e1e5fba7 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectMainDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectMainDailyDTO.java @@ -138,6 +138,11 @@ public class FactOriginProjectMainDailyDTO implements Serializable { */ private String isOverdue; + /** + * 是否满意 1:是 + */ + private Integer isSatisfied; + /** * 办结组织Ids(:隔开,有可能是社区id可能是网格id,无需区分级别,在统计时模糊查询) */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectPointDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectPointDTO.java new file mode 100644 index 0000000000..abeeab8d89 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectPointDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.project; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/5/21 10:53 + */ +@Data +public class ProjectPointDTO implements Serializable { + private static final long serialVersionUID = -592430619162380664L; + private String projectId; + private Integer point; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenGovernRankDataDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenGovernRankDataDailyDTO.java new file mode 100644 index 0000000000..29d988da64 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenGovernRankDataDailyDTO.java @@ -0,0 +1,132 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.dto.screen; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 基层治理-治理能力排行数据(按月统计) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Data +public class ScreenGovernRankDataDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 年Id + */ + private String yearId; + + /** + * 月份Id + */ + private String monthId; + + /** + * 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 响应率 + */ + private BigDecimal responseRatio; + + /** + * 解决率 + */ + private BigDecimal resolvedRatio; + + /** + * 自治率 + */ + private BigDecimal governRatio; + + /** + * 满意率 + */ + private BigDecimal satisfactionRatio; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 644830e3a2..dbedc28b8c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -669,6 +669,15 @@ public class DemoController { return new Result(); } + @PostMapping("governRankDaily") + public Result governRankDaily(@RequestBody CustomerIdAndDateIdFormDTO formDTO){ + governRankDataExtractService.extractGridDataDaily(formDTO.getCustomerId(), formDTO.getDateId()); + governRankDataExtractService.extractCommunityDataDaily(formDTO.getCustomerId(), formDTO.getDateId()); + governRankDataExtractService.extractStreetDataDaily(formDTO.getCustomerId(), formDTO.getDateId()); + governRankDataExtractService.extractDistrictDataDaily(formDTO.getCustomerId(), formDTO.getDateId()); + return new Result(); + } + @Autowired private PioneerDataExtractService pioneerDataExtractService; @Autowired diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactAgencyGovernDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactAgencyGovernDailyDao.java new file mode 100644 index 0000000000..b88d897543 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactAgencyGovernDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 组织的治理指数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Mapper +public interface FactAgencyGovernDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java index 8e18ad5500..78f9be78e9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java @@ -182,6 +182,28 @@ public interface FactOriginProjectLogDailyDao extends BaseDao selectGridResponse(@Param("customerId") String customerId, @Param("monthId") String monthId); + /** + * 组织项目响应度 + * @author zhaoqifeng + * @date 2020/9/25 10:01 + * @param customerId + * @param dateId + * @param level + * @return java.util.List + */ + List selectOrgResponseDaily(@Param("customerId") String customerId, @Param("dateId") String dateId, + @Param("level")String level); + + /** + * 网格项目响应度 + * @author zhaoqifeng + * @date 2020/9/25 10:01 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectGridResponseDaily(@Param("customerId") String customerId, @Param("dateId") String dateId); + /** * 组织项目响应度 * @author zhaoqifeng @@ -215,6 +237,27 @@ public interface FactOriginProjectLogDailyDao extends BaseDao selectOrgSatisfaction(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("level")String level); + /** + * 网格满意率 + * @author zhaoqifeng + * @date 2020/9/27 15:52 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectGridSatisfactionDaily(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 组织满意率 + * @author zhaoqifeng + * @date 2020/9/27 15:52 + * @param customerId + * @param level + * @param dateId + * @return java.util.List + */ + List selectOrgSatisfactionDaily(@Param("customerId") String customerId, @Param("level")String level, @Param("dateId") String dateId); + /** * 获取部门办结项目数 * @author zhaoqifeng @@ -245,4 +288,14 @@ public interface FactOriginProjectLogDailyDao extends BaseDao */ List selectGridClosed(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * 网格自治率统计--按天 + * @author zhaoqifeng + * @date 2021/5/24 17:53 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectGridSelfDaily(@Param("customerId") String customerId, @Param("dateId") String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java index 179574ae7a..e07a58613f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java @@ -157,6 +157,18 @@ public interface FactOriginProjectMainDailyDao extends BaseDao getSelfProject(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("level") String level); + /** + * 组织自治项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:16 + * @param customerId + * @param dateId + * @param level + * @return java.util.List + */ + List getSelfProjectDaily(@Param("customerId") String customerId, @Param("dateId")String dateId, + @Param("level") String level); + /** * 组织解决项目数 @@ -170,6 +182,18 @@ public interface FactOriginProjectMainDailyDao extends BaseDao getResolveProject(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("level") String level); + /** + * 组织解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:16 + * @param customerId + * @param dateId + * @param level + * @return java.util.List + */ + List getResolveProjectDaily(@Param("customerId") String customerId, @Param("dateId")String dateId, + @Param("level") String level); + /** * 网格解决项目数 * @author zhaoqifeng @@ -180,6 +204,16 @@ public interface FactOriginProjectMainDailyDao extends BaseDao getGridResolveProject(@Param("customerId") String customerId, @Param("monthId")String monthId); + /** + * 网格解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:16 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getGridResolveProjectDaily(@Param("customerId") String customerId, @Param("dateId")String dateId); + /** * @Description 查询难点赌点的基本信息,要排除之前已经结案过的项目 * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java index a47ebdc88d..cc7277e9e0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java @@ -123,4 +123,14 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao */ List selectGridByCustomer(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * 查询客户下网格治理能力 + * @author zhaoqifeng + * @date 2020/9/24 15:26 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectGridByCustomerDaily(@Param("customerId")String customerId, @Param("dateId")String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDailyDao.java new file mode 100644 index 0000000000..688d9b4d3f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDailyDao.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 基层治理-治理能力排行数据(按月统计) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Mapper +public interface ScreenGovernRankDataDailyDao extends BaseDao { + /** + * 组织级别初始化数据 + * @author zhaoqifeng + * @date 2020/9/24 14:52 + * @param customerId + * @param level + * @return java.util.List + */ + List initAgencyDataList(@Param("customerId") String customerId, @Param("level") String level); + + /** + * 网格级别初始化数据 + * @author zhaoqifeng + * @date 2020/9/24 14:52 + * @param customerId + * @return java.util.List + */ + List initGridDataList(@Param("customerId") String customerId); + + /** + * 删除旧数据 + * @author zhaoqifeng + * @date 2020/9/25 10:38 + * @param customerId + * @param orgType + * @param dateId + * @param deleteSize + * @param orgIds + * @return java.lang.Integer + */ + Integer deleteRankData(@Param("customerId") String customerId, @Param("orgType") String orgType, @Param("dateId") String dateId, + @Param("deleteSize") Integer deleteSize, + @Param("orgIds")List orgIds); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java index 2d3318c262..44e47f6f92 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -18,12 +18,16 @@ package com.epmet.dao.project; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomerProjectParameterDTO; import com.epmet.dto.ProjectDTO; +import com.epmet.dto.ProjectSatisfactionStatisticsDTO; import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.dto.project.ProjectCategoryDTO; import com.epmet.dto.project.ProjectGridDTO; +import com.epmet.dto.project.ProjectPointDTO; import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.project.ProjectEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -135,4 +139,23 @@ public interface ProjectDao extends BaseDao { List selectProjectCategory(@Param("list")List list); List getProjectCategoryData(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 获取项目满意度 + * @author zhaoqifeng + * @date 2021/5/21 10:06 + * @param customerId + * @return java.util.List + */ + List selectProjectSatisfaction(@Param("customerId") String customerId); + + /** + * 根据key查找value + * @author zhaoqifeng + * @date 2021/5/21 10:58 + * @param customerId + * @param parameterKey + * @return java.lang.String + */ + String selectValueByKey(@Param("customerId") String customerId, @Param("parameterKey") String parameterKey); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java new file mode 100644 index 0000000000..2f37f9a113 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java @@ -0,0 +1,174 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.entity.evaluationindex.extract; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 组织的治理指数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_agency_govern_daily") +public class FactAgencyGovernDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * 组织id + */ + private String agencyId; + + /** + * agency_id所属的机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) + */ + private String level; + + /** + * 组织i所属的组织id + */ + private String pid; + + /** + * 组织i所有上级id + */ + private String pids; + + /** + * 界面展示:问题解决总数=1+2+3+4+5+6+7+8 + */ + private Integer problemResolvedCount; + + /** + * 界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数 + */ + private BigDecimal groupSelfGovernRatio; + + /** + * 界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal gridSelfGovernRatio; + + /** + * 界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal communityClosedRatio; + + /** + * 界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal streetClosedRatio; + + /** + * 界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal districtDeptClosedRatio; + + /** + * 1、当前组织内,话题关闭已解决数 + */ + private Integer topicResolvedCount; + + /** + * 2、当前组织内,话题关闭无需解决数 + */ + private Integer topicUnResolvedCount; + + /** + * 3、当前组织内,议题关闭已解决数 + */ + private Integer issueResolvedCount; + + /** + * 4、当前组织内,议题关闭无需解决数 + */ + private Integer issueUnResolvedCount; + + /** + * 5、当前组织内:来源于议题的项目:结案已解决数 + */ + private Integer issueProjectResolvedCount; + + /** + * 6、当前组织内:来源于议题的项目:结案无需解决数 + */ + private Integer issueProjectUnResolvedCount; + + /** + * 7、当前组织内:项目立项,结案已解决数;默认为0, + */ + private Integer approvalProjectResolvedCount; + + /** + * 8、当前组织内:项目立项,结案无需解决数;默认为0, + */ + private Integer approvalProjectUnResolvedCount; + + /** + * 9、当前组织内,未出小组即未转议题的:话题关闭已解决数 + */ + private Integer inGroupTopicResolvedCount; + + /** + * 10、当前组织内,未出小组即未转议题的:话题关闭无需解决数 + */ + private Integer inGroupTopicUnResolvedCount; + + /** + * 未出当前网格的,结案项目数 + */ + private Integer gridSelfGovernProjectTotal; + + /** + * 当前组织内结案的项目中:由社区结案的项目总数 + */ + private Integer communityClosedCount; + + /** + * 当前组织内结案的项目中:由街道结案的项目总数 + */ + private Integer streetClosedCount; + + /** + * 当前组织内结案的项目中:由区直部门结案的项目总数 + */ + private Integer districtDeptClosedCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectMainDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectMainDailyEntity.java index 35d0e46b8f..be69a89f3d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectMainDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectMainDailyEntity.java @@ -138,6 +138,11 @@ public class FactOriginProjectMainDailyEntity extends BaseEpmetEntity { */ private String isOverdue; + /** + * 是否满意 1:是 + */ + private Integer isSatisfied; + /** * 办结组织Ids(:隔开,有可能是社区id可能是网格id,无需区分级别,在统计时模糊查询) */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java new file mode 100644 index 0000000000..8bbe10f526 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java @@ -0,0 +1,102 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 基层治理-治理能力排行数据(按月统计) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_govern_rank_data_daily") +public class ScreenGovernRankDataDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 年Id + */ + private String yearId; + + /** + * 月份Id + */ + private String monthId; + + /** + * 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 响应率 + */ + private BigDecimal responseRatio; + + /** + * 解决率 + */ + private BigDecimal resolvedRatio; + + /** + * 自治率 + */ + private BigDecimal governRatio; + + /** + * 满意率 + */ + private BigDecimal satisfactionRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java new file mode 100644 index 0000000000..2c0050903c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.service.evaluationindex.extract.todata; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; + +/** + * 组织的治理指数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +public interface FactAgencyGovernDailyService extends BaseService { + // 问题解决总数:当前组织下,话题关闭(已解决+无需解决)总数、议题关闭(已解决+无需解决)总数和项目结案(议题转为项目的结案数+项目立项结案数)总数之和 + // 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的) + // 网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格) + // 参考:fact_index_govrn_ablity_grid_monthly的SELF_SOLVE_PROJECT_COUNT计算 + // 社区解决占比:当前组织下,由社区结案的项目数与问题解决总数之比 + // 区直部门解决占比:当前组织下,由区级部门结案的项目数与问题解决总数之比 + // 街道解决占比:当前组织下,由街道结案的项目数与问题解决总数之比 + // 自下而上的项目解决:结案时操作人所代表的的处理部门(可以是网格、街道、组织) + // 自上而下的项目解决:向下吹哨,谁立项谁解决(后期在讨论哪样更合理) + // + // 究竟是谁解决!!: + // A社区→A街道→B社区(结案)——A街道解决(自下而上吹(饱含立项往上吹/从话题来的项目),看往上吹的最高层级) + // A社区→B社区→C社区(结案)——C社区解决(平级协助解决,看最后结案) + // A街道→A社区→B社区(结案)——A街道解决(自上而下吹,谁立项谁解决) + // 注:A社区→A街道→(退回)A社区→B社区(结案),A街道不算处理项目,仍是平级协助解决,看最后谁结案 + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java index d5ffd39cd4..95185f2134 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java @@ -27,6 +27,18 @@ import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity; * @since v1.0.0 2021-05-24 */ public interface FactGridGovernDailyService extends BaseService { - + // 指标解释: + // 1、问题解决总数:当前网格内,话题关闭(已解决+无需解决)总数、议题关闭(已解决+无需解决)总数和项目结案(议题转为项目的结案数+项目立项结案数)总数之和 + // 2、党群自治占比:当前网格内,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的) + // 3、网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格) + /** + * 治理指数-网格相关:问题解决总数、党群自治占比、网格自治占比 + * + * + * @param customerId + * @param dateId + * @return + */ + void extractFactGridGovernDaily(String customerId, String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java index c337c085da..141a8dc7b8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java @@ -218,6 +218,27 @@ public interface FactOriginProjectLogDailyService extends BaseService getOrgResponse(String customerId, String monthId, String level); + /** + * 网格项目响应度 + * @author zhaoqifeng + * @date 2020/9/25 9:56 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getGridResponseDaily(String customerId, String dateId); + + /** + * 组织项目响应度 + * @author zhaoqifeng + * @date 2020/9/25 9:56 + * @param customerId + * @param dateId + * @param level + * @return java.util.List + */ + List getOrgResponseDaily(String customerId, String dateId, String level); + /** * 网格满意率 * @author zhaoqifeng @@ -239,6 +260,27 @@ public interface FactOriginProjectLogDailyService extends BaseService getOrgSatisfaction(String customerId, String monthId, String level); + /** + * 网格满意率 + * @author zhaoqifeng + * @date 2020/9/27 16:06 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getGridSatisfactionDaily(String customerId, String dateId); + + /** + * 组织满意率 + * @author zhaoqifeng + * @date 2020/9/27 16:06 + * @param customerId + * @param dateId + * @param level + * @return java.util.List + */ + List getOrgSatisfactionDaily(String customerId, String dateId, String level); + /** * 获取部门办结项目数 * @author zhaoqifeng @@ -268,4 +310,14 @@ public interface FactOriginProjectLogDailyService extends BaseService */ List getGridClosed(String customerId, String monthId); + + /** + * 网格自制率统计-按天 + * @author zhaoqifeng + * @date 2021/5/24 17:52 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getGridSelfDaily(String customerId, String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index b160131db7..21994e4a98 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -146,6 +146,17 @@ public interface FactOriginProjectMainDailyService extends BaseService */ List getSelfProject(String customerId, String monthId, String level); + /** + * 自治项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:34 + * @param customerId + * @param dateId + * @param level + * @return java.util.List + */ + List getSelfProjectDaily(String customerId, String dateId, String level); + /** * 已解决项目数 * @author zhaoqifeng @@ -156,6 +167,16 @@ public interface FactOriginProjectMainDailyService extends BaseService */ List getResolveProject(String customerId, String monthId, String level); + /** + * 已解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:34 + * @param customerId + * @param dateId + * @param level + * @return java.util.List + */ + List getResolveProjectDaily(String customerId, String dateId, String level); /** * 网格已解决项目数 @@ -167,6 +188,16 @@ public interface FactOriginProjectMainDailyService extends BaseService getGridResolveProject(String customerId, String monthId); + /** + * 网格已解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:34 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getGridResolveProjectDaily(String customerId, String dateId); + /** * 网格项目数 * @author zhaoqifeng diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java new file mode 100644 index 0000000000..e40ffd49bd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.service.evaluationindex.extract.todata.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.evaluationindex.extract.FactAgencyGovernDailyDao; +import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactAgencyGovernDailyService; +import org.springframework.stereotype.Service; + +/** + * 组织的治理指数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Service +public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl implements FactAgencyGovernDailyService { + + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java index 99e73d3603..38b5a2d8a0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java @@ -19,17 +19,56 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.dao.evaluationindex.extract.FactGridGovernDailyDao; +import com.epmet.dto.org.GridInfoDTO; import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; +import com.epmet.service.group.GroupDataService; +import com.epmet.service.org.CustomerAgencyService; +import com.epmet.service.org.CustomerGridService; +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.util.List; + /** * 网格的治理指数,按天统计 * * @author generator generator@elink-cn.com * @since v1.0.0 2021-05-24 */ +@Slf4j @Service public class FactGridGovernDailyServiceImpl extends BaseServiceImpl implements FactGridGovernDailyService { + @Autowired + private GroupDataService groupDataService; + @Autowired + private CustomerAgencyService customerAgencyService; + @Autowired + private CustomerGridService customerGridService; + + // 指标解释: + // 1、问题解决总数:当前网格内,话题关闭(已解决+无需解决)总数、议题关闭(已解决+无需解决)总数和项目结案(议题转为项目的结案数+项目立项结案数)总数之和 + // 2、党群自治占比:当前网格内,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的) + // 3、网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格) + /** + * 治理指数-网格相关:问题解决总数、党群自治占比、网格自治占比 + * + * @param customerId + * @param dateId + * @return + */ + @Override + public void extractFactGridGovernDaily(String customerId, String dateId) { + //客户id, dateId不能为空 + if(StringUtils.isBlank(customerId)||StringUtils.isBlank(dateId)){ + return; + } + // 2、当前客户下所有的网格 + List gridInfoDTOList=customerGridService.queryGridInfoList(customerId); + //todo + // List + } } \ No newline at end of file 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 9be7b9f44f..3dde0b0032 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 @@ -290,6 +290,35 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2020/9/25 9:56 + */ + @Override + public List getGridResponseDaily(String customerId, String dateId) { + return baseDao.selectGridResponseDaily(customerId, dateId); + } + + /** + * 组织项目响应度 + * + * @param customerId + * @param dateId + * @param level + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/25 9:56 + */ + @Override + public List getOrgResponseDaily(String customerId, String dateId, String level) { + return baseDao.selectOrgResponseDaily(customerId, dateId, level); + } + @Override public List getGridSatisfaction(String customerId, String monthId) { return baseDao.selectGridSatisfaction(customerId, monthId); @@ -300,6 +329,35 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2020/9/27 16:06 + */ + @Override + public List getGridSatisfactionDaily(String customerId, String dateId) { + return baseDao.selectGridSatisfactionDaily(customerId, dateId); + } + + /** + * 组织满意率 + * + * @param customerId + * @param dateId + * @param level + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/27 16:06 + */ + @Override + public List getOrgSatisfactionDaily(String customerId, String dateId, String level) { + return baseDao.selectOrgSatisfactionDaily(customerId, dateId, level); + } + /** * 获取部门办结项目数 * @@ -342,5 +400,19 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2021/5/24 17:52 + */ + @Override + public List getGridSelfDaily(String customerId, String dateId) { + return baseDao.selectGridSelfDaily(customerId, dateId); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index 73830ce377..12550e187f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -180,16 +180,60 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2020/9/25 15:34 + */ + @Override + public List getSelfProjectDaily(String customerId, String dateId, String level) { + return baseDao.getSelfProjectDaily(customerId, dateId, level); + } + @Override public List getResolveProject(String customerId, String monthId, String level) { return baseDao.getResolveProject(customerId, monthId, level); } + /** + * 已解决项目数 + * + * @param customerId + * @param dateId + * @param level + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/25 15:34 + */ + @Override + public List getResolveProjectDaily(String customerId, String dateId, String level) { + return baseDao.getResolveProjectDaily(customerId, dateId, level); + } + @Override public List getGridResolveProject(String customerId, String monthId) { return baseDao.getGridResolveProject(customerId, monthId); } + /** + * 网格已解决项目数 + * + * @param customerId + * @param dateId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/25 15:34 + */ + @Override + public List getGridResolveProjectDaily(String customerId, String dateId) { + return baseDao.getGridResolveProjectDaily(customerId, dateId); + } + @Override public List getGridProjectCount(String customerId, String monthId) { return baseDao.getGridProjectCount(customerId, monthId); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java index ef55ca765a..81b88a84bd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java @@ -49,4 +49,48 @@ public interface GovernRankDataExtractService { * @date 2020/9/24 15:17 */ void extractDistrictData(String customerId, String monthId); + + /** + * 网格治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:16 + */ + void extractGridDataDaily(String customerId, String dateId); + + /** + * 社区治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + void extractCommunityDataDaily(String customerId, String dateId); + + /** + * 街道治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + void extractStreetDataDaily(String customerId, String dateId); + + /** + * 全区治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + void extractDistrictDataDaily(String customerId, String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java index 14198e915b..80d3f22ee7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java @@ -5,12 +5,14 @@ import com.epmet.constant.IndexCalConstant; import com.epmet.constant.OrgTypeConstant; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.GovernRankDataExtractService; import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService; import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; +import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataDailyService; import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -30,6 +32,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe @Autowired private ScreenGovernRankDataService screenGovernRankDataService; @Autowired + private ScreenGovernRankDataDailyService screenGovernRankDataDailyService; + @Autowired private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService; @Autowired private FactIndexGovrnAblityGridMonthlyService factIndexGovrnAblityGridMonthlyService; @@ -283,4 +287,294 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe } screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list); } + + /** + * 网格治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:16 + */ + @Override + public void extractGridDataDaily(String customerId, String dateId) { + List list = screenGovernRankDataDailyService.initList(customerId, OrgTypeConstant.GRID, null); + if (CollectionUtils.isEmpty(list)) { + return; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(dateId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(dateId.substring(NumConstant.ZERO, NumConstant.SIX)); + entity.setDateId(dateId); + }); + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getGridSatisfactionDaily(customerId, dateId); + if (!CollectionUtils.isEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //自治率 + List gridList = factOriginProjectLogDailyService.getGridSelfDaily(customerId, dateId); + if (CollectionUtils.isNotEmpty(gridList)) { + list.forEach(entity -> gridList.stream().filter(gridAbility -> entity.getOrgId().equals(gridAbility.getOrgId())).forEach(grid -> { + BigDecimal resolveCount = new BigDecimal(grid.getSum()); + BigDecimal selfCount = new BigDecimal(grid.getCount()); + if (grid.getSum() != NumConstant.ZERO) { + entity.setGovernRatio(selfCount.multiply(hundred).divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getGridResponseDaily(customerId, dateId); + if (CollectionUtils.isNotEmpty(responseList)) { + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getGridResolveProjectDaily(customerId, dateId); + if (CollectionUtils.isNotEmpty(resolveList)) { + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + screenGovernRankDataDailyService.delAndSaveRankData(customerId, OrgTypeConstant.GRID, dateId, IndexCalConstant.DELETE_SIZE, list); + } + + /** + * 社区治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + @Override + public void extractCommunityDataDaily(String customerId, String dateId) { + List list = screenGovernRankDataDailyService.initList(customerId, OrgTypeConstant.AGENCY, + OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isEmpty(list)) { + return; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(dateId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(dateId.substring(NumConstant.ZERO, NumConstant.SIX)); + entity.setDateId(dateId); + }); + + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfactionDaily(customerId, dateId, + OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getOrgResponseDaily(customerId, dateId, OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(responseList)) { + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //自制率 自治项目数/办结项目数 + List selfList = factOriginProjectMainDailyService.getSelfProject(customerId, dateId, OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(selfList)) { + list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getResolveProjectDaily(customerId, dateId, + OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(resolveList)) { + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + screenGovernRankDataDailyService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, dateId, IndexCalConstant.DELETE_SIZE, list); + } + + /** + * 街道治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + @Override + public void extractStreetDataDaily(String customerId, String dateId) { + List list = screenGovernRankDataDailyService.initList(customerId, OrgTypeConstant.AGENCY, + OrgTypeConstant.STREET); + if (CollectionUtils.isEmpty(list)) { + return; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(dateId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(dateId.substring(NumConstant.ZERO, NumConstant.SIX)); + entity.setDateId(dateId); + }); + + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfactionDaily(customerId, dateId, + OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getOrgResponseDaily(customerId, dateId, OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(responseList)) { + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //自制率 自治项目数/办结项目数 + List selfList = factOriginProjectMainDailyService.getSelfProject(customerId, dateId, OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(selfList)) { + list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getResolveProjectDaily(customerId, dateId, + OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(resolveList)) { + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + screenGovernRankDataDailyService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, dateId, IndexCalConstant.DELETE_SIZE, list); + } + + /** + * 全区治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + @Override + public void extractDistrictDataDaily(String customerId, String dateId) { + List list = screenGovernRankDataDailyService.initList(customerId, OrgTypeConstant.AGENCY, + OrgTypeConstant.DISTRICT); + if (CollectionUtils.isEmpty(list)) { + return; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(dateId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(dateId.substring(NumConstant.ZERO, NumConstant.SIX)); + entity.setDateId(dateId); + }); + + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfactionDaily(customerId, dateId, + OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getOrgResponseDaily(customerId, dateId, OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(responseList)) { + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //自制率 自治项目数/办结项目数 + List selfList = factOriginProjectMainDailyService.getSelfProject(customerId, dateId, OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(selfList)) { + list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getResolveProjectDaily(customerId, dateId, + OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(resolveList)) { + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + screenGovernRankDataDailyService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, dateId, IndexCalConstant.DELETE_SIZE, list); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index 0697a46edd..b69cb0e595 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -221,6 +221,28 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { log.error("按天统计:组织内各个分类下的项目总数,customerId为:"+customerId+"dateId为:"+dateId, e); } + //治理能力排行screen_govern_rank_data + try { + governRankDataExtractService.extractGridDataDaily(customerId, dateId); + }catch (Exception e){ + log.error("治理能力排行【网格】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + try { + governRankDataExtractService.extractCommunityDataDaily(customerId, dateId); + }catch (Exception e){ + log.error("治理能力排行【社区】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + try { + governRankDataExtractService.extractStreetDataDaily(customerId, dateId); + }catch (Exception e){ + log.error("治理能力排行【街道】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + try { + governRankDataExtractService.extractDistrictDataDaily(customerId, dateId); + }catch (Exception e){ + log.error("治理能力排行【全区】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + extractPartData(customerId, dateId); log.info("===== extractDaily method end ======"); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java index 8010a566d2..c8621ab7d6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java @@ -21,4 +21,15 @@ public interface FactIndexGovrnAblityGridMonthlyService extends BaseService getGridByCustomer(String customerId, String monthId); + + /** + * 查询客户下网格治理能力 + * + * @param customerId + * @param dateId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/24 15:41 + */ + List getGridByCustomerDaily(String customerId, String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java index 3f9c73afb3..bf3dd65e5e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java @@ -22,4 +22,18 @@ public class FactIndexGovrnAblityGridMonthlyServiceImpl extends BaseServiceImpl< public List getGridByCustomer(String customerId, String monthId) { return baseDao.selectGridByCustomer(customerId, monthId); } + + /** + * 查询客户下网格治理能力 + * + * @param customerId + * @param dateId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/24 15:41 + */ + @Override + public List getGridByCustomerDaily(String customerId, String dateId) { + return baseDao.selectGridByCustomerDaily(customerId, dateId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataDailyService.java new file mode 100644 index 0000000000..0fa086cfb7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataDailyService.java @@ -0,0 +1,121 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenGovernRankDataDailyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 基层治理-治理能力排行数据(按月统计) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +public interface ScreenGovernRankDataDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-24 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-24 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenGovernRankDataDailyDTO + * @author generator + * @date 2021-05-24 + */ + ScreenGovernRankDataDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-24 + */ + void save(ScreenGovernRankDataDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-24 + */ + void update(ScreenGovernRankDataDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-24 + */ + void delete(String[] ids); + + /** + * 构造screen_govern_rank_data 初始数据,先赋值为0 + * + * @param customerId + * @param orgType + * @param agencyLevel + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/24 14:41 + */ + List initList(String customerId, String orgType, String agencyLevel); + + /** + * 保存抽取结果 + * + * @param customerId + * @param orgType + * @param dateId + * @param deleteSize + * @param entityList + * @return void + * @author zhaoqifeng + * @date 2020/9/25 10:32 + */ + void delAndSaveRankData(String customerId, String orgType, String dateId, Integer deleteSize, List entityList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataDailyServiceImpl.java new file mode 100644 index 0000000000..3c48645963 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataDailyServiceImpl.java @@ -0,0 +1,170 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.service.evaluationindex.screen.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.dao.evaluationindex.screen.ScreenGovernRankDataDailyDao; +import com.epmet.dto.screen.ScreenGovernRankDataDailyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; +import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataDailyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 基层治理-治理能力排行数据(按月统计) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenGovernRankDataDailyServiceImpl extends BaseServiceImpl implements ScreenGovernRankDataDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenGovernRankDataDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenGovernRankDataDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ScreenGovernRankDataDailyDTO get(String id) { + ScreenGovernRankDataDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenGovernRankDataDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenGovernRankDataDailyDTO dto) { + ScreenGovernRankDataDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenGovernRankDataDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenGovernRankDataDailyDTO dto) { + ScreenGovernRankDataDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenGovernRankDataDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 构造screen_govern_rank_data 初始数据,先赋值为0 + * + * @param customerId + * @param orgType + * @param agencyLevel + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/24 14:41 + */ + @Override + public List initList(String customerId, String orgType, String agencyLevel) { + List list = new ArrayList<>(); + switch (orgType) { + case OrgTypeConstant.AGENCY: + log.info("组织级别统计"); + list = baseDao.initAgencyDataList(customerId, agencyLevel); + break; + case OrgTypeConstant.GRID: + log.info("网格级别统计"); + list = baseDao.initGridDataList(customerId); + break; + default: + log.info("部门级别统计"); + break; + } + return list; + } + + /** + * 保存抽取结果 + * + * @param customerId + * @param orgType + * @param dateId + * @param deleteSize + * @param entityList + * @return void + * @author zhaoqifeng + * @date 2020/9/25 10:32 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void delAndSaveRankData(String customerId, String orgType, String dateId, Integer deleteSize, + List entityList) { + if (CollectionUtils.isEmpty(entityList)) { + return; + } + List orgIds = new ArrayList<>(); + for (ScreenGovernRankDataDailyEntity entity : entityList) { + orgIds.add(entity.getOrgId()); + } + int deleteNum; + do { + deleteNum = baseDao.deleteRankData(customerId, orgType, dateId, deleteSize, orgIds); + } while (deleteNum != NumConstant.ZERO); + + insertBatch(entityList); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java index 56a99d5257..36c3ebd05b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java @@ -23,6 +23,7 @@ import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.dto.project.ProjectGridDTO; import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.project.ProjectEntity; import org.apache.ibatis.annotations.Param; @@ -152,4 +153,13 @@ public interface ProjectService extends BaseService { */ List getProjectCategoryData(String customerId, String dateId); + /** + * 获取项目满意度 + * @author zhaoqifeng + * @date 2021/5/21 10:04 + * @param customerId + * @return java.util.List + */ + List getProjectSatisfaction(String customerId); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index d2a3ff001d..3581f920b1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -26,17 +26,16 @@ import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.dto.project.ProjectCategoryDTO; import com.epmet.dto.project.ProjectGridDTO; +import com.epmet.dto.project.ProjectPointDTO; import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.project.ProjectEntity; import com.epmet.service.project.ProjectService; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.stream.Collectors; /** @@ -163,5 +162,39 @@ public class ProjectServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2021/5/21 10:04 + */ + @Override + public List getProjectSatisfaction(String customerId) { + List list = baseDao.selectProjectSatisfaction(customerId); + if (org.apache.commons.collections4.CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + //获取项目满意指标 + String value = baseDao.selectValueByKey(customerId, "satisfaction"); + if (null == value) { + //客户没有自定义配置的话取默认配置 + value = baseDao.selectValueByKey("default", "satisfaction"); + } + + String finalValue = value; + return list.stream().map(item -> { + FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity(); + entity.setId(item.getProjectId()); + if (item.getPoint() < Integer.parseInt(finalValue)) { + entity.setIsSatisfied(NumConstant.ZERO); + } else { + entity.setIsSatisfied(NumConstant.ONE); + } + return entity; + }).collect(Collectors.toList()); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactAgencyGovernDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactAgencyGovernDailyDao.xml new file mode 100644 index 0000000000..7b4aa4c504 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactAgencyGovernDailyDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml index 7b2a4f9ae7..411d959a57 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml @@ -313,8 +313,7 @@ COUNT( ID ) AS "count" FROM fact_origin_project_log_daily WHERE ORG_TYPE = 'grid' - AND ( ACTION_CODE = 'response' - OR ACTION_CODE = 'close' + AND (ACTION_CODE = 'close' OR ACTION_CODE = 'transfer' OR ACTION_CODE = 'resolved' OR ACTION_CODE = 'unresolved' @@ -347,8 +346,7 @@ INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID AND da.`LEVEL` = #{level} WHERE - ( ACTION_CODE = 'response' - OR ACTION_CODE = 'close' + ( ACTION_CODE = 'close' OR ACTION_CODE = 'transfer' OR ACTION_CODE = 'resolved' OR ACTION_CODE = 'unresolved' @@ -362,33 +360,22 @@ SELECT AGENCY_ID, - COUNT( score >= 80 OR NULL ) AS 'count', + SUM( score ) AS 'count', COUNT( ID ) AS 'sum' FROM ( SELECT fm.AGENCY_ID, fm.ID, - IFNULL( fl.score, 80 ) AS "score" + IFNULL( IS_SATISFIED, 1 ) AS "score" FROM fact_origin_project_main_daily fm - INNER JOIN dim_agency da ON fm.AGENCY_ID = da.ID - AND da.`LEVEL` = #{level} - LEFT JOIN ( - SELECT - f.PROJECT_ID, - AVG( CASE ACTION_CODE WHEN 'bad' THEN 60 WHEN 'perfect' THEN 100 ELSE 80 END ) AS score - FROM - fact_origin_project_log_daily f - INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID - AND da.`LEVEL` = #{level} - WHERE - ( ACTION_CODE = 'bad' OR ACTION_CODE = 'good' OR ACTION_CODE = 'perfect' ) - AND f.CUSTOMER_ID = #{customerId} - AND f.MONTH_ID = #{monthId} - GROUP BY - PROJECT_ID - ) fl ON fm.ID = fl.PROJECT_ID WHERE fm.CUSTOMER_ID = #{customerId} AND fm.MONTH_ID = #{monthId} AND fm.PROJECT_STATUS = 'closed' + AND fm.ORIGIN = 'issue' ) a GROUP BY AGENCY_ID @@ -552,4 +523,145 @@ GROUP BY PROJECT_ID HAVING COUNT(DISTINCT(ORG_ID)) = 1 + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index dc6b766fb7..c6e024c502 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -240,7 +240,7 @@ INNER JOIN dim_agency da ON fm.AGENCY_ID = da.ID AND da.`LEVEL` = #{level} WHERE - fm.PROJECT_STATUS = 'close' + fm.PROJECT_STATUS = 'closed' AND fm.CUSTOMER_ID = #{customerId} AND fm.MONTH_ID = #{monthId} GROUP BY @@ -254,7 +254,7 @@ INNER JOIN dim_agency da ON fm.AGENCY_ID = da.ID AND da.`LEVEL` = #{level} WHERE - fm.PROJECT_STATUS = 'close' + fm.PROJECT_STATUS = 'closed' AND fm.CUSTOMER_ID = #{customerId} AND fm.MONTH_ID = #{monthId} AND fm.IS_RESOLVED = 'resolved' @@ -274,7 +274,7 @@ FROM fact_origin_project_main_daily fm WHERE - fm.PROJECT_STATUS = 'close' + fm.PROJECT_STATUS = 'closed' AND fm.GRID_ID != '' AND fm.CUSTOMER_ID = #{customerId} AND fm.MONTH_ID = #{monthId} @@ -287,7 +287,7 @@ FROM fact_origin_project_main_daily fm WHERE - fm.PROJECT_STATUS = 'close' + fm.PROJECT_STATUS = 'closed' AND fm.GRID_ID != '' AND fm.CUSTOMER_ID = #{customerId} AND fm.MONTH_ID = #{monthId} @@ -807,5 +807,111 @@ AND ORIGIN = 'issue' GROUP BY GRID_ID + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml index 755e3aab60..800adbfb30 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -256,6 +256,21 @@ CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml new file mode 100644 index 0000000000..b38ec6cce5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_govern_rank_data_daily + where CUSTOMER_ID = #{customerId} + AND DATE_ID <= #{dateId} + + and ORG_TYPE=#{orgType} + + + and + ( + + ORG_ID = #{orgId} + + ) + + limit #{deleteSize} + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index 58dd19a9e5..3c5ebd884f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -145,4 +145,21 @@ AND DATE_FORMAT(CREATED_TIME,'%Y%m%d')=#{dateId} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml index 209d13e228..821ca24983 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml @@ -131,6 +131,17 @@ AND CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + \ No newline at end of file