| 
						
						
							
								
							
						
						
					 | 
					@ -18,7 +18,6 @@ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					package com.epmet.modules.topic.service.impl; | 
					 | 
					 | 
					package com.epmet.modules.topic.service.impl; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
					 | 
					 | 
					import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.baomidou.mybatisplus.core.metadata.IPage; | 
					 | 
					 | 
					import com.baomidou.mybatisplus.core.metadata.IPage; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
					 | 
					 | 
					import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -75,9 +74,9 @@ import com.epmet.resi.group.dto.member.form.RemoveMemberFormDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.resi.group.dto.member.result.ResiGroupMemberInfoRedisResultDTO; | 
					 | 
					 | 
					import com.epmet.resi.group.dto.member.result.ResiGroupMemberInfoRedisResultDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.resi.group.dto.topic.ResiTopicDTO; | 
					 | 
					 | 
					import com.epmet.resi.group.dto.topic.ResiTopicDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.resi.group.dto.topic.TopicInfoDTO; | 
					 | 
					 | 
					import com.epmet.resi.group.dto.topic.TopicInfoDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.resi.group.dto.topic.form.*; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.resi.group.dto.topic.form.CheckTopicPublisherFormDTO; | 
					 | 
					 | 
					import com.epmet.resi.group.dto.topic.form.CheckTopicPublisherFormDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.resi.group.dto.topic.form.GovTopicIssueInfoFormDTO; | 
					 | 
					 | 
					import com.epmet.resi.group.dto.topic.form.GovTopicIssueInfoFormDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.epmet.resi.group.dto.topic.form.*; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.resi.group.dto.topic.result.*; | 
					 | 
					 | 
					import com.epmet.resi.group.dto.topic.result.*; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import lombok.extern.slf4j.Slf4j; | 
					 | 
					 | 
					import lombok.extern.slf4j.Slf4j; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import org.apache.commons.lang3.StringUtils; | 
					 | 
					 | 
					import org.apache.commons.lang3.StringUtils; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -1156,48 +1155,49 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            issueInfo.setOrgIdPath(dataFilterResult.getData().getOrgIdPath()); | 
					 | 
					 | 
					            issueInfo.setOrgIdPath(dataFilterResult.getData().getOrgIdPath()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            issueInfo.setOrgName(dataFilterResult.getData().getOrgName()); | 
					 | 
					 | 
					            issueInfo.setOrgName(dataFilterResult.getData().getOrgName()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            //3.获取小组名称、话题作者、议题发起人
 | 
					 | 
					 | 
					            //3.获取小组名称、话题作者、议题发起人
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            ResiGroupMemberInfoRedisDTO topicAuthor =  resiGroupMemberRedis.get(group.getGroupId(), group.getTopicAuthorId()); | 
					 | 
					 | 
					            ResiGroupMemberInfoRedisDTO topicAuthor = resiGroupMemberRedis.get(group.getGroupId(), group.getTopicAuthorId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            issueInfo.setTopicAuthor(null == topicAuthor ? ModuleConstant.EMPTY_STR : topicAuthor.getUserShowName()); | 
					 | 
					 | 
					            issueInfo.setTopicAuthor(null == topicAuthor ? ModuleConstant.EMPTY_STR : topicAuthor.getUserShowName()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            ResiGroupMemberInfoRedisDTO issueAuthor = resiGroupMemberRedis.get(group.getGroupId(),topicTurnIssueFromDTO.getUserId()); | 
					 | 
					 | 
					            ResiGroupMemberInfoRedisDTO issueAuthor = resiGroupMemberRedis.get(group.getGroupId(), topicTurnIssueFromDTO.getUserId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            issueInfo.setIssueAuthor(null == issueAuthor ? ModuleConstant.EMPTY_STR : issueAuthor.getUserShowName()); | 
					 | 
					 | 
					            issueInfo.setIssueAuthor(null == issueAuthor ? ModuleConstant.EMPTY_STR : issueAuthor.getUserShowName()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            ResiGroupInfoRedisDTO groupCache = resiGroupRedis.get(group.getGroupId()); | 
					 | 
					 | 
					            ResiGroupInfoRedisDTO groupCache = resiGroupRedis.get(group.getGroupId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            issueInfo.setGroupName(null == groupCache ? ModuleConstant.EMPTY_STR : groupCache.getGroupName()); | 
					 | 
					 | 
					            issueInfo.setGroupName(null == groupCache ? ModuleConstant.EMPTY_STR : groupCache.getGroupName()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            issueInfo.setVotableCount(resiGroupMemberService.gridResiCount(group.getGridId())); | 
					 | 
					 | 
					            issueInfo.setVotableCount(resiGroupMemberService.gridResiCount(group.getGridId())); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            //4.调用gov-issue新增议题
 | 
					 | 
					 | 
					            //4.调用gov-issue新增议题
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            Result<String> issueResult = govIssueFeignClient.issueShiftedToTopic(issueInfo); | 
					 | 
					 | 
					            Result<String> issueResult = govIssueFeignClient.issueShiftedToTopic(issueInfo); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (issueResult == null || !issueResult.success() || StringUtils.isBlank(issueResult.getData())) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                throw new RenException(ModuleConstant.CREATE_ISSUE_ERROR); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            //5.修改话题shiftIssue字段
 | 
					 | 
					 | 
					            //5.修改话题shiftIssue字段
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            if(issueResult.success() && StringUtils.isNotBlank(issueResult.getData())){ | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                ResiTopicEntity topic2Upd = new ResiTopicEntity(); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                topic2Upd.setId(topicTurnIssueFromDTO.getTopicId()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                topic2Upd.setUpdatedBy(topicTurnIssueFromDTO.getUserId()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                topic2Upd.setShiftIssue(Boolean.TRUE); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                topic2Upd.setIssueId(issueResult.getData()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                topic2Upd.setUpdatedTime(now); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                int topicResult = baseDao.updateOne(topic2Upd); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                //6.新增话题操作记录
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if(topicResult == NumConstant.ONE) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    ResiTopicOperationEntity operation = new ResiTopicOperationEntity(); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    operation.setCreatedTime(now); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    operation.setCreatedBy(topicTurnIssueFromDTO.getUserId()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    operation.setTopicId(topicTurnIssueFromDTO.getTopicId()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    operation.setOperationType(ModuleConstant.TOPIC_OPERATION_TYPE_SHIFT_ISSUE); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    int operationResult = resiTopicOperationDao.insertOneByParams(operation); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    if(operationResult != NumConstant.ONE){ | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        logger.warn(ModuleConstant.FAILURE_TO_ADD_TOPIC_OPERATION); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                //7.更新组统计信息 议题数量+1
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                resiGroupStatisticalDao.incryTotalIssues(group.getGroupId()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if(null != groupCache && null != groupCache.getGroupStatisticalInfo()){ | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    groupCache.getGroupStatisticalInfo().setTotalIssues( | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                            null == groupCache.getGroupStatisticalInfo().getTotalIssues() ? NumConstant.ONE | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                                    : groupCache.getGroupStatisticalInfo().getTotalIssues() + NumConstant.ONE | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    ); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    resiGroupRedis.set(groupCache); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                logger.warn(ModuleConstant.FAILURE_TO_UPDATE_TOPIC); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            ResiTopicEntity topic2Upd = new ResiTopicEntity(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            topic2Upd.setId(topicTurnIssueFromDTO.getTopicId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            topic2Upd.setUpdatedBy(topicTurnIssueFromDTO.getUserId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            topic2Upd.setShiftIssue(Boolean.TRUE); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            topic2Upd.setIssueId(issueResult.getData()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            topic2Upd.setUpdatedTime(now); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            int topicResult = baseDao.updateOne(topic2Upd); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            //6.新增话题操作记录
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (topicResult == NumConstant.ONE) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                ResiTopicOperationEntity operation = new ResiTopicOperationEntity(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                operation.setCreatedTime(now); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                operation.setCreatedBy(topicTurnIssueFromDTO.getUserId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                operation.setTopicId(topicTurnIssueFromDTO.getTopicId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                operation.setOperationType(ModuleConstant.TOPIC_OPERATION_TYPE_SHIFT_ISSUE); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                int operationResult = resiTopicOperationDao.insertOneByParams(operation); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                if (operationResult != NumConstant.ONE) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    logger.warn(ModuleConstant.FAILURE_TO_ADD_TOPIC_OPERATION); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            //7.更新组统计信息 议题数量+1
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            resiGroupStatisticalDao.incryTotalIssues(group.getGroupId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (null != groupCache && null != groupCache.getGroupStatisticalInfo()) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                groupCache.getGroupStatisticalInfo().setTotalIssues( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        null == groupCache.getGroupStatisticalInfo().getTotalIssues() ? NumConstant.ONE | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                                : groupCache.getGroupStatisticalInfo().getTotalIssues() + NumConstant.ONE | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                ); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                resiGroupRedis.set(groupCache); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            logger.warn(ModuleConstant.FAILURE_TO_UPDATE_TOPIC); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |