|
@ -32,6 +32,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.commons.tools.utils.SendMqMsgUtils; |
|
|
import com.epmet.commons.tools.utils.SendMqMsgUtils; |
|
|
import com.epmet.constant.ReadFlagConstant; |
|
|
import com.epmet.constant.ReadFlagConstant; |
|
|
|
|
|
import com.epmet.dto.IssueShareLinkVisitRecordDTO; |
|
|
import com.epmet.dto.form.*; |
|
|
import com.epmet.dto.form.*; |
|
|
import com.epmet.dto.result.UserResiInfoResultDTO; |
|
|
import com.epmet.dto.result.UserResiInfoResultDTO; |
|
|
import com.epmet.feign.EpmetMessageOpenFeignClient; |
|
|
import com.epmet.feign.EpmetMessageOpenFeignClient; |
|
@ -51,6 +52,7 @@ import com.epmet.modules.member.redis.ResiGroupMemberRedis; |
|
|
import com.epmet.modules.member.service.GroupMemeberOperationService; |
|
|
import com.epmet.modules.member.service.GroupMemeberOperationService; |
|
|
import com.epmet.modules.member.service.ResiGroupMemberService; |
|
|
import com.epmet.modules.member.service.ResiGroupMemberService; |
|
|
import com.epmet.modules.topic.dao.ResiTopicDao; |
|
|
import com.epmet.modules.topic.dao.ResiTopicDao; |
|
|
|
|
|
import com.epmet.modules.topic.entity.TopicShareLinkVisitRecordEntity; |
|
|
import com.epmet.modules.topic.service.ResiTopicService; |
|
|
import com.epmet.modules.topic.service.ResiTopicService; |
|
|
import com.epmet.modules.topic.service.TopicShareLinkVisitRecordService; |
|
|
import com.epmet.modules.topic.service.TopicShareLinkVisitRecordService; |
|
|
import com.epmet.modules.utils.ModuleConstant; |
|
|
import com.epmet.modules.utils.ModuleConstant; |
|
@ -116,8 +118,6 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD |
|
|
@Autowired |
|
|
@Autowired |
|
|
private ResiTopicService resiTopicService; |
|
|
private ResiTopicService resiTopicService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private ResiTopicDao topicDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ResiGroupMemberRedis resiGroupMemberRedis; |
|
|
private ResiGroupMemberRedis resiGroupMemberRedis; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
@ -494,22 +494,34 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD |
|
|
resiGroupRedis.set(groupCache); |
|
|
resiGroupRedis.set(groupCache); |
|
|
} |
|
|
} |
|
|
//9、查询当前入组申请人是否是通过话题/议题链接入组,如果是,要给邀请人发送积分事件
|
|
|
//9、查询当前入组申请人是否是通过话题/议题链接入组,如果是,要给邀请人发送积分事件
|
|
|
|
|
|
|
|
|
Map<String,String> inviterMap = null; |
|
|
Map<String,String> inviterMap = null; |
|
|
|
|
|
String inviter = null; |
|
|
|
|
|
boolean isNew = false; |
|
|
|
|
|
//通过链接和访问记录查询出被邀请人是新用户还是已注册用户
|
|
|
if(StringUtils.equals(groupMemeberOperationDTO.getEnterGroupType(),ModuleConstant.ENTER_GROUP_TYPE_TOPIC_LINK)){ |
|
|
if(StringUtils.equals(groupMemeberOperationDTO.getEnterGroupType(),ModuleConstant.ENTER_GROUP_TYPE_TOPIC_LINK)){ |
|
|
inviterMap = topicShareLinkVisitRecordService.getInviter(groupMemeberOperationDTO.getCustomerUserId(),groupMemeberOperationDTO.getGroupId()); |
|
|
TopicShareLinkVisitRecordEntity visitRecord = topicShareLinkVisitRecordService.getByLinkIdAndInvitee(groupMemeberOperationDTO.getGroupInvitationId(), groupMemeberOperationDTO.getCustomerUserId()); |
|
|
|
|
|
if(null == visitRecord){ |
|
|
|
|
|
logger.error("【%s】该用户入组方式为话题分享链接入组,但未查询到链接访问方式记录,链接Id【%s】",groupMemeberOperationDTO.getCustomerUserId(),groupMemeberOperationDTO.getGroupInvitationId()); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
if(NumConstant.ZERO == visitRecord.getIsInviteRegister()) isNew = true; |
|
|
|
|
|
inviter = visitRecord.getShareUserId(); |
|
|
}else if(StringUtils.equals(groupMemeberOperationDTO.getEnterGroupType(),ModuleConstant.ENTER_GROUP_TYPE_ISSUE_LINK)){ |
|
|
}else if(StringUtils.equals(groupMemeberOperationDTO.getEnterGroupType(),ModuleConstant.ENTER_GROUP_TYPE_ISSUE_LINK)){ |
|
|
List<String> issues = topicDao.selectIssueIdsByGroupId(groupMemeberOperationDTO.getGroupId()); |
|
|
Result<IssueShareLinkVisitRecordDTO> response = issueClient.visitRecord(groupMemeberOperationDTO.getGroupInvitationId(), groupMemeberOperationDTO.getCustomerUserId()); |
|
|
if(!CollectionUtils.isEmpty(issues)){ |
|
|
if(response.success() && null != response){ |
|
|
Result<Map<String,String>> inviterResult = issueClient.inviter(groupMemeberOperationDTO.getCustomerUserId(),issues); |
|
|
if(NumConstant.ONE != response.getData().getIfJoinGroup()){ |
|
|
if(inviterResult.success() && !CollectionUtils.isEmpty(inviterResult.getData())) inviterMap = inviterResult.getData(); |
|
|
logger.error("【%s】该用户入组方式为议题分享链接入组,但并不是通过该链接发起的入群申请,链接Id【%s】",groupMemeberOperationDTO.getCustomerUserId(),groupMemeberOperationDTO.getGroupInvitationId()); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
if(NumConstant.ZERO == response.getData().getIsInviteRegister()) isNew = true; |
|
|
|
|
|
inviter = response.getData().getShareUserId(); |
|
|
|
|
|
}else{ |
|
|
|
|
|
logger.error("【%s】该用户入组方式为议题分享链接入组,但未查询到链接访问方式记录,链接Id【%s】",groupMemeberOperationDTO.getCustomerUserId(),groupMemeberOperationDTO.getGroupInvitationId()); |
|
|
|
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
if(!CollectionUtils.isEmpty(inviterMap)){ |
|
|
if(StringUtils.isNotBlank(inviter)){ |
|
|
//groupMemeberOperationDTO.getCreatedTime()
|
|
|
|
|
|
|
|
|
|
|
|
boolean isNew = StringUtils.isBlank(inviterMap.get("new")); |
|
|
|
|
|
|
|
|
|
|
|
//mq的事件类型
|
|
|
//mq的事件类型
|
|
|
MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO(); |
|
|
MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO(); |
|
|
//事件code
|
|
|
//事件code
|
|
@ -517,7 +529,7 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD |
|
|
List<BasePointEventMsg> pointEventMsgList = new ArrayList<>(); |
|
|
List<BasePointEventMsg> pointEventMsgList = new ArrayList<>(); |
|
|
BasePointEventMsg pointEventMsg = new BasePointEventMsg(); |
|
|
BasePointEventMsg pointEventMsg = new BasePointEventMsg(); |
|
|
pointEventMsg.setCustomerId(groupCache.getCustomerId()); |
|
|
pointEventMsg.setCustomerId(groupCache.getCustomerId()); |
|
|
pointEventMsg.setUserId(isNew ? inviterMap.get("new") : inviterMap.get("register")); |
|
|
pointEventMsg.setUserId(inviter); |
|
|
pointEventMsg.setActionFlag(MqConstant.PLUS); |
|
|
pointEventMsg.setActionFlag(MqConstant.PLUS); |
|
|
pointEventMsg.setIsCommon(false); |
|
|
pointEventMsg.setIsCommon(false); |
|
|
pointEventMsg.setTargetDate(groupMemeberOperationDTO.getCreatedTime()); |
|
|
pointEventMsg.setTargetDate(groupMemeberOperationDTO.getCreatedTime()); |
|
|