|  |  | @ -40,10 +40,12 @@ import com.epmet.dto.form.*; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.result.CheckTopicPublisherResultDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.result.JoinVoteResultDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.entity.IssueVoteDetailEntity; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.feign.EpmetUserOpenFeignClient; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.feign.ResiGroupFeignClient; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.redis.IssueVoteDetailRedis; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.service.IssueService; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.service.IssueVoteDetailService; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.utils.ModuleConstants; | 
			
		
	
		
			
				
					|  |  |  | import org.apache.commons.lang3.StringUtils; | 
			
		
	
		
			
				
					|  |  |  | import org.springframework.beans.BeanUtils; | 
			
		
	
		
			
				
					|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
			
		
	
	
		
			
				
					|  |  | @ -73,6 +75,8 @@ public class IssueVoteDetailServiceImpl extends BaseServiceImpl<IssueVoteDetailD | 
			
		
	
		
			
				
					|  |  |  |     private IssueDao issueDao; | 
			
		
	
		
			
				
					|  |  |  |     @Autowired | 
			
		
	
		
			
				
					|  |  |  |     private IssueVoteStatisticalDao issueVoteStatisticalDao; | 
			
		
	
		
			
				
					|  |  |  |     @Autowired | 
			
		
	
		
			
				
					|  |  |  |     private EpmetUserOpenFeignClient epmetUserOpenFeignClient; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |     public PageData<IssueVoteDetailDTO> page(Map<String, Object> params) { | 
			
		
	
	
		
			
				
					|  |  | @ -140,7 +144,7 @@ public class IssueVoteDetailServiceImpl extends BaseServiceImpl<IssueVoteDetailD | 
			
		
	
		
			
				
					|  |  |  |         if (redisData==null){ | 
			
		
	
		
			
				
					|  |  |  |             VoteRedisFormDTO voteRedisFormDTO = new VoteRedisFormDTO(); | 
			
		
	
		
			
				
					|  |  |  |             voteRedisFormDTO.setIssueId(formDTO.getIssueId()); | 
			
		
	
		
			
				
					|  |  |  |             issueVoteDetailRedis.set(voteRedisFormDTO); | 
			
		
	
		
			
				
					|  |  |  | //            issueVoteDetailRedis.set(voteRedisFormDTO);
 | 
			
		
	
		
			
				
					|  |  |  |             redisData = voteRedisFormDTO; | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         redisData.setIssueId(formDTO.getIssueId()); | 
			
		
	
	
		
			
				
					|  |  | @ -150,17 +154,24 @@ public class IssueVoteDetailServiceImpl extends BaseServiceImpl<IssueVoteDetailD | 
			
		
	
		
			
				
					|  |  |  |             redisData.setOppositionAmount(redisData.getOppositionAmount()+1); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         IssueDTO issueDTO = issueService.get(formDTO.getIssueId()); | 
			
		
	
		
			
				
					|  |  |  | //        ShouldVoteCountFormDTO shouldVoteCount = new ShouldVoteCountFormDTO();
 | 
			
		
	
		
			
				
					|  |  |  | //        shouldVoteCount.setGridId(issueDTO.getGridId());
 | 
			
		
	
		
			
				
					|  |  |  | //        shouldVoteCount.setIssueCreatedTime(issueDTO.getCreatedTime().getTime()/1000);
 | 
			
		
	
		
			
				
					|  |  |  | //        ShouldVoteCountResultDTO data = resiGroupFeignClient.shouldVoteCount(shouldVoteCount).getData();
 | 
			
		
	
		
			
				
					|  |  |  |         CommonGridIdFormDTO dto = new CommonGridIdFormDTO(); | 
			
		
	
		
			
				
					|  |  |  |         dto.setGridId(issueDTO.getGridId()); | 
			
		
	
		
			
				
					|  |  |  |         Result<Integer> integerResult = resiGroupFeignClient.votableCount(dto); | 
			
		
	
		
			
				
					|  |  |  |         if (!integerResult.success()){ | 
			
		
	
		
			
				
					|  |  |  |             throw new EpmetException("查询应表决人数失败..."); | 
			
		
	
		
			
				
					|  |  |  |         /** | 
			
		
	
		
			
				
					|  |  |  |          * 直接创建议题的,应表决数为网格下的注册居民数 | 
			
		
	
		
			
				
					|  |  |  |          */ | 
			
		
	
		
			
				
					|  |  |  |         if (formDTO.getSourceType().equals(ModuleConstants.ISSUE)){ | 
			
		
	
		
			
				
					|  |  |  |             Result<Integer> allResi = epmetUserOpenFeignClient.getAllResiByGrid(new AllResiByGridFormDTO(issueDTO.getGridId())); | 
			
		
	
		
			
				
					|  |  |  |             if (!allResi.success()){ | 
			
		
	
		
			
				
					|  |  |  |                 throw new EpmetException("查询网格下的注册居民失败:"+issueDTO.getGridId()); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |             redisData.setShouldVoteCount(allResi.getData()); | 
			
		
	
		
			
				
					|  |  |  |         }else { | 
			
		
	
		
			
				
					|  |  |  |             Result<Integer> integerResult = resiGroupFeignClient.votableCount(dto); | 
			
		
	
		
			
				
					|  |  |  |             if (!integerResult.success()){ | 
			
		
	
		
			
				
					|  |  |  |                 throw new EpmetException("查询应表决人数失败..."); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |             redisData.setShouldVoteCount(integerResult.getData()); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         redisData.setShouldVoteCount(integerResult.getData()); | 
			
		
	
		
			
				
					|  |  |  |         issueVoteDetailRedis.set(redisData); | 
			
		
	
		
			
				
					|  |  |  |         Integer checkoutVoteCount = baseDao.checkoutVote(formDTO); | 
			
		
	
		
			
				
					|  |  |  |         if (checkoutVoteCount==0){ | 
			
		
	
	
		
			
				
					|  |  | 
 |