diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/DifficultyRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/DifficultyRankFormDTO.java index d043180705..5a3936db6a 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/DifficultyRankFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/DifficultyRankFormDTO.java @@ -26,7 +26,7 @@ public class DifficultyRankFormDTO implements Serializable { /** * 排序类型 耗时最长:timelongest;涉及部门最多:mostdepts;处理次数:mosthandled */ - @NotBlank(message = "排序类型不能为空",groups = {DifficultyRankInternalGroup.class}) + @NotBlank(message = "排序类型不能为空", groups = {DifficultyRankInternalGroup.class}) private String type; /** * 获取数据个数 默认前10 @@ -35,4 +35,9 @@ public class DifficultyRankFormDTO implements Serializable { @Min(value = 1, groups = {DifficultyRankInternalGroup.class}) private Integer pageNo; + + /** + * 组织类型: 网格:grid ; 组织:agency + */ + private String orgType; } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml index 8e5bace8d8..6369d52db7 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml @@ -249,10 +249,17 @@ screen_difficulty_data diff WHERE diff.DEL_FLAG = '0' - AND diff.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%') - - AND diff.EVENT_STATUS_CODE = #{status} - + + + AND diff.ORG_ID = #{agencyId,jdbcType=VARCHAR} + + + AND diff.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%') + + + + AND diff.EVENT_STATUS_CODE = #{status} + ORDER BY CASE #{type} WHEN 'timelongest' THEN diff.EVENT_COST_TIME WHEN 'mosthandled' THEN diff.EVENT_HANDLED_COUNT diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java index 062990b4ed..13a3103e83 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java @@ -135,14 +135,14 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService } - List agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList()); + List agencies = agencyList.stream().map(DimAgencyDTO::getId).distinct().collect(Collectors.toList()); //办结数 - Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month"); + Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies, customerId, dimId.getMonthId()); //办结率 - Map handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies,customerId,dimId.getMonthId(),"month"); + Map handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies, customerId, dimId.getMonthId()); //处理效率 - Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month"); - list.forEach(entity ->{ + Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId, dimId.getMonthId()); + list.forEach(entity -> { //办结数 entity.setClosedProjectCount(Optional.ofNullable(agencyHandleCount.get(entity.getAgencyId())).orElse(NumConstant.ZERO)); //办结率 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java index aeaa04000c..494f8f51c1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java @@ -128,16 +128,16 @@ public class IndexCollDistrictServiceImpl implements IndexCollDistrictService { })); } - List agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList()); + List agencies = agencyList.stream().map(DimAgencyDTO::getId).distinct().collect(Collectors.toList()); //办结数 - Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month"); + Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies, customerId, dimId.getMonthId()); //办结率 - Map handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies,customerId,dimId.getMonthId(),"month"); + Map handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies, customerId, dimId.getMonthId()); //处理效率 - Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month"); - list.forEach(entity ->{ + Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId, dimId.getMonthId()); + list.forEach(entity -> { //办结数 - entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId())); + entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null ? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId())); //办结率 entity.setClosedProjectRatio(Optional.ofNullable(handlingRatioMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO)); //办结效率 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java index 8331905d41..4d21057556 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java @@ -126,16 +126,16 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService { })); } - List agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList()); + List agencies = agencyList.stream().map(DimAgencyDTO::getId).distinct().collect(Collectors.toList()); //办结数 - Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month"); + Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies, customerId, dimId.getMonthId()); //办结率 - Map handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies,customerId,dimId.getMonthId(),"month"); + Map handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies, customerId, dimId.getMonthId()); //处理效率 - Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month"); - list.forEach(entity ->{ + Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId, dimId.getMonthId()); + list.forEach(entity -> { //办结数 - entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId())); + entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null ? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId())); //办结率 entity.setClosedProjectRatio(Optional.ofNullable(handlingRatioMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO)); //办结效率 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java index 77ac5f2fc7..80e087bc3f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java @@ -2,11 +2,9 @@ package com.epmet.service.evaluationindex.extract.dataToIndex.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dto.extract.form.ExtractIndexFormDTO; import com.epmet.service.evaluationindex.extract.dataToIndex.*; import com.epmet.service.stats.DimCustomerService; -import com.epmet.util.DimIdGenerator; import com.google.common.util.concurrent.ThreadFactoryBuilder; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -16,7 +14,6 @@ import org.springframework.util.CollectionUtils; import java.time.LocalDate; import java.util.ArrayList; -import java.util.Date; import java.util.List; import java.util.concurrent.*; @@ -107,16 +104,19 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService log.error("抽取【网格服务能力数据】发生异常,参数:" + JSON.toJSONString(param), e); } try{ + //dimAgency indexCollStreetService.saveStreetAbility(customerId, monthId); }catch (Exception e){ log.error("抽取【街道治理能力-街道党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e); } try{ + //dimAgency indexCollCommunityService.saveCommunityAbility(customerId, monthId); }catch (Exception e){ log.error("抽取【社区治理能力-社区党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e); } try{ + //dimAgency indexCollDistrictService.saveDistrictAbility(customerId, monthId); }catch (Exception e){ log.error("抽取【全区治理能力-全区党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e); 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 d473e0aabe..2a3c3ab304 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 @@ -168,13 +168,13 @@ public interface FactOriginProjectLogDailyService extends BaseService getDepTransferCount(String customerId, String monthId, String level); /** - * @Description 查询各机关办结(办结的含义指每个项目的结点中最高的机关)了多少项目 * @param agencies * @return + * @Description 查询各机关办结(办结的含义指每个项目的结点中最高的机关)了多少项目 * @author wangc * @date 2020.09.20 23:46 **/ - Map getProjectHandledAgency(List agencies, String customerId, String dimId,String dateType); + Map getProjectHandledAgency(List agencies, String customerId, String dimId); /** * @Description 办结率 @@ -184,8 +184,8 @@ public interface FactOriginProjectLogDailyService extends BaseService getHandlingRatio(List agencies, String customerId,String dimId,String dateType); + **/ + Map getHandlingRatio(List agencies, String customerId, String dimId); /** * @Description 计算机关办结项目效率 @@ -193,8 +193,8 @@ public interface FactOriginProjectLogDailyService extends BaseService getAgencyWorkPieceRatio( String customerId,String dimId,String dateType); + **/ + Map getAgencyWorkPieceRatio(String customerId, String dimId); /** * 网格项目响应度 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 ec1429618d..7b3f127cd2 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 @@ -38,7 +38,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; -import javax.naming.LinkLoopException; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.*; @@ -171,43 +170,43 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl getProjectHandledAgency(List agencies, String customerId,String dimId, String dateType) { + public Map getProjectHandledAgency(List agencies, String customerId, String dimId) { Map result = new HashMap<>(); - List countList = baseDao.selectAgencyHandledProjectCount(agencies,customerId,dimId); - if(!CollectionUtils.isEmpty(countList)){ - result = countList.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount)); + List countList = baseDao.selectAgencyHandledProjectCount(agencies, customerId, dimId); + if (!CollectionUtils.isEmpty(countList)) { + result = countList.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId, ProjectParticipatedAgencyResultDTO::getCount)); } return result; } /** - * @Description 办结率 * @param agencies * @param dimId * @param dateType - 日期维度类型 month date week quarter year * @return + * @Description 办结率 * @author wangc * @date 2020.09.23 10:06 **/ @Override - public Map getHandlingRatio(List agencies, String customerId,String dimId, String dateType) { + public Map getHandlingRatio(List agencies, String customerId, String dimId) { //计算方式:“评价周期内被吹哨且办结(无论是哪一级办结)的项目数”/“评价周期内被吹哨的所有项目数” - Map result = new HashMap<>(); - List projectAgencyCount = baseDao.selectWhistledAgencyClosedProjectCount(agencies,customerId,dimId); - if(!CollectionUtils.isEmpty(projectAgencyCount)){ - Map whistledAndHandledProjectTotalMap = projectAgencyCount.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount)); - List whistledProjectTotal = baseDao.selectAgencyWhistledCount(agencies,customerId,dimId); - Map whistledProjectTotalMap = whistledProjectTotal.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount)); - whistledAndHandledProjectTotalMap.forEach((agencyId,count) -> { + Map result = new HashMap<>(); + List projectAgencyCount = baseDao.selectWhistledAgencyClosedProjectCount(agencies, customerId, dimId); + if (!CollectionUtils.isEmpty(projectAgencyCount)) { + Map whistledAndHandledProjectTotalMap = projectAgencyCount.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId, ProjectParticipatedAgencyResultDTO::getCount)); + List whistledProjectTotal = baseDao.selectAgencyWhistledCount(agencies, customerId, dimId); + Map whistledProjectTotalMap = whistledProjectTotal.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId, ProjectParticipatedAgencyResultDTO::getCount)); + whistledAndHandledProjectTotalMap.forEach((agencyId, count) -> { //分母 被吹哨项目数 Integer denominator = whistledProjectTotalMap.get(agencyId); if(null == denominator || NumConstant.ZERO == denominator){ @@ -222,22 +221,22 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl getAgencyWorkPieceRatio(String customerId,String dimId, String dateType) { + public Map getAgencyWorkPieceRatio(String customerId, String dimId) { //计算方法 : 评价周期内办结项目的平均处理时长的倒数 //1.评价周期内结案了的项目 - List projectsHandledByAgency = baseDao.selectProjectIdHandledByAgency(customerId,dimId); - Map efficiencyMap = new HashMap<>(); - if(!CollectionUtils.isEmpty(projectsHandledByAgency)){ - Map> agencyProjectsMap = new HashMap<>(); + List projectsHandledByAgency = baseDao.selectProjectIdHandledByAgency(customerId, dimId); + Map efficiencyMap = new HashMap<>(); + if (!CollectionUtils.isEmpty(projectsHandledByAgency)) { + Map> agencyProjectsMap = new HashMap<>(); projectsHandledByAgency.forEach(o -> { String agencyId = o.getAgencyId();