| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -359,38 +359,45 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								logger.info(String.format("创建小组异常:%s",EpmetErrorCode.GROUP_ALREADY_EXISTED.getMsg())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								throw new RenException(EpmetErrorCode.GROUP_ALREADY_EXISTED.getCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//2.1、查询当前申请人的身份,生成对应格式的消息内容
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        UserRoleDTO userRoleDTO = this.checkPartyMemberOrWarmHeated(applyCreateGroupFormDTO.getApp(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                applyCreateGroupFormDTO.getUserId(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                applyCreateGroupFormDTO.getCustomerId(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                applyCreateGroupFormDTO.getGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (!NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag()) && !NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//2.内容检查
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							scanGroupEditContent(applyCreateGroupFormDTO.getGroupName(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									applyCreateGroupFormDTO.getGroupIntroduction(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									applyCreateGroupFormDTO.getGroupHeadPhoto()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//3.1、查询当前申请人的身份,生成对应格式的消息内容
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							UserRoleDTO userRoleDTO = this.checkPartyMemberOrWarmHeated(applyCreateGroupFormDTO.getApp(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									applyCreateGroupFormDTO.getUserId(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									applyCreateGroupFormDTO.getCustomerId(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									applyCreateGroupFormDTO.getGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if (!NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag()) && !NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								logger.info(String.format("创建小组异常:%s",EpmetErrorCode.CANNOT_CREATE_GROUP.getMsg())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								throw new RenException(EpmetErrorCode.CANNOT_CREATE_GROUP.getCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String roleName = ""; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if(NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            roleName = ModuleConstant.PARTYMEMBER; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }else if(NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            roleName = ModuleConstant.WAREMHEARTED_RESI; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//2.2、插入一条待审核的组信息
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							String roleName = ""; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if(NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								roleName = ModuleConstant.PARTYMEMBER; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							}else if(NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								roleName = ModuleConstant.WAREMHEARTED_RESI; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//3.2、插入一条待审核的组信息
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							ResiGroupEntity resiGroupEntity = this.structureResiGroupEntity(applyCreateGroupFormDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							insert(resiGroupEntity); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//3.获取居民注册信息
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        UserResiInfoFormDTO resiParam = new UserResiInfoFormDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        resiParam.setCustomerId(applyCreateGroupFormDTO.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        resiParam.setUserId(applyCreateGroupFormDTO.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Result<UserResiInfoResultDTO> resiResult = | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        epmetUserFeignClient.getUserResiInfoDTO(resiParam); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String userName = ""; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if(resiResult.success() && null != resiResult.getData()){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            userName = (StringUtils.isBlank(resiResult.getData().getSurname()) ? "" : resiResult.getData().getSurname()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    + (StringUtils.isBlank(resiResult.getData().getName()) ? "" :resiResult.getData().getName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//4.获取居民注册信息
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							UserResiInfoFormDTO resiParam = new UserResiInfoFormDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiParam.setCustomerId(applyCreateGroupFormDTO.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiParam.setUserId(applyCreateGroupFormDTO.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							Result<UserResiInfoResultDTO> resiResult = | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									epmetUserFeignClient.getUserResiInfoDTO(resiParam); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							String userName = ""; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if(resiResult.success() && null != resiResult.getData()){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								userName = (StringUtils.isBlank(resiResult.getData().getSurname()) ? "" : resiResult.getData().getSurname()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										+ (StringUtils.isBlank(resiResult.getData().getName()) ? "" :resiResult.getData().getName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							userName = StringUtils.isBlank(userName) ? ModuleConstant.UNKNOWN : userName; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String msg = String.format(UserMessageConstant.CREATION_OF_GROUP_MESSAGE_TEMPLATE,roleName,userName,applyCreateGroupFormDTO.getGroupName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//3.2、插入一条待审核的操作记录
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							String msg = String.format(UserMessageConstant.CREATION_OF_GROUP_MESSAGE_TEMPLATE,roleName,userName,applyCreateGroupFormDTO.getGroupName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//4.2、插入一条待审核的操作记录
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							ResiGroupOperationDTO resiGroupOperation = new ResiGroupOperationDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupOperation.setResiGroupId(resiGroupEntity.getId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupOperation.setState(GroupStateConstant.GROUP_UNDER_AUDITTING); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -398,7 +405,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupOperation.setMessageText(msg); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupOperation.setReadFlag(ModuleConstant.UNREAD); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupOperationService.save(resiGroupOperation); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//4、插入一群成员信息(群主)
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//5、插入一群成员信息(群主)
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							ResiGroupMemberDTO resiGroupMemberDTO = new ResiGroupMemberDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupMemberDTO.setCustomerUserId(applyCreateGroupFormDTO.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupMemberDTO.setResiGroupId(resiGroupEntity.getId()); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -406,7 +413,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupMemberDTO.setStatus(MemberStateConstant.UNDER_AUDITTING); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupMemberDTO.setEnterGroupType(EnterGroupTypeConstant.CREATED); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupMemberService.save(resiGroupMemberDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//5、插入一条入群记录(群主的)
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//6、插入一条入群记录(群主的)
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							GroupMemeberOperationDTO groupMemeberOperationDTO = new GroupMemeberOperationDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							groupMemeberOperationDTO.setCustomerUserId(applyCreateGroupFormDTO.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							groupMemeberOperationDTO.setGroupId(resiGroupEntity.getId()); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -414,7 +421,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							groupMemeberOperationDTO.setOperateUserId(applyCreateGroupFormDTO.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							groupMemeberOperationDTO.setEnterGroupType(EnterGroupTypeConstant.CREATED); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							groupMemeberOperationService.save(groupMemeberOperationDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//6、群初始统计记录
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//7、群初始统计记录
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							/*UserRoleDTO userRoleDTO = this.checkPartyMemberOrWarmHeated(applyCreateGroupFormDTO.getApp(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									applyCreateGroupFormDTO.getUserId(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									applyCreateGroupFormDTO.getCustomerId(), | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |