|
|
@ -165,42 +165,26 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 查询各项目经手的最高机关Id |
|
|
|
* @param customerId |
|
|
|
* @Description 查询各机关办结的项目数 |
|
|
|
* @param agencies |
|
|
|
* @return |
|
|
|
* @author wangc |
|
|
|
* @date 2020.09.20 23:46 |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public Map<String, Integer> getProjectHandledAgency(String customerId, String dimId, String dateType) { |
|
|
|
public Map<String, Integer> getProjectHandledAgency(List<String> agencies, String customerId,String dimId, String dateType) { |
|
|
|
Map<String, Integer> result = new HashMap<>(); |
|
|
|
List<ProjectParticipatedAgencyResultDTO> projectAgency = baseDao.selectProjectParticipatedAgency(customerId,dimId,dateType); |
|
|
|
if(!CollectionUtils.isEmpty(projectAgency)){ |
|
|
|
Map<String,List<ProjectParticipatedAgencyResultDTO>> map |
|
|
|
= projectAgency.stream().collect(Collectors.groupingBy(ProjectParticipatedAgencyResultDTO :: getProjectId)); |
|
|
|
|
|
|
|
map.forEach((key ,agencies) ->{ |
|
|
|
if(!CollectionUtils.isEmpty(agencies)) { |
|
|
|
String highest = agencies.get(NumConstant.ZERO).getLevel(); |
|
|
|
for (int i = NumConstant.ZERO; i < agencies.size(); i++) { |
|
|
|
if(StringUtils.equals(agencies.get(i).getLevel(),highest)){ |
|
|
|
if(null != result.get(agencies.get(i).getAgencyId())){ |
|
|
|
result.put(key,result.get(agencies.get(i).getAgencyId()) + NumConstant.ONE); |
|
|
|
}else{ |
|
|
|
result.put(key,NumConstant.ONE); |
|
|
|
} |
|
|
|
}else break; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
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 customerId |
|
|
|
* @Description 查询机关单位经手的项目数,去重 |
|
|
|
* @param agencies |
|
|
|
* @param dimId |
|
|
|
* @param dateType - 日期维度类型 month date week quarter year |
|
|
|
* @return |
|
|
@ -208,30 +192,24 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr |
|
|
|
* @date 2020.09.23 10:06 |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public Map<String, Integer> getCountOfProjectsHandledByAgency(String customerId, String dimId, String dateType) { |
|
|
|
public Map<String, Integer> getCountOfDealingAgency(List<String> agencies, String customerId,String dimId, String dateType) { |
|
|
|
Map<String,Integer> result = new HashMap<>(); |
|
|
|
List<ProjectParticipatedAgencyResultDTO> projectAgencyCount = baseDao.selectProjectParticipatedAgency(customerId,dimId,dateType); |
|
|
|
List<ProjectParticipatedAgencyResultDTO> projectAgencyCount = baseDao.selectProjectParticipatedAgency(agencies,dimId); |
|
|
|
if(!CollectionUtils.isEmpty(projectAgencyCount)){ |
|
|
|
Map<String,List<ProjectParticipatedAgencyResultDTO>> map = |
|
|
|
projectAgencyCount.stream().collect(Collectors.groupingBy(ProjectParticipatedAgencyResultDTO :: getProjectId)); |
|
|
|
|
|
|
|
map.forEach((agency,handledProjectList) -> { |
|
|
|
result.put(agency,handledProjectList.size()); |
|
|
|
}); |
|
|
|
return result; |
|
|
|
result = projectAgencyCount.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount)); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 计算机关办结项目效率 |
|
|
|
* @param customerId |
|
|
|
* @param agencies |
|
|
|
* @return |
|
|
|
* @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(List<String> agencies, String customerId,String dimId, String dateType) { |
|
|
|
//网格、部门的办结系数
|
|
|
|
List<OrgResponseTimeResultDTO> gridDeptResponse = projectOrgPeriodDailyDao.selectSubOrgResponseCoefficient(customerId, dimId, dateType); |
|
|
|
//机关的办结系数
|
|
|
|