| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -34,20 +34,31 @@ import com.epmet.dto.form.UserRoleFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.result.UserRoleResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.modules.feign.EpmetUserFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.modules.group.dao.ResiGroupDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.modules.group.dao.ResiGroupOperationDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.modules.group.entity.ResiGroupEntity; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.modules.group.service.ResiGroupOperationService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.modules.group.service.ResiGroupService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.modules.group.service.ResiGroupStatisticalService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.modules.member.dao.GroupMemeberOperationDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.modules.member.dao.ResiGroupMemberDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.modules.member.service.GroupMemeberOperationService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.modules.member.service.ResiGroupMemberService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.modules.utils.ModuleConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.redis.ResiGroupRedis; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.constant.EnterGroupTypeConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.constant.GroupStateConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.constant.LeaderFlagConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.constant.MemberStateConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.dto.UserRoleDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.dto.group.ResiGroupDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.dto.group.ResiGroupOperationDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.dto.group.ResiGroupStatisticalDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.dto.group.form.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.dto.group.result.CreatedResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.dto.group.result.GroupSummarizeResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.dto.group.result.MyGroupResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.dto.group.result.RecommendGroupResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.dto.member.GroupMemeberOperationDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.lang3.StringUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.slf4j.Logger; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -81,6 +92,21 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						@Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						private EpmetUserFeignClient epmetUserFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						@Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						private GroupMemeberOperationService groupMemeberOperationService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						@Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						private ResiGroupStatisticalService resiGroupStatisticalService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						@Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						private ResiGroupOperationDao resiGroupOperationDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						@Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						private ResiGroupMemberDao resiGroupMemberDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						@Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						private GroupMemeberOperationDao groupMemeberOperationDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						@Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						public PageData<ResiGroupDTO> page(Map<String, Object> params) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							IPage<ResiGroupEntity> page = baseDao.selectPage( | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -186,6 +212,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 * @Description 修改组信息 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 * @Date 2020/3/28 22:27 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 **/ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						@Transactional(rollbackFor = Exception.class) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						@Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						public Result modifyGroup(ModifyGroupFormDTO modifyGroupFormDTO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//校验是否是群主
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -215,7 +242,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						@Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						public Result<GroupSummarizeResultDTO> getGroupSummarize(GroupSummarizeFormDTO groupSummarizeFormDTO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							GroupSummarizeResultDTO groupSummarizeResultDTO = baseDao.selectGroupSummarize(groupSummarizeFormDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if (null != groupSummarizeResultDTO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if (null == groupSummarizeResultDTO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								return new Result<GroupSummarizeResultDTO>().error(ModuleConstant.GETGROUPSUMMARIZE_FAILED); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//获取组长信息
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -258,6 +285,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 * @Description 创建小组 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 * @Date 2020/3/29 19:26 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 **/ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						@Transactional(rollbackFor = Exception.class) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						@Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						public Result applyCreateGroup(ApplyCreateGroupFormDTO applyCreateGroupFormDTO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//1、校验是否同名
 | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -275,8 +303,45 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							ResiGroupOperationDTO resiGroupOperation = new ResiGroupOperationDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupOperation.setResiGroupId(resiGroupEntity.getId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupOperation.setState(GroupStateConstant.GROUP_UNDER_AUDITTING); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupOperation.setCreatedBy(applyCreateGroupFormDTO.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupOperation.setOperateUserId(applyCreateGroupFormDTO.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupOperationService.save(resiGroupOperation); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//4、插入一群成员信息(群主)
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							ResiGroupMemberDTO resiGroupMemberDTO=new ResiGroupMemberDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupMemberDTO.setCustomerUserId(applyCreateGroupFormDTO.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupMemberDTO.setResiGroupId(resiGroupEntity.getId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupMemberDTO.setGroupLeaderFlag(LeaderFlagConstant.GROUP_LEADER); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupMemberDTO.setStatus(MemberStateConstant.UNDER_AUDITTING); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupMemberDTO.setEnterGroupType(EnterGroupTypeConstant.CREATED); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupMemberService.save(resiGroupMemberDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//5、插入一条入群记录(群主的)
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							GroupMemeberOperationDTO groupMemeberOperationDTO=new GroupMemeberOperationDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							groupMemeberOperationDTO.setCustomerUserId(applyCreateGroupFormDTO.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							groupMemeberOperationDTO.setGroupId(resiGroupEntity.getId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							groupMemeberOperationDTO.setOperateStatus(MemberStateConstant.UNDER_AUDITTING); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							groupMemeberOperationDTO.setOperateUserId(applyCreateGroupFormDTO.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							groupMemeberOperationDTO.setEnterGroupType(EnterGroupTypeConstant.CREATED); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							groupMemeberOperationService.save(groupMemeberOperationDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//6、群初始统计记录
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							UserRoleDTO userRoleDTO = this.checkPartyMemberOrWarmHeated(applyCreateGroupFormDTO.getApp(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
														applyCreateGroupFormDTO.getUserId(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
														applyCreateGroupFormDTO.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							ResiGroupStatisticalDTO resiGroupStatisticalDTO=new ResiGroupStatisticalDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupStatisticalDTO.setResiGroupId(resiGroupEntity.getId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupStatisticalDTO.setTotalMembers(NumConstant.ONE); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupStatisticalDTO.setTotalNormalMemebers(NumConstant.ONE); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupStatisticalDTO.setTotalTopics(NumConstant.ZERO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupStatisticalDTO.setTotalIssues(NumConstant.ZERO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if(NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								resiGroupStatisticalDTO.setTotalPartyMembers(NumConstant.ONE); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							}else{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								resiGroupStatisticalDTO.setTotalPartyMembers(NumConstant.ZERO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if(NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								resiGroupStatisticalDTO.setTotalEarnestMemebers(NumConstant.ONE); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							}else{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								resiGroupStatisticalDTO.setTotalEarnestMemebers(NumConstant.ZERO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupStatisticalService.save(resiGroupStatisticalDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							return new Result(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -346,8 +411,8 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if (null == tokenDto || StringUtils.isBlank(tokenDto.getUserId())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								return new Result().error(ModuleConstant.USER_NOT_NULL); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							boolean flag = this.checkPartyMemberOrWarmHeated(tokenDto.getApp(), tokenDto.getUserId(), customerId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if (!flag) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							UserRoleDTO userRoleDTO = this.checkPartyMemberOrWarmHeated(tokenDto.getApp(), tokenDto.getUserId(), customerId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if (!NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag()) && !NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								Result errorResult = new Result(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								errorResult.setCode(EpmetErrorCode.CANNOT_CREATE_GROUP.getValue()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								errorResult.setMsg(EpmetErrorCode.CANNOT_CREATE_GROUP.getName()); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -356,6 +421,69 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							return new Result(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						/** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 * @param agreeApplyGroupFormDTO | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 * @return com.epmet.commons.tools.utils.Result | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 * @Author yinzuomei | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 * @Description 审核群申请-测试用后面会放到政府端 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 * @Date 2020/3/31 12:44 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 **/ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						@Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						public Result agreeApplyGroup(AgreeApplyGroupFormDTO agreeApplyGroupFormDTO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//1、更新组的状态
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							ResiGroupDTO resiGroupDTO = this.get(agreeApplyGroupFormDTO.getGroupId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupDTO.setState(GroupStateConstant.GROUP_APPROVED); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							this.update(resiGroupDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//2、更新组的申请记录改为已通过
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							ResiGroupOperationDTO resiGroupOperation = resiGroupOperationDao.selectGroupApplyRecord(agreeApplyGroupFormDTO.getGroupId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupOperation.setState(GroupStateConstant.GROUP_APPROVED); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupOperation.setOperateUserId(agreeApplyGroupFormDTO.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupOperationService.update(resiGroupOperation); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//3、将群主在群成员的状态改为已通过
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							ResiGroupMemberDTO resiGroupMemberDTO=resiGroupMemberDao.selectLeaderMember(agreeApplyGroupFormDTO.getGroupId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupMemberDTO.setStatus(MemberStateConstant.APPROVED); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupMemberService.update(resiGroupMemberDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//4、更新群主的出入群记录改为已通过
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							GroupMemeberOperationDTO groupMemeberOperationDTO=groupMemeberOperationDao.selectLeaderRecord(agreeApplyGroupFormDTO.getGroupId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							groupMemeberOperationDTO.setOperateStatus(MemberStateConstant.APPROVED); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							groupMemeberOperationDTO.setOperateUserId(agreeApplyGroupFormDTO.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							groupMemeberOperationService.update(groupMemeberOperationDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//5、给用户发送消息???待定
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							return new Result(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						/** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 * @param disAgreeApplyGroupFormDTO | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 * @return com.epmet.commons.tools.utils.Result | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 * @Author yinzuomei | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 * @Description 审核(拒绝)群申请-测试用后面会放到政府端 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 * @Date 2020/3/31 13:22 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 **/ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						@Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						public Result disagreeApplyGroup(DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//1、更新组的状态
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							ResiGroupDTO resiGroupDTO = this.get(disAgreeApplyGroupFormDTO.getGroupId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupDTO.setState(GroupStateConstant.GROUP_REJECTED); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							this.update(resiGroupDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//2、更新组的申请记录改为已通过
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							ResiGroupOperationDTO resiGroupOperation = resiGroupOperationDao.selectGroupApplyRecord(disAgreeApplyGroupFormDTO.getGroupId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupOperation.setState(GroupStateConstant.GROUP_REJECTED); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupOperation.setOperateUserId(disAgreeApplyGroupFormDTO.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupOperation.setOperateReason(disAgreeApplyGroupFormDTO.getRejectReason()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupOperationService.update(resiGroupOperation); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//3、将群主在群成员的状态改为已通过
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							ResiGroupMemberDTO resiGroupMemberDTO=resiGroupMemberDao.selectLeaderMember(disAgreeApplyGroupFormDTO.getGroupId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupMemberDTO.setStatus(MemberStateConstant.REJECTED); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							resiGroupMemberService.update(resiGroupMemberDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//4、更新群主的出入群记录改为已通过
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							GroupMemeberOperationDTO groupMemeberOperationDTO=groupMemeberOperationDao.selectLeaderRecord(disAgreeApplyGroupFormDTO.getGroupId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							groupMemeberOperationDTO.setOperateStatus(MemberStateConstant.REJECTED); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							groupMemeberOperationDTO.setOperateUserId(disAgreeApplyGroupFormDTO.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							groupMemeberOperationService.update(groupMemeberOperationDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//5、给用户发送消息???待定
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							return new Result(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						/** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 * @param app | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 * @param userId | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -365,8 +493,8 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 * @Description 用户拥有党员或者热心居民标签返回true, 没有权限返回false | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 * @Date 2020/3/30 16:33 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 **/ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						private boolean checkPartyMemberOrWarmHeated(String app, String userId, String customerId) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							boolean flag = false; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						private UserRoleDTO checkPartyMemberOrWarmHeated(String app, String userId, String customerId) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							UserRoleDTO userRoleDTO = new UserRoleDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							UserRoleFormDTO userRoleFormDTO = new UserRoleFormDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							userRoleFormDTO.setApp(app); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							userRoleFormDTO.setCustomerId(customerId); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -374,19 +502,23 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							Result<List<UserRoleResultDTO>> userRoleListResult = epmetUserFeignClient.getUserRoleInfo(userRoleFormDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if (!userRoleListResult.success()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								logger.info("获取用户角色feign调用失败" + userRoleListResult.getMsg()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								return flag; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								return userRoleDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							List<UserRoleResultDTO> userRoleList = userRoleListResult.getData(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if (null == userRoleList || userRoleList.size() == 0) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								return flag; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								return userRoleDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							for (UserRoleResultDTO userRoleResultDTO : userRoleList) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								if (EpmetRoleKeyConstant.PARTYMEMBER.equals(userRoleResultDTO.getRoleKey()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										|| EpmetRoleKeyConstant.WARMHEARTED.equals(userRoleResultDTO.getRoleKey())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									flag = true; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									break; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								if (EpmetRoleKeyConstant.PARTYMEMBER.equals(userRoleResultDTO.getRoleKey())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									userRoleDTO.setPartymemberFlag(NumConstant.ONE_STR); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								if (EpmetRoleKeyConstant.WARMHEARTED.equals(userRoleResultDTO.getRoleKey())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									userRoleDTO.setWarmHeartedFlag(NumConstant.ONE_STR); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								if (EpmetRoleKeyConstant.REGISTERED_RESI.equals(userRoleResultDTO.getRoleKey())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									userRoleDTO.setRegisteredResiFlag(NumConstant.ONE_STR); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							return flag; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							return userRoleDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					} | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
					 | 
				
				 | 
				
					
  |