|
|
|
@ -33,7 +33,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@ -175,7 +174,6 @@ public class TiktokSopServiceImpl extends ServiceImpl<SopMapper, SopEntity> impl
|
|
|
|
|
List<KeyWordEntity> keyWordByFilterKeys = new ArrayList<>();
|
|
|
|
|
List<SopDto.PreciseResource> keyWordByMatchKeys = new ArrayList<>();
|
|
|
|
|
if (CollUtil.isNotEmpty(keyWordEntityList)) {
|
|
|
|
|
|
|
|
|
|
for (KeyWordEntity keyWord : keyWordEntityList) {
|
|
|
|
|
if (keyWord.getType() == 0) {
|
|
|
|
|
keyWordBySearchKeys.add(keyWord);
|
|
|
|
@ -223,7 +221,7 @@ public class TiktokSopServiceImpl extends ServiceImpl<SopMapper, SopEntity> impl
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Transactional
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
@Override
|
|
|
|
|
public void updateSop(SopEntity sop) {
|
|
|
|
|
this.updateById(sop);
|
|
|
|
@ -236,9 +234,13 @@ public class TiktokSopServiceImpl extends ServiceImpl<SopMapper, SopEntity> impl
|
|
|
|
|
sopMapper.deleteById(sopId);
|
|
|
|
|
//删除关键词
|
|
|
|
|
List<Long> keyWordIds = keyWordMapper.queryIdbySopIdAndType(sopId, 2);
|
|
|
|
|
|
|
|
|
|
keyWordMapper.deleteBySopId(sopId);
|
|
|
|
|
//删除回评内容
|
|
|
|
|
reviewContentMapper.deleteByKeyWordIds(keyWordIds);
|
|
|
|
|
|
|
|
|
|
QueryWrapper<ReviewContentEntity> deleteByKeyWordIds = new QueryWrapper<>();
|
|
|
|
|
deleteByKeyWordIds.in("key_word_id", keyWordIds);
|
|
|
|
|
reviewContentMapper.delete(deleteByKeyWordIds);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -271,9 +273,9 @@ public class TiktokSopServiceImpl extends ServiceImpl<SopMapper, SopEntity> impl
|
|
|
|
|
String word = keyWord.getWord();
|
|
|
|
|
//搜索
|
|
|
|
|
boolean searchValue = reqSearchVideo(dyId, word, sop.getSopId(), sop.getSopName());
|
|
|
|
|
if (searchValue) {
|
|
|
|
|
setCache(sop.getSearchInterval(), dyId);
|
|
|
|
|
}
|
|
|
|
|
// if (searchValue) {
|
|
|
|
|
// setCache(sop.getSearchInterval(), dyId);
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -398,7 +400,10 @@ public class TiktokSopServiceImpl extends ServiceImpl<SopMapper, SopEntity> impl
|
|
|
|
|
for (int i = 0; i < array.size(); i++) {
|
|
|
|
|
JSONObject comment = array.getJSONObject(i);
|
|
|
|
|
String cid = comment.getStr(DefaultKeyConstants.CID);
|
|
|
|
|
//TODO 评论id加缓存
|
|
|
|
|
// 评论id加缓存
|
|
|
|
|
if (redisUtils.get(DefaultKeyConstants.SOP_COMMENT_KEY + cid) != null) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
String text = comment.getStr("text");
|
|
|
|
|
//评论人
|
|
|
|
|
String userId = comment.getJSONObject(DefaultKeyConstants.USER).getStr(DefaultKeyConstants.UID);
|
|
|
|
@ -418,7 +423,11 @@ public class TiktokSopServiceImpl extends ServiceImpl<SopMapper, SopEntity> impl
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
//TODO 进行回评
|
|
|
|
|
userService.optCommentVideoComment(vendorId, awemeId, cid, contentEntities.get(i).getWord(), userId);
|
|
|
|
|
Result<JSONObject> optCommentVideoCommentResult = userService.optCommentVideoComment(vendorId, awemeId, cid, contentEntities.get(i).getWord(), userId);
|
|
|
|
|
if (optCommentVideoCommentResult.getCode() != HttpStatus.SUCCESS) {
|
|
|
|
|
//未评论成
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
//执行完后,加一
|
|
|
|
|
Object day = redisUtils.get(DefaultKeyConstants.COMMENT_SOP_DAY);
|
|
|
|
|
if (day != null) {
|
|
|
|
@ -450,7 +459,9 @@ public class TiktokSopServiceImpl extends ServiceImpl<SopMapper, SopEntity> impl
|
|
|
|
|
commentEntity.setAvatarUrl(avatarUrl);
|
|
|
|
|
commentEntity.setUniqueId(comment.getStr(DefaultKeyConstants.UNIQUE_ID));
|
|
|
|
|
commentEntity.setOrganizeId(sop.getOrganizeId());
|
|
|
|
|
commentEntity.setCommentType(0);
|
|
|
|
|
list.add(commentEntity);
|
|
|
|
|
redisUtils.set(DefaultKeyConstants.SOP_COMMENT_KEY + cid, DefaultNumberConstants.ZERO_NUMBER);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -576,6 +587,7 @@ public class TiktokSopServiceImpl extends ServiceImpl<SopMapper, SopEntity> impl
|
|
|
|
|
followerListEntity.setFollowStatus(0);
|
|
|
|
|
followerListEntity.setUserId(uid);
|
|
|
|
|
followerListEntity.setUserNickName(nickname);
|
|
|
|
|
followerListEntity.setVendorId(dyId);
|
|
|
|
|
followerListEntities.add(followerListEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|