| 
						
						
							
								
							
						
						
					 | 
					@ -402,7 +402,7 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    /** | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					     * @Description 关闭议题、议题转项目时给话题创建人和议题发起人发送消息 | 
					 | 
					 | 
					     * @Description 关闭议题时给话题创建人和议题发起人发送消息 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					     * @author sun | 
					 | 
					 | 
					     * @author sun | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     */ | 
					 | 
					 | 
					     */ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    private Result saveUserMessageList(ResiTopicDTO topicDTO, String messageContent, IssueEntity entity) { | 
					 | 
					 | 
					    private Result saveUserMessageList(ResiTopicDTO topicDTO, String messageContent, IssueEntity entity) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -480,20 +480,28 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							formDTO.setIssueDTO(ConvertUtils.sourceToTarget(entity, IssueDTO.class)); | 
					 | 
					 | 
							formDTO.setIssueDTO(ConvertUtils.sourceToTarget(entity, IssueDTO.class)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
							//2:调用gov-project服务,新增项目各业务表初始数据
 | 
					 | 
					 | 
					        //2:调用resi-group查询话题创建人数据(目前议题来源只有来自话题),为了到项目服务初始数据以及发送消息使用
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        Result<ResiTopicDTO> resultTopicDTO = resiGroupFeignClient.getTopicById(entity.getSourceId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (!resultTopicDTO.success() || null == resultTopicDTO.getData()) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            throw new RenException(IssueConstant.SELECT_TOPIC_EXCEPTION); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        ResiTopicDTO topicDTO = resultTopicDTO.getData(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        formDTO.setTopicDTO(topicDTO); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							//3:调用gov-project服务,新增项目各业务表初始数据
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							Result<IssueProjectResultDTO> resultDTO = govProjectFeignClient.issueShiftProject(formDTO); | 
					 | 
					 | 
							Result<IssueProjectResultDTO> resultDTO = govProjectFeignClient.issueShiftProject(formDTO); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        if (!resultDTO.success() || null == resultDTO.getData()) { | 
					 | 
					 | 
					        if (!resultDTO.success() || null == resultDTO.getData()) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            throw new RenException(IssueConstant.GOV_PRJECT_EXCEPTION); | 
					 | 
					 | 
					            throw new RenException(IssueConstant.GOV_PRJECT_EXCEPTION); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							IssueProjectResultDTO issueProjectResultDTO = resultDTO.getData(); | 
					 | 
					 | 
							IssueProjectResultDTO issueProjectResultDTO = resultDTO.getData(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
							//3:更新议题相关业务表数据
 | 
					 | 
					 | 
							//4:更新议题相关业务表数据
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
							//3.1:更新议题表数据
 | 
					 | 
					 | 
							//4.1:更新议题表数据
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
							entity.setIssueStatus(IssueConstant.ISSUE_SHIFT_PROJECT); | 
					 | 
					 | 
							entity.setIssueStatus(IssueConstant.ISSUE_SHIFT_PROJECT); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							entity.setShiftedTime(issueProjectResultDTO.getShiftedTime()); | 
					 | 
					 | 
							entity.setShiftedTime(issueProjectResultDTO.getShiftedTime()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							baseDao.updateById(entity); | 
					 | 
					 | 
							baseDao.updateById(entity); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
							//3.2:议题处理进展表新增数据
 | 
					 | 
					 | 
							//4.2:议题处理进展表新增数据
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
							IssueProcessEntity processEntity = new IssueProcessEntity(); | 
					 | 
					 | 
							IssueProcessEntity processEntity = new IssueProcessEntity(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							processEntity.setIssueId(entity.getId()); | 
					 | 
					 | 
							processEntity.setIssueId(entity.getId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							processEntity.setIssueStatus(IssueConstant.ISSUE_SHIFT_PROJECT); | 
					 | 
					 | 
							processEntity.setIssueStatus(IssueConstant.ISSUE_SHIFT_PROJECT); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -502,30 +510,63 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							processEntity.setOrgName(issueProjectResultDTO.getOrgName()); | 
					 | 
					 | 
							processEntity.setOrgName(issueProjectResultDTO.getOrgName()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							issueProcessDao.insert(processEntity); | 
					 | 
					 | 
							issueProcessDao.insert(processEntity); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
							//3.3:议题项目关系表新增数据
 | 
					 | 
					 | 
							//4.3:议题项目关系表新增数据
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
							IssueProjectRelationEntity relationEntity = new IssueProjectRelationEntity(); | 
					 | 
					 | 
							IssueProjectRelationEntity relationEntity = new IssueProjectRelationEntity(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							relationEntity.setIssueId(entity.getId()); | 
					 | 
					 | 
							relationEntity.setIssueId(entity.getId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							relationEntity.setProjectId(issueProjectResultDTO.getProjectId()); | 
					 | 
					 | 
							relationEntity.setProjectId(issueProjectResultDTO.getProjectId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							issueProjectRelationDao.insert(relationEntity); | 
					 | 
					 | 
							issueProjectRelationDao.insert(relationEntity); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
							//4:调用epmet-message服务,给居民端话题创建人和议题发起人发送消息
 | 
					 | 
					 | 
							//5:调用epmet-message服务,给居民端话题创建人、议题发起人以及政府端工作人员发送消息
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
							//4.1:调用resi-group查询话题创建人数据(目前议题来源只有来自话题)
 | 
					 | 
					 | 
							if (!shiftProjectMessage(issueProjectResultDTO, formDTO, entity).success()) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
							Result<ResiTopicDTO> resultTopicDTO = resiGroupFeignClient.getTopicById(entity.getSourceId()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							if (!resultTopicDTO.success() || null == resultTopicDTO.getData()) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								throw new RenException(IssueConstant.SELECT_TOPIC_EXCEPTION); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							} | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							ResiTopicDTO topicDTO = resultTopicDTO.getData(); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							//4.2:创建消息模板
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							String messageContent = String.format(UserMessageConstant.ISSUE_SHIFT_PROJECT_MSG, topicDTO.getTopicContent(), issueProjectResultDTO.getOrgName()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							//4.3:调用服务,发送消息
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							if (!saveUserMessageList(topicDTO, messageContent, entity).success()) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
								throw new RenException(IssueConstant.SAVE_MSG_EXCEPTION); | 
					 | 
					 | 
								throw new RenException(IssueConstant.SAVE_MSG_EXCEPTION); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							} | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
							//5:缓存中网格下表决中的议题总数减1
 | 
					 | 
					 | 
							//6:缓存中网格下表决中的议题总数减1
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
							govIssueRedis.subtractWorkGrassrootsIssueRedDotValue(entity.getGridId()); | 
					 | 
					 | 
							govIssueRedis.subtractWorkGrassrootsIssueRedDotValue(entity.getGridId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						} | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     * @Description 议题转项目时给话题创建人、议题发起人、勾选的工作人员分别推送消息 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     * @author sun | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     */ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    private Result shiftProjectMessage(IssueProjectResultDTO issueProjectResultDTO, ShiftProjectFormDTO formDTO, IssueEntity entity) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        List<UserMessageFormDTO> msgList = new ArrayList<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        //1:创建话题发起人、议题发表人消息对象
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        UserMessageFormDTO msgDTO = new UserMessageFormDTO(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        msgDTO.setCustomerId(entity.getCustomerId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        msgDTO.setGridId(entity.getGridId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        msgDTO.setApp(AppClientConstant.APP_RESI); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        msgDTO.setTitle(UserMessageConstant.ISSUE_TITLE); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        String topicIssueMessage = String.format(UserMessageConstant.ISSUE_SHIFT_PROJECT_MSG, formDTO.getTopicDTO().getTopicContent(), issueProjectResultDTO.getOrgName()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        msgDTO.setMessageContent(topicIssueMessage); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        msgDTO.setReadFlag(ReadFlagConstant.UN_READ); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        UserMessageFormDTO msgIssue = ConvertUtils.sourceToTarget(msgDTO,UserMessageFormDTO.class); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        msgDTO.setUserId(formDTO.getTopicDTO().getCreatedBy()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        msgList.add(msgDTO); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        msgIssue.setUserId(entity.getCreatedBy()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        msgList.add(msgIssue); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        //2:创建项目工作人员消息对象
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        String projectStaffMessage = String.format(UserMessageConstant.PROJECT_RESLOVED_MSG, entity.getIssueTitle()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        //所选人员如果即在部门下又在网格下则只发一条消息
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        Map<String,String> map = new HashMap<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        formDTO.getStaffList().forEach(staff->{ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            if(!map.containsKey(staff.getStaffId())){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                UserMessageFormDTO msg = new UserMessageFormDTO(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                msg.setCustomerId(entity.getCustomerId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                msg.setGridId("*"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                msg.setApp(AppClientConstant.APP_GOV); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                msg.setTitle(UserMessageConstant.PROJECT_TITLE); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                msg.setMessageContent(projectStaffMessage); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                msg.setReadFlag(ReadFlagConstant.UN_READ); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                msg.setUserId(staff.getStaffId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                msgList.add(msg); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                map.put(staff.getStaffId(),staff.getStaffId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        return messageFeignClient.saveUserMessageList(msgList); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						/** | 
					 | 
					 | 
						/** | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						 * @Description | 
					 | 
					 | 
						 * @Description | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						 * @param issueListForm | 
					 | 
					 | 
						 * @param issueListForm | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |