| 
						
						
						
					 | 
				
				 | 
				
					@ -1,16 +1,16 @@ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					package com.epmet.service.evaluationindex.extract.impl; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.dynamic.datasource.annotation.DataSource; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.dto.form.TimeListResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.exception.RenException; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.ConvertUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.DateUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.constant.DataSourceConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.constant.ExtractConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dao.stats.DimAgencyDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.extract.form.IssueLogDailyFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.extract.form.IssueMainDailyFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.extract.result.AgencyInfoResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.extract.result.IssueInfoResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -65,7 +65,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IssueInfoResultDTO> listResult = issueService.selectIssueInfo(customerId, dateId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IssueMainDailyFormDTO> result = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (CollectionUtils.isEmpty(listResult)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new RenException("查询议题信息为空"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new RenException(ExtractConstant.ISSUE_INFO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        listResult.forEach(issue -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            IssueMainDailyFormDTO issueMainDailyFormDTO = ConvertUtils.sourceToTarget(issue, IssueMainDailyFormDTO.class); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -90,7 +90,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<String> topicIds = listResult.stream().map(issue -> issue.getTopicId()).collect(Collectors.toList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<TopicInfoResultDTO> topicInfoList = topicService.selectTopicInfo(topicIds); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (CollectionUtils.isEmpty(topicInfoList)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new RenException("查询创建话题用户身份信息为空"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new RenException(ExtractConstant.CREATED_TOPIC_USER_IDENTITY); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<String> createTopicUserIds = topicInfoList.stream().map(topic -> topic.getUserId()).distinct().collect(Collectors.toList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, Integer> topicUserIsParty = userService.selectUserIsParty(createTopicUserIds); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -121,7 +121,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<String> agencyIds = result.stream().map(r -> r.getAgencyId()).distinct().collect(Collectors.toList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<AgencyInfoResultDTO> agencyInfoList = dimAgencyDao.selectAgencyInfo(agencyIds); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (CollectionUtils.isEmpty(agencyInfoList)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new RenException("查询组织上级ID集合为空......"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new RenException(ExtractConstant.PARENT_AGENCY_ID_LIST); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        result.forEach(r -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            agencyInfoList.forEach(pid -> { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -150,19 +150,38 @@ public class IssueExtractServiceImpl implements IssueExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public Boolean issueExtractLog(String customerId, String dateId) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IssueLogDailyFormDTO> result = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 查询议题process
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IssueProcessInfoResultDTO> listResult = issueService.selectIssueProcessInfo(customerId, dateId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (CollectionUtils.isEmpty(listResult)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new RenException("查询查询议题process集合为空"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new RenException(ExtractConstant.ISSUE_PROCESS); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IssueLogDailyFormDTO> result = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        listResult.forEach(issueProcess -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            IssueLogDailyFormDTO issueLogDailyFormDTO = ConvertUtils.sourceToTarget(issueProcess, IssueLogDailyFormDTO.class); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            issueLogDailyFormDTO.setOperationUserId(issueProcess.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            result.add(issueLogDailyFormDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 查询议题满意度
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<SatisfactionInfoResultDTO> satisfactionInfoList = issueService.selectIssueSatisfactionInfo(customerId, dateId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (!CollectionUtils.isEmpty(satisfactionInfoList)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            satisfactionInfoList.forEach(s -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                IssueLogDailyFormDTO issueLogDailyFormDTO = ConvertUtils.sourceToTarget(s, IssueLogDailyFormDTO.class); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                issueLogDailyFormDTO.setOperationUserId(s.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                result.add(issueLogDailyFormDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 查询议题支持反对
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<SatisfactionInfoResultDTO> voteInfoList = issueService.selectIssueVoteInfo(customerId, dateId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (!CollectionUtils.isEmpty(voteInfoList)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            voteInfoList.forEach(v -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                IssueLogDailyFormDTO issueLogDailyFormDTO = ConvertUtils.sourceToTarget(v, IssueLogDailyFormDTO.class); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                issueLogDailyFormDTO.setOperationUserId(v.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                result.add(issueLogDailyFormDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 动作操作人的身份标识是否是党员
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<String> userIds = listResult.stream().map(issue -> issue.getUserId()).distinct().collect(Collectors.toList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String,Integer> map = userService.selectUserIsParty(userIds); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -180,7 +199,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<String> agencyIds = listResult.stream().map(process -> process.getAgencyId()).distinct().collect(Collectors.toList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<AgencyInfoResultDTO> agencyInfoList = dimAgencyDao.selectAgencyInfo(agencyIds); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (CollectionUtils.isEmpty(agencyInfoList)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new RenException("查询组织上级ID集合为空......"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new RenException(ExtractConstant.PARENT_AGENCY_ID_LIST); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        TimeListResultDTO timeList = DateUtils.getTimeList(dateId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        result.forEach(r -> { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |