| 
						
						
							
								
							
						
						
					 | 
					@ -17,6 +17,7 @@ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					package com.epmet.modules.member.service.impl; | 
					 | 
					 | 
					package com.epmet.modules.member.service.impl; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.alibaba.fastjson.JSON; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					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; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -38,6 +39,7 @@ import com.epmet.feign.MessageFeignClient; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.modules.constant.GroupMemberConstant; | 
					 | 
					 | 
					import com.epmet.modules.constant.GroupMemberConstant; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.modules.constant.UserMessageConstant; | 
					 | 
					 | 
					import com.epmet.modules.constant.UserMessageConstant; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.modules.feign.EpmetUserFeignClient; | 
					 | 
					 | 
					import com.epmet.modules.feign.EpmetUserFeignClient; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.epmet.modules.group.dao.ResiGroupDao; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.modules.group.entity.ResiGroupEntity; | 
					 | 
					 | 
					import com.epmet.modules.group.entity.ResiGroupEntity; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.modules.group.redis.ResiGroupRedis; | 
					 | 
					 | 
					import com.epmet.modules.group.redis.ResiGroupRedis; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.modules.group.service.ResiGroupService; | 
					 | 
					 | 
					import com.epmet.modules.group.service.ResiGroupService; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -114,6 +116,8 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						@Autowired | 
					 | 
					 | 
						@Autowired | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						private ResiGroupRedis resiGroupRedis; | 
					 | 
					 | 
						private ResiGroupRedis resiGroupRedis; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
						@Autowired | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
						private ResiGroupDao resiGroupDao; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						@Override | 
					 | 
					 | 
						@Override | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						public PageData<ResiGroupMemberDTO> page(Map<String, Object> params) { | 
					 | 
					 | 
						public PageData<ResiGroupMemberDTO> page(Map<String, Object> params) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -232,8 +236,46 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							groupMemeberOperation.setCreatedBy(applyJoinGroupFormDTO.getUserId()); | 
					 | 
					 | 
							groupMemeberOperation.setCreatedBy(applyJoinGroupFormDTO.getUserId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							groupMemeberOperation.setOperateUserId(applyJoinGroupFormDTO.getUserId()); | 
					 | 
					 | 
							groupMemeberOperation.setOperateUserId(applyJoinGroupFormDTO.getUserId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							groupMemeberOperationService.save(groupMemeberOperation); | 
					 | 
					 | 
							groupMemeberOperationService.save(groupMemeberOperation); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							//给组长发送消息,有人申请入群
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							this.sendMessageToGroupLeader(resiGroupDTO,applyJoinGroupFormDTO.getUserId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						} | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
						//给组长发送消息,有人申请入群
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
						private void sendMessageToGroupLeader(ResiGroupDTO resiGroupDTO, String currentUserId) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							try { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								ResiGroupMemberDTO groupLeader = resiGroupDao.selectGroupLeader(resiGroupDTO.getId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								if (null == groupLeader) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
									logger.error(String.format("居民申请入群,给组长发送消息通知异常,查询组长信息为空groupId%s", resiGroupDTO.getId())); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
									return; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								UserMessageFormDTO userMessage = new UserMessageFormDTO(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								userMessage.setApp(AppClientConstant.APP_RESI); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								userMessage.setCustomerId(resiGroupDTO.getCustomerId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								userMessage.setGridId(resiGroupDTO.getGridId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								//查询当前申请用户的基本信息(显示名称山东路168号-尹女士)
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								String currentUserName = ""; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								UserResiInfoFormDTO userResiInfoFormDTO = new UserResiInfoFormDTO(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								userResiInfoFormDTO.setCustomerId(resiGroupDTO.getCustomerId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								userResiInfoFormDTO.setUserId(currentUserId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								Result<UserResiInfoResultDTO> resultUserInfo = epmetUserFeignClient.getUserResiInfoDTO(userResiInfoFormDTO); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								if (!resultUserInfo.success() || null == resultUserInfo.getData()) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
									logger.error(String.format("居民申请入群,给组长发送消息通知错误,调用%s服务查询申请用户名称失败,入参%s", ServiceConstant.EPMET_USER_SERVER, JSON.toJSONString(userResiInfoFormDTO))); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								} else { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
									currentUserName = resultUserInfo.getData().getShowName(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								String messageContent = String.format(UserMessageConstant.APPLY_JOIN_GROUP, currentUserName, resiGroupDTO.getGroupName()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								userMessage.setMessageContent(messageContent); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								userMessage.setReadFlag(ReadFlagConstant.UN_READ); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								userMessage.setTitle(UserMessageConstant.GROUP_TITLE); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								//通知群主
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								userMessage.setUserId(groupLeader.getCustomerUserId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								messageFeignClient.saveUserMessage(userMessage); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							} catch (Exception e) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								logger.error("居民申请入群,给组长发送消息通知异常"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								e.printStackTrace(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						/** | 
					 | 
					 | 
						/** | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						 * @param groupMemberListFormDTO | 
					 | 
					 | 
						 * @param groupMemberListFormDTO | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						 * @return com.epmet.commons.tools.utils.Result | 
					 | 
					 | 
						 * @return com.epmet.commons.tools.utils.Result | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |