|
|
@ -115,6 +115,7 @@ public class TopicShareLinkRecordServiceImpl extends BaseServiceImpl<TopicShareL |
|
|
|
if (StringUtils.isNotBlank(shareLinkId)){ |
|
|
|
return new CreateUrlResultDTO(shareLinkId); |
|
|
|
} |
|
|
|
// 查询话题信息
|
|
|
|
TopicVisitResultDTO topicInfo = baseDao.selectTopicInfoById(form.getTopicId()); |
|
|
|
if (null == topicInfo){ |
|
|
|
throw new RenException(TopicShareConstant.NOT_EXIST_TOPIC_INFO); |
|
|
@ -126,6 +127,7 @@ public class TopicShareLinkRecordServiceImpl extends BaseServiceImpl<TopicShareL |
|
|
|
entity.setTopicId(form.getTopicId()); |
|
|
|
entity.setShareUserId(tokenDto.getUserId()); |
|
|
|
entity.setInviteContent(null); |
|
|
|
// 插入链接记录
|
|
|
|
baseDao.insert(entity); |
|
|
|
return new CreateUrlResultDTO(entity.getId()); |
|
|
|
} |
|
|
@ -157,6 +159,7 @@ public class TopicShareLinkRecordServiceImpl extends BaseServiceImpl<TopicShareL |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public TopicVisitResultDTO topicVisit(TopicVisitFormDTO formDTO, TokenDto tokenDto) { |
|
|
|
// 根据分享ID查询分享信息
|
|
|
|
TopicShareLinkRecordEntity linkRecord = baseDao.selectById(formDTO.getShareLinkId()); |
|
|
|
if (null == linkRecord){ |
|
|
|
throw new RenException(TopicShareConstant.NOT_EXIST_INVITE_RECORD); |
|
|
@ -167,17 +170,21 @@ public class TopicShareLinkRecordServiceImpl extends BaseServiceImpl<TopicShareL |
|
|
|
entity.setInviteeUserId(tokenDto.getUserId()); |
|
|
|
entity.setShareLinkRecId(formDTO.getShareLinkId()); |
|
|
|
entity.setIsInviteRegister(NumConstant.ONE); |
|
|
|
// 插入访问记录
|
|
|
|
visitRecordDao.insert(entity); |
|
|
|
// 查询记录对应的话题信息
|
|
|
|
TopicVisitResultDTO result = baseDao.selectTopicInfoById(linkRecord.getTopicId()); |
|
|
|
if (null == result){ |
|
|
|
throw new RenException(TopicShareConstant.NOT_EXIST_TOPIC_INFO); |
|
|
|
} |
|
|
|
// 查询是否在组内,在组内的话,是否存在入组审核的状态为false
|
|
|
|
Integer userInGroup = resiGroupMemberDao.checkUserInGroup(tokenDto.getUserId(), result.getGroupId()); |
|
|
|
if (userInGroup > NumConstant.ZERO){ |
|
|
|
result.setAwaitAudit(false); |
|
|
|
result.setInGroup(true); |
|
|
|
}else { |
|
|
|
result.setInGroup(false); |
|
|
|
// 查询是否存在入组审核记录
|
|
|
|
Integer awaitAudit = groupMemeberOperationDao.checkAwaitAudit(tokenDto.getUserId(), result.getGroupId()); |
|
|
|
result.setAwaitAudit(awaitAudit > NumConstant.ZERO ? true : false); |
|
|
|
} |
|
|
|