|  |  | @ -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(); | 
			
		
	
	
		
			
				
					|  |  | 
 |