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 500fd52d48..9d116ed48c 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 @@ -204,4 +204,35 @@ public interface FactOriginProjectLogDailyDao extends BaseDao selectOrgSatisfaction(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("level")String level); + + /** + * 获取部门办结项目数 + * @author zhaoqifeng + * @date 2020/10/16 17:09 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectDeptClosedProject(@Param("customerId") String customerId, @Param("monthId") String monthId); + + + /** + * 部门办结项目满意度 + * @author zhaoqifeng + * @date 2020/9/20 16:44 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectDeptSatisfaction(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * 网格结案率统计 + * @author zhaoqifeng + * @date 2020/9/20 16:44 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectGridClosed(@Param("customerId") String customerId, @Param("monthId") String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java index 6d88f7d950..32aa22fbbf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java @@ -96,4 +96,14 @@ public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao selectAgencyResponseCoefficient(@Param("customerId") String customerId,@Param("dimId") String dimId, @Param("dateType") String dateType); + + /** + * 部门处理效率统计 + * @author zhaoqifeng + * @date 2020/10/19 9:31 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectDeptHandle(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictDepartmentServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictDepartmentServiceImpl.java index 0a47c6d86a..d701e89da9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictDepartmentServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictDepartmentServiceImpl.java @@ -9,13 +9,11 @@ import com.epmet.dto.stats.DimDepartmentDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity; import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollDistrictDepartmentService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; -import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyService; -import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService; import com.epmet.service.stats.DimDepartmentService; -import com.epmet.service.stats.FactArticlePublishedDepartmentDailyService; import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -41,12 +39,6 @@ public class IndexCollDistrictDepartmentServiceImpl implements IndexCollDistrict private FactOriginProjectLogDailyService factOriginProjectLogDailyService; @Autowired private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao; - @Autowired - private FactOriginProjectMainDailyService factOriginProjectMainDailyService; - @Autowired - private FactArticlePublishedDepartmentDailyService factArticlePublishedDepartmentDailyService; - @Autowired - private FactIndexPartyAblityOrgMonthlyService factIndexPartyAblityOrgMonthlyService; @Override public void saveDepartmentAbility(String customerId, String dateId) { @@ -97,7 +89,43 @@ public class IndexCollDistrictDepartmentServiceImpl implements IndexCollDistrict })); } - //TODO 区直部门办结项目满意度 暂时无法统计 + //办结项目数 办结率 + List closedList = factOriginProjectLogDailyService.getDeptClosedProject(customerId, dimId.getMonthId()); + if (CollectionUtils.isNotEmpty(closedList)) { + list.forEach(entity -> closedList.stream().filter(dto -> dto.getOrgId().equals(entity.getDeptId())).forEach(item -> { + entity.setClosedProjectCount(item.getCount()); + if (item.getSum() != NumConstant.ZERO) { + BigDecimal count = new BigDecimal(item.getCount()); + BigDecimal sum = new BigDecimal(item.getSum()); + entity.setClosedProjectRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //部门办结项目满意度 + List satisfactions = factOriginProjectLogDailyService.getDeptSatisfaction(customerId, dimId.getMonthId()); + if (CollectionUtils.isNotEmpty(satisfactions)) { + list.forEach(entity -> satisfactions.stream().filter(dto -> dto.getOrgId().equals(entity.getDeptId())).forEach(item -> { + if (item.getCount() != NumConstant.ZERO) { + BigDecimal count = new BigDecimal(item.getCount()); + entity.setClosedProjectRatio(item.getRatio().divide(count, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //部门办结项目的处理效率 + List handle = factOriginProjectOrgPeriodDailyDao.selectDeptHandle(customerId, dimId.getMonthId()); + if (CollectionUtils.isNotEmpty(handle)) { + list.forEach(entity -> handle.stream().filter(dto -> dto.getOrgId().equals(entity.getDeptId())).forEach(item -> { + if (item.getCount() != NumConstant.ZERO) { + BigDecimal count = new BigDecimal(item.getCount()); + BigDecimal sum = new BigDecimal(item.getSum()); + BigDecimal one = new BigDecimal(NumConstant.ONE); + entity.setClosedProjectRatio(one.divide(sum.divide(count), NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + factIndexGovrnAblityDeptMonthlyService.deleteByCustomer(customerId, dimId.getMonthId()); factIndexGovrnAblityDeptMonthlyService.insertBatch(list); 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 dbedbb762d..3df3700c0a 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 @@ -239,4 +239,33 @@ public interface FactOriginProjectLogDailyService extends BaseService getOrgSatisfaction(String customerId, String monthId, String level); + /** + * 获取部门办结项目数 + * @author zhaoqifeng + * @date 2020/10/16 17:08 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getDeptClosedProject(String customerId, String monthId); + + /** + * 部门办结项目满意度 + * @author zhaoqifeng + * @date 2020/10/16 17:50 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getDeptSatisfaction(String customerId, String monthId); + + /** + * 网格结案率统计 + * @author zhaoqifeng + * @date 2020/10/19 11:58 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getGridClosed(String customerId, String monthId); } \ 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/FactOriginProjectOrgPeriodDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectOrgPeriodDailyService.java index 2186274fe5..5820d9c2cf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectOrgPeriodDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectOrgPeriodDailyService.java @@ -23,4 +23,14 @@ public interface FactOriginProjectOrgPeriodDailyService extends BaseService */ List getResponsiveness(String customerId, String monthId, String level, String orgType); + + /** + * 部门处理效率统计 + * @author zhaoqifeng + * @date 2020/10/19 9:38 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getDeptHandle(String customerId, String monthId); } 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 d7c6a7e7de..28aba51b63 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 @@ -295,5 +295,47 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2020/10/16 17:08 + */ + @Override + public List getDeptClosedProject(String customerId, String monthId) { + return baseDao.selectDeptClosedProject(customerId, monthId); + } + + /** + * 部门办结项目满意度 + * + * @param customerId + * @param monthId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/16 17:50 + */ + @Override + public List getDeptSatisfaction(String customerId, String monthId) { + return baseDao.selectDeptSatisfaction(customerId, monthId); + } + + /** + * 网格结案率统计 + * + * @param customerId + * @param monthId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/19 11:58 + */ + @Override + public List getGridClosed(String customerId, String monthId) { + return baseDao.selectGridClosed(customerId, monthId); + } + } \ 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/FactOriginProjectOrgPeriodDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectOrgPeriodDailyServiceImpl.java index 2631b4ad50..df9d46479d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectOrgPeriodDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectOrgPeriodDailyServiceImpl.java @@ -23,4 +23,18 @@ public class FactOriginProjectOrgPeriodDailyServiceImpl extends BaseServiceImpl< public List getResponsiveness(String customerId, String monthId, String level, String orgType) { return baseDao.selectResponsiveness(customerId, monthId, level, orgType); } + + /** + * 部门处理效率统计 + * + * @param customerId + * @param monthId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/19 9:38 + */ + @Override + public List getDeptHandle(String customerId, String monthId) { + return baseDao.selectDeptHandle(customerId, monthId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java index 6c3a254c9d..4e7ecc27aa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java @@ -101,15 +101,25 @@ public class OrgRankExtractServiceImpl implements OrgRankExtractService { )); } //结案率 结案数/项目数 - List abilityList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId); - if (CollectionUtils.isNotEmpty(abilityList)) { - list.forEach(entity -> abilityList.stream().filter(item -> item.getGridId().equals(entity.getOrgId())).forEach(dto -> { - if (dto.getProjectTotal() != NumConstant.ZERO) { - BigDecimal total = new BigDecimal(dto.getProjectTotal()); - BigDecimal closed = new BigDecimal(dto.getResolveProjectCount()); - entity.setCloseProjectRatio(closed.multiply(hundred).divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); +// List abilityList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId); +// if (CollectionUtils.isNotEmpty(abilityList)) { +// list.forEach(entity -> abilityList.stream().filter(item -> item.getGridId().equals(entity.getOrgId())).forEach(dto -> { +// if (dto.getProjectTotal() != NumConstant.ZERO) { +// BigDecimal total = new BigDecimal(dto.getProjectTotal()); +// BigDecimal closed = new BigDecimal(dto.getResolveProjectCount()); +// entity.setCloseProjectRatio(closed.multiply(hundred).divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); +// } +// +// })); +// } + List closed = factOriginProjectLogDailyService.getGridClosed(customerId, monthId); + if (CollectionUtils.isNotEmpty(closed)) { + list.forEach(entity -> closed.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.setCloseProjectRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); } - })); } //满意率 满意和非常满意占比 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 86551a98e2..ef5afbe901 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 @@ -125,7 +125,6 @@ FROM fact_origin_project_log_daily fopld INNER JOIN dim_agency da ON fopld.AGENCY_ID = da.ID - AND da.`LEVEL` = #{level} WHERE fopld.IS_ACTIVE = 0 AND fopld.ACTION_CODE = 'transfer' @@ -425,4 +424,93 @@ GROUP BY AGENCY_ID + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml index 0c1010e48c..58c4c3ff64 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml @@ -54,7 +54,6 @@ FROM fact_origin_project_org_period_daily f INNER JOIN dim_agency da ON f.ORG_ID = da.ID - AND da.`LEVEL` = #{level} WHERE f.ORG_TYPE = #{orgType} AND DATE_FORMAT(INFORMED_DATE, '%Y%m') = #{monthId} @@ -180,4 +179,21 @@ GROUP BY ORG_ID + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml index fdfc9a5c31..7b20671a99 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml @@ -60,7 +60,6 @@ FROM dim_department dd INNER JOIN dim_agency da ON dd.AGENCY_ID = da.ID - AND da.`LEVEL` = 'district' WHERE dd.CUSTOMER_ID = #{customerId}