Browse Source

Merge remote-tracking branch 'remotes/origin/dev_difficulty_data' into dev_temp

dev_shibei_match
jianjun 5 years ago
parent
commit
ea37ac4335
  1. 7
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/DifficultyRankFormDTO.java
  2. 15
      epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml
  3. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java
  4. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java
  5. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java
  6. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java
  7. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java
  8. 41
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java

7
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;
}

15
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},'%')
<if test="status!= null and status != ''">
AND diff.EVENT_STATUS_CODE = #{status}
</if>
<choose>
<when test="orgType != null and orgType == 'grid'">
AND diff.ORG_ID = #{agencyId,jdbcType=VARCHAR}
</when>
<otherwise>
AND diff.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%')
</otherwise>
</choose>
<if test="status!= null and status != ''">
AND diff.EVENT_STATUS_CODE = #{status}
</if>
ORDER BY
CASE #{type} WHEN 'timelongest' THEN diff.EVENT_COST_TIME
WHEN 'mosthandled' THEN diff.EVENT_HANDLED_COUNT

10
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<String> agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList());
List<String> agencies = agencyList.stream().map(DimAgencyDTO::getId).distinct().collect(Collectors.toList());
//办结数
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month");
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies, customerId, dimId.getMonthId());
//办结率
Map<String, BigDecimal> handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies,customerId,dimId.getMonthId(),"month");
Map<String, BigDecimal> handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies, customerId, dimId.getMonthId());
//处理效率
Map<String,BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month");
list.forEach(entity ->{
Map<String, BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId, dimId.getMonthId());
list.forEach(entity -> {
//办结数
entity.setClosedProjectCount(Optional.ofNullable(agencyHandleCount.get(entity.getAgencyId())).orElse(NumConstant.ZERO));
//办结率

12
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<String> agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList());
List<String> agencies = agencyList.stream().map(DimAgencyDTO::getId).distinct().collect(Collectors.toList());
//办结数
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month");
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies, customerId, dimId.getMonthId());
//办结率
Map<String, BigDecimal> handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies,customerId,dimId.getMonthId(),"month");
Map<String, BigDecimal> handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies, customerId, dimId.getMonthId());
//处理效率
Map<String,BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month");
list.forEach(entity ->{
Map<String, BigDecimal> 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));
//办结效率

12
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<String> agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList());
List<String> agencies = agencyList.stream().map(DimAgencyDTO::getId).distinct().collect(Collectors.toList());
//办结数
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month");
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies, customerId, dimId.getMonthId());
//办结率
Map<String, BigDecimal> handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies,customerId,dimId.getMonthId(),"month");
Map<String, BigDecimal> handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies, customerId, dimId.getMonthId());
//处理效率
Map<String,BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month");
list.forEach(entity ->{
Map<String, BigDecimal> 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));
//办结效率

6
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);

12
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<FactOrigin
List<OrgStatisticsResultDTO> getDepTransferCount(String customerId, String monthId, String level);
/**
* @Description 查询各机关办结(办结的含义指每个项目的结点中最高的机关)了多少项目
* @param agencies
* @return
* @Description 查询各机关办结(办结的含义指每个项目的结点中最高的机关)了多少项目
* @author wangc
* @date 2020.09.20 23:46
**/
Map<String,Integer> getProjectHandledAgency(List<String> agencies, String customerId, String dimId,String dateType);
Map<String, Integer> getProjectHandledAgency(List<String> agencies, String customerId, String dimId);
/**
* @Description 办结率
@ -184,8 +184,8 @@ public interface FactOriginProjectLogDailyService extends BaseService<FactOrigin
* @return
* @author wangc
* @date 2020.09.23 10:06
**/
Map<String,BigDecimal> getHandlingRatio(List<String> agencies, String customerId,String dimId,String dateType);
**/
Map<String, BigDecimal> getHandlingRatio(List<String> agencies, String customerId, String dimId);
/**
* @Description 计算机关办结项目效率
@ -193,8 +193,8 @@ public interface FactOriginProjectLogDailyService extends BaseService<FactOrigin
* @return
* @author wangc
* @date 2020.09.21 02:16
**/
Map<String, BigDecimal> getAgencyWorkPieceRatio( String customerId,String dimId,String dateType);
**/
Map<String, BigDecimal> getAgencyWorkPieceRatio(String customerId, String dimId);
/**
* 网格项目响应度

41
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<FactOr
}
/**
* @Description 查询各机关办结的项目数
* @param agencies
* @return
* @Description 查询各机关办结的项目数
* @author wangc
* @date 2020.09.20 23:46
**/
@Override
public Map<String, Integer> getProjectHandledAgency(List<String> agencies, String customerId,String dimId, String dateType) {
public Map<String, Integer> getProjectHandledAgency(List<String> agencies, String customerId, String dimId) {
Map<String, Integer> result = new HashMap<>();
List<ProjectParticipatedAgencyResultDTO> countList = baseDao.selectAgencyHandledProjectCount(agencies,customerId,dimId);
if(!CollectionUtils.isEmpty(countList)){
result = countList.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount));
List<ProjectParticipatedAgencyResultDTO> 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<String, BigDecimal> getHandlingRatio(List<String> agencies, String customerId,String dimId, String dateType) {
public Map<String, BigDecimal> getHandlingRatio(List<String> agencies, String customerId, String dimId) {
//计算方式:“评价周期内被吹哨且办结(无论是哪一级办结)的项目数”/“评价周期内被吹哨的所有项目数”
Map<String,BigDecimal> result = new HashMap<>();
List<ProjectParticipatedAgencyResultDTO> projectAgencyCount = baseDao.selectWhistledAgencyClosedProjectCount(agencies,customerId,dimId);
if(!CollectionUtils.isEmpty(projectAgencyCount)){
Map<String,Integer> whistledAndHandledProjectTotalMap = projectAgencyCount.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount));
List<ProjectParticipatedAgencyResultDTO> whistledProjectTotal = baseDao.selectAgencyWhistledCount(agencies,customerId,dimId);
Map<String,Integer> whistledProjectTotalMap = whistledProjectTotal.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount));
whistledAndHandledProjectTotalMap.forEach((agencyId,count) -> {
Map<String, BigDecimal> result = new HashMap<>();
List<ProjectParticipatedAgencyResultDTO> projectAgencyCount = baseDao.selectWhistledAgencyClosedProjectCount(agencies, customerId, dimId);
if (!CollectionUtils.isEmpty(projectAgencyCount)) {
Map<String, Integer> whistledAndHandledProjectTotalMap = projectAgencyCount.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId, ProjectParticipatedAgencyResultDTO::getCount));
List<ProjectParticipatedAgencyResultDTO> whistledProjectTotal = baseDao.selectAgencyWhistledCount(agencies, customerId, dimId);
Map<String, Integer> 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<FactOr
}
/**
* @Description 计算机关办结项目效率
* @param
* @return
* @Description 计算机关办结项目效率
* @author wangc
* @date 2020.09.21 02:16
**/
@Override
public Map<String, BigDecimal> getAgencyWorkPieceRatio(String customerId,String dimId, String dateType) {
public Map<String, BigDecimal> getAgencyWorkPieceRatio(String customerId, String dimId) {
//计算方法 : 评价周期内办结项目的平均处理时长的倒数
//1.评价周期内结案了的项目
List<ProjectParticipatedAgencyResultDTO> projectsHandledByAgency = baseDao.selectProjectIdHandledByAgency(customerId,dimId);
Map<String,BigDecimal> efficiencyMap = new HashMap<>();
if(!CollectionUtils.isEmpty(projectsHandledByAgency)){
Map<String,List<String>> agencyProjectsMap = new HashMap<>();
List<ProjectParticipatedAgencyResultDTO> projectsHandledByAgency = baseDao.selectProjectIdHandledByAgency(customerId, dimId);
Map<String, BigDecimal> efficiencyMap = new HashMap<>();
if (!CollectionUtils.isEmpty(projectsHandledByAgency)) {
Map<String, List<String>> agencyProjectsMap = new HashMap<>();
projectsHandledByAgency.forEach(o -> {
String agencyId = o.getAgencyId();

Loading…
Cancel
Save