|
|
@ -184,7 +184,7 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 评价周期内被吹哨且被办结(无论是哪一级办结)的项目数 |
|
|
|
* @Description 办结率 |
|
|
|
* @param agencies |
|
|
|
* @param dimId |
|
|
|
* @param dateType - 日期维度类型 month date week quarter year |
|
|
@ -193,12 +193,26 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr |
|
|
|
* @date 2020.09.23 10:06 |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public Map<String, Integer> getWhistledAgencyClosedProjectCount(List<String> agencies, String customerId,String dimId, String dateType) { |
|
|
|
Map<String,Integer> result = new HashMap<>(); |
|
|
|
public Map<String, BigDecimal> getHandlingRatio(List<String> agencies, String customerId,String dimId, String dateType) { |
|
|
|
//计算方式:“评价周期内被吹哨且办结(无论是哪一级办结)的项目数”/“评价周期内被吹哨的所有项目数”
|
|
|
|
|
|
|
|
Map<String,BigDecimal> result = new HashMap<>(); |
|
|
|
List<ProjectParticipatedAgencyResultDTO> projectAgencyCount = baseDao.selectWhistledAgencyClosedProjectCount(agencies,customerId,dimId); |
|
|
|
if(!CollectionUtils.isEmpty(projectAgencyCount)){ |
|
|
|
result = projectAgencyCount.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount)); |
|
|
|
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){ |
|
|
|
result.put(agencyId,BigDecimal.ZERO); |
|
|
|
}else{ |
|
|
|
result.put(agencyId,new BigDecimal(count).divide(new BigDecimal(denominator), NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|