|  | @ -19,6 +19,7 @@ package com.epmet.service.evaluationindex.extract.todata.impl; | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |  |  | import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.commons.tools.constant.NumConstant; |  |  | import com.epmet.commons.tools.constant.NumConstant; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import com.epmet.constant.IndexCalConstant; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.constant.RoleKeyConstants; |  |  | import com.epmet.constant.RoleKeyConstants; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.dao.evaluationindex.extract.FactGridMemberStatisticsDailyDao; |  |  | import com.epmet.dao.evaluationindex.extract.FactGridMemberStatisticsDailyDao; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.dto.extract.result.OrgStatisticsResultDTO; |  |  | import com.epmet.dto.extract.result.OrgStatisticsResultDTO; | 
			
		
	
	
		
		
			
				
					|  | @ -26,6 +27,8 @@ import com.epmet.dto.org.CustomerStaffGridDTO; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.dto.user.result.StaffRoleInfoDTO; |  |  | import com.epmet.dto.user.result.StaffRoleInfoDTO; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.entity.evaluationindex.extract.FactGridMemberStatisticsDailyEntity; |  |  | import com.epmet.entity.evaluationindex.extract.FactGridMemberStatisticsDailyEntity; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.service.evaluationindex.extract.todata.FactGridMemberStatisticsDailyService; |  |  | import com.epmet.service.evaluationindex.extract.todata.FactGridMemberStatisticsDailyService; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; |  |  | import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.service.org.CustomerGridService; |  |  | import com.epmet.service.org.CustomerGridService; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.service.user.UserService; |  |  | import com.epmet.service.user.UserService; | 
			
		
	
	
		
		
			
				
					|  | @ -54,6 +57,10 @@ public class FactGridMemberStatisticsDailyServiceImpl extends BaseServiceImpl<Fa | 
			
		
	
		
		
			
				
					|  |  | 	private CustomerGridService customerGridService; |  |  | 	private CustomerGridService customerGridService; | 
			
		
	
		
		
			
				
					|  |  | 	@Resource |  |  | 	@Resource | 
			
		
	
		
		
			
				
					|  |  | 	private FactOriginProjectMainDailyService factOriginProjectMainDailyService; |  |  | 	private FactOriginProjectMainDailyService factOriginProjectMainDailyService; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 	@Resource | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 	private FactOriginIssueLogDailyService factOriginIssueLogDailyService; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 	@Resource | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 	private FactOriginProjectLogDailyService factOriginProjectLogDailyService; | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | 	/** |  |  | 	/** | 
			
		
	
	
		
		
			
				
					|  | @ -105,11 +112,32 @@ public class FactGridMemberStatisticsDailyServiceImpl extends BaseServiceImpl<Fa | 
			
		
	
		
		
			
				
					|  |  | 		Map<String, List<OrgStatisticsResultDTO>> projectIncrMap = factOriginProjectMainDailyService.getMemberProjectCount(customerId, dateId, |  |  | 		Map<String, List<OrgStatisticsResultDTO>> projectIncrMap = factOriginProjectMainDailyService.getMemberProjectCount(customerId, dateId, | 
			
		
	
		
		
			
				
					|  |  | 				NumConstant.ONE); |  |  | 				NumConstant.ONE); | 
			
		
	
		
		
			
				
					|  |  | 		//议题转项目数
 |  |  | 		//议题转项目数
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		Map<String, List<OrgStatisticsResultDTO>> issueToProjectCountMap = factOriginIssueLogDailyService.getIssueToProjectCount(customerId, dateId, | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				NumConstant.ZERO); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		Map<String, List<OrgStatisticsResultDTO>> issueToProjectIncrMap = factOriginIssueLogDailyService.getIssueToProjectCount(customerId, dateId, | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				NumConstant.ONE); | 
			
		
	
		
		
			
				
					|  |  | 		//议题关闭数
 |  |  | 		//议题关闭数
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		Map<String, List<OrgStatisticsResultDTO>> closedIssueCountMap = factOriginIssueLogDailyService.getClosedIssueCount(customerId, dateId, | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				NumConstant.ZERO); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		Map<String, List<OrgStatisticsResultDTO>> closedIssueIncrMap = factOriginIssueLogDailyService.getClosedIssueCount(customerId, dateId, | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				NumConstant.ONE); | 
			
		
	
		
		
			
				
					|  |  | 		//项目响应数
 |  |  | 		//项目响应数
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		Map<String, List<OrgStatisticsResultDTO>> projectResponseCountMap = factOriginProjectLogDailyService.getProjectResponseCount(customerId, | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				dateId, NumConstant.ZERO); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		Map<String, List<OrgStatisticsResultDTO>> projectResponseIncrMap = factOriginProjectLogDailyService.getProjectResponseCount(customerId, dateId | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				, NumConstant.ONE); | 
			
		
	
		
		
			
				
					|  |  | 		//项目吹哨数
 |  |  | 		//项目吹哨数
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		Map<String, List<OrgStatisticsResultDTO>> projectTransferCountMap = factOriginProjectLogDailyService.getProjectTransferCount(customerId, | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				dateId, NumConstant.ZERO); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		Map<String, List<OrgStatisticsResultDTO>> projectTransferIncrMap = factOriginProjectLogDailyService.getProjectTransferCount(customerId, dateId | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				, NumConstant.ONE); | 
			
		
	
		
		
			
				
					|  |  | 		//项目结案数
 |  |  | 		//项目结案数
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		Map<String, List<OrgStatisticsResultDTO>> projectClosedCountMap = factOriginProjectLogDailyService.getProjectClosedCount(customerId, | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				dateId, NumConstant.ZERO); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		Map<String, List<OrgStatisticsResultDTO>> projectClosedIncrMap = factOriginProjectLogDailyService.getProjectClosedCount(customerId, dateId | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				, NumConstant.ONE); | 
			
		
	
		
		
			
				
					|  |  | 		list.forEach(item -> { |  |  | 		list.forEach(item -> { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			//项目立项数
 | 
			
		
	
		
		
			
				
					|  |  | 			List<OrgStatisticsResultDTO> projectCount = projectCountMap.get(item.getStaffId()); |  |  | 			List<OrgStatisticsResultDTO> projectCount = projectCountMap.get(item.getStaffId()); | 
			
		
	
		
		
			
				
					|  |  | 			if (CollectionUtils.isNotEmpty(projectCount)) { |  |  | 			if (CollectionUtils.isNotEmpty(projectCount)) { | 
			
		
	
		
		
			
				
					|  |  | 				projectCount.forEach(dto -> { |  |  | 				projectCount.forEach(dto -> { | 
			
		
	
	
		
		
			
				
					|  | @ -118,7 +146,7 @@ public class FactGridMemberStatisticsDailyServiceImpl extends BaseServiceImpl<Fa | 
			
		
	
		
		
			
				
					|  |  | 					} |  |  | 					} | 
			
		
	
		
		
			
				
					|  |  | 				}); |  |  | 				}); | 
			
		
	
		
		
			
				
					|  |  | 			} |  |  | 			} | 
			
		
	
		
		
			
				
					
					|  |  | 
 |  |  | 			//项目立项日增量
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  | 			List<OrgStatisticsResultDTO> projectIncr = projectIncrMap.get(item.getStaffId()); |  |  | 			List<OrgStatisticsResultDTO> projectIncr = projectIncrMap.get(item.getStaffId()); | 
			
		
	
		
		
			
				
					|  |  | 			if (CollectionUtils.isNotEmpty(projectIncr)) { |  |  | 			if (CollectionUtils.isNotEmpty(projectIncr)) { | 
			
		
	
		
		
			
				
					|  |  | 				projectIncr.forEach(dto -> { |  |  | 				projectIncr.forEach(dto -> { | 
			
		
	
	
		
		
			
				
					|  | @ -127,8 +155,107 @@ public class FactGridMemberStatisticsDailyServiceImpl extends BaseServiceImpl<Fa | 
			
		
	
		
		
			
				
					|  |  | 					} |  |  | 					} | 
			
		
	
		
		
			
				
					|  |  | 				}); |  |  | 				}); | 
			
		
	
		
		
			
				
					|  |  | 			} |  |  | 			} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			//议题转项目数
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			List<OrgStatisticsResultDTO> issueToProjectCount = issueToProjectCountMap.get(item.getStaffId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			if (CollectionUtils.isNotEmpty(issueToProjectCount)) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				issueToProjectCount.forEach(dto -> { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					if (item.getGridId().equals(dto.getOrgId())) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 						item.setIssueToProjectCount(dto.getCount()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				}); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			//议题转项目日增量
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			List<OrgStatisticsResultDTO> issueToProjectIncr = issueToProjectIncrMap.get(item.getStaffId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			if (CollectionUtils.isNotEmpty(issueToProjectIncr)) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				issueToProjectIncr.forEach(dto -> { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					if (item.getGridId().equals(dto.getOrgId())) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 						item.setIssueToProjectIncr(dto.getCount()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				}); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			//议题关闭数
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			List<OrgStatisticsResultDTO> closedIssueCount = closedIssueCountMap.get(item.getStaffId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			if (CollectionUtils.isNotEmpty(closedIssueCount)) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				closedIssueCount.forEach(dto -> { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					if (item.getGridId().equals(dto.getOrgId())) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 						item.setClosedIssueCount(dto.getCount()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				}); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			//议题关闭数日增量
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			List<OrgStatisticsResultDTO> closedIssueIncr = closedIssueIncrMap.get(item.getStaffId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			if (CollectionUtils.isNotEmpty(closedIssueIncr)) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				closedIssueIncr.forEach(dto -> { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					if (item.getGridId().equals(dto.getOrgId())) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 						item.setClosedIssueIncr(dto.getCount()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				}); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			//项目响应数
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			List<OrgStatisticsResultDTO> projectResponseCount = projectResponseCountMap.get(item.getStaffId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			if (CollectionUtils.isNotEmpty(projectResponseCount)) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				projectResponseCount.forEach(dto -> { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					if (item.getGridId().equals(dto.getOrgId())) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 						item.setProjectResponseCount(dto.getCount()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				}); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			//项目响应数日增量
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			List<OrgStatisticsResultDTO> projectResponseIncr = projectResponseIncrMap.get(item.getStaffId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			if (CollectionUtils.isNotEmpty(projectResponseIncr)) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				projectResponseIncr.forEach(dto -> { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					if (item.getGridId().equals(dto.getOrgId())) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 						item.setProjectResponseIncr(dto.getCount()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				}); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			//项目吹哨数
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			List<OrgStatisticsResultDTO> projectTransferCount = projectTransferCountMap.get(item.getStaffId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			if (CollectionUtils.isNotEmpty(projectTransferCount)) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				projectTransferCount.forEach(dto -> { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					if (item.getGridId().equals(dto.getOrgId())) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 						item.setProjectTransferCount(dto.getCount()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				}); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			//项目吹哨数日增量
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			List<OrgStatisticsResultDTO> projectTransferIncr = projectTransferIncrMap.get(item.getStaffId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			if (CollectionUtils.isNotEmpty(projectTransferIncr)) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				projectTransferIncr.forEach(dto -> { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					if (item.getGridId().equals(dto.getOrgId())) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 						item.setProjectTransferIncr(dto.getCount()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				}); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			//项目响应数
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			List<OrgStatisticsResultDTO> projectClosedCount = projectClosedCountMap.get(item.getStaffId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			if (CollectionUtils.isNotEmpty(projectClosedCount)) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				projectClosedCount.forEach(dto -> { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					if (item.getGridId().equals(dto.getOrgId())) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 						item.setProjectClosedCount(dto.getCount()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				}); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			//项目响应数日增量
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			List<OrgStatisticsResultDTO> projectClosedIncr = projectClosedIncrMap.get(item.getStaffId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			if (CollectionUtils.isNotEmpty(projectClosedIncr)) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				projectClosedIncr.forEach(dto -> { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					if (item.getGridId().equals(dto.getOrgId())) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 						item.setProjectClosedIncr(dto.getCount()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				}); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			} | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | 		}); |  |  | 		}); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		if (CollectionUtils.isNotEmpty(list)) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			int deleteNum; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			do { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				deleteNum = baseDao.deleteDataByCustomer(customerId, dateId, IndexCalConstant.DELETE_SIZE); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			} while (deleteNum != NumConstant.ZERO); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			//删除旧数据
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			insertBatch(list); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		} | 
			
		
	
		
		
			
				
					|  |  | 	} |  |  | 	} | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | } |  |  | } |