|
|
@ -70,6 +70,7 @@ import lombok.Data; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
@ -207,6 +208,7 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl<GroupMemeb |
|
|
|
* @date 2020.12.22 10:36 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public JoinGroupApplyRealTimeResultDTO applyEnterByLink(JoinGroupByShareLinkFormDTO param) { |
|
|
|
JoinGroupApplyRealTimeResultDTO result = new JoinGroupApplyRealTimeResultDTO(); |
|
|
|
Date current = new Date(); |
|
|
@ -228,7 +230,10 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl<GroupMemeb |
|
|
|
} |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(groupId)){ |
|
|
|
throw new RenException("没有找到议题分享链接对应的组Id"); |
|
|
|
throw new RenException("没有找到分享链接对应的组Id"); |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(inviter)){ |
|
|
|
throw new RenException("没有找到邀请人Id"); |
|
|
|
} |
|
|
|
//查询是否在群内
|
|
|
|
ResiGroupMemberDTO groupMember = resiGroupMemberDao.selectGroupMemberInfo(groupId, param.getUserId()); |
|
|
@ -292,18 +297,18 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl<GroupMemeb |
|
|
|
if(StringUtils.equals("topic",param.getShareLinkType())){ |
|
|
|
TopicShareLinkVisitRecordEntity record = topicShareLinkVisitRecordDao.selectRecordByLinkIdAndInvitee(param.getShareLinkId(), param.getUserId()); |
|
|
|
if(null == record){ |
|
|
|
log.error("【%s】该用户入组方式为话题分享链接入组,但未查询到链接访问记录,链接Id【%s】",param.getUserId(),param.getShareLinkId()); |
|
|
|
log.error("【{}】该用户入组方式为话题分享链接入组,但未查询到链接访问记录,链接Id【{}】",param.getUserId(),param.getShareLinkId()); |
|
|
|
throw new RenException("未找到链接访问记录"); |
|
|
|
} |
|
|
|
if(NumConstant.ZERO == record.getIsInviteRegister()) isNew = true; |
|
|
|
}else{ |
|
|
|
Result<IssueShareLinkVisitRecordDTO> visitRecordResult = issueOpenFeignClient.visitRecord(param.getShareLinkId(), param.getUserId()); |
|
|
|
if(!visitRecordResult.success() || null == visitRecordResult.getData()){ |
|
|
|
log.error("【%s】该用户入组方式为议题分享链接入组,但未查询到链接访问记录,链接Id【%s】",param.getUserId(),param.getShareLinkId()); |
|
|
|
log.error("【{}】该用户入组方式为议题分享链接入组,但未查询到链接访问记录,链接Id【{}】",param.getUserId(),param.getShareLinkId()); |
|
|
|
throw new RenException("未找到链接访问记录"); |
|
|
|
} |
|
|
|
if(!visitRecordResult.getData().getIfJoinGroup()){ |
|
|
|
log.error("【%s】该用户入组方式为议题分享链接入组,但并不是通过该链接发起的入群申请,链接Id【%s】",param.getUserId(),param.getShareLinkId()); |
|
|
|
log.error("【{}】该用户入组方式为议题分享链接入组,但并不是通过该链接发起的入群申请,链接Id【{}】",param.getUserId(),param.getShareLinkId()); |
|
|
|
throw new RenException("用户并非通过当前链接申请入组"); |
|
|
|
} |
|
|
|
if(NumConstant.ZERO == visitRecordResult.getData().getIsInviteRegister()) isNew = true; |
|
|
@ -321,12 +326,13 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl<GroupMemeb |
|
|
|
pointEventMsg.setActionFlag(MqConstant.PLUS); |
|
|
|
pointEventMsg.setIsCommon(false); |
|
|
|
pointEventMsg.setTargetDate(current); |
|
|
|
|
|
|
|
pointEventMsgList.add(pointEventMsg); |
|
|
|
|
|
|
|
mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList)); |
|
|
|
Result sendResult = SendMqMsgUtils.sendMsg(mqBaseMsgDTO); |
|
|
|
if(!sendResult.success()){ |
|
|
|
log.error((isNew ? "拉新用户入组事件发送失败" : "邀请已注册用户入组事件发送失败").concat(",参数:%s"),JSON.toJSONString(param)); |
|
|
|
log.error((isNew ? "拉新用户入组事件发送失败" : "邀请已注册用户入组事件发送失败").concat(",参数:{}"),JSON.toJSONString(param)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -385,4 +391,6 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl<GroupMemeb |
|
|
|
} |
|
|
|
return userRoleDTO; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|