|
|
@ -155,23 +155,19 @@ public class TopicShareLinkRecordServiceImpl extends BaseServiceImpl<TopicShareL |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public TopicVisitResultDTO topicVisit(TopicVisitFormDTO formDTO, TokenDto tokenDto) { |
|
|
|
String topicId = null; |
|
|
|
if (StringUtils.isNotBlank(formDTO.getShareLinkId())){ |
|
|
|
// 点击页面上的分享时
|
|
|
|
TopicShareLinkRecordEntity linkRecord = baseDao.selectById(formDTO.getShareLinkId()); |
|
|
|
if (null == linkRecord){ |
|
|
|
throw new RenException(TopicShareConstant.NOT_EXIST_INVITE_RECORD); |
|
|
|
} |
|
|
|
TopicShareLinkVisitRecordEntity entity = new TopicShareLinkVisitRecordEntity(); |
|
|
|
entity.setCustomerId(linkRecord.getCustomerId()); |
|
|
|
entity.setShareUserId(linkRecord.getShareUserId()); |
|
|
|
entity.setInviteeUserId(tokenDto.getUserId()); |
|
|
|
entity.setShareLinkRecId(formDTO.getShareLinkId()); |
|
|
|
entity.setIsInviteRegister(NumConstant.ONE); |
|
|
|
visitRecordDao.insert(entity); |
|
|
|
topicId = linkRecord.getTopicId(); |
|
|
|
}else topicId = formDTO.getTopicId(); |
|
|
|
TopicVisitResultDTO result = baseDao.selectTopicInfoById(topicId); |
|
|
|
// 点击页面上的分享时
|
|
|
|
TopicShareLinkRecordEntity linkRecord = baseDao.selectById(formDTO.getShareLinkId()); |
|
|
|
if (null == linkRecord){ |
|
|
|
throw new RenException(TopicShareConstant.NOT_EXIST_INVITE_RECORD); |
|
|
|
} |
|
|
|
TopicShareLinkVisitRecordEntity entity = new TopicShareLinkVisitRecordEntity(); |
|
|
|
entity.setCustomerId(linkRecord.getCustomerId()); |
|
|
|
entity.setShareUserId(linkRecord.getShareUserId()); |
|
|
|
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); |
|
|
|
} |
|
|
|