Commit 563b384c by 段启岩

修复不会删除旧引用数量的问题

parent 0a52c239
...@@ -368,7 +368,7 @@ public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements IB ...@@ -368,7 +368,7 @@ public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements IB
List<String> referencedTopicIds = List<String> referencedTopicIds =
topicReferenceService.list(topicReferenceQueryWrapper).stream() topicReferenceService.list(topicReferenceQueryWrapper).stream()
.map(TopicReference::getTopicId).collect(Collectors.toList()); .map(TopicReference::getTopicId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(referencedTopicIds)) { if (!CollectionUtils.isEmpty(referencedTopicIds)) {
// 减少话题引用测试 // 减少话题引用测试
topicService.decreaseReferenceCountBatch(referencedTopicIds, 1); topicService.decreaseReferenceCountBatch(referencedTopicIds, 1);
} }
...@@ -405,7 +405,7 @@ public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements IB ...@@ -405,7 +405,7 @@ public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements IB
List<String> referencedTagIds = List<String> referencedTagIds =
blogTagService.list(blogTagQueryWrapper).stream() blogTagService.list(blogTagQueryWrapper).stream()
.map(BlogTag::getTagId).collect(Collectors.toList()); .map(BlogTag::getTagId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(referencedTagIds)) { if (!CollectionUtils.isEmpty(referencedTagIds)) {
// 减少标签引用次数 // 减少标签引用次数
tagService.decreaseReferenceCountBatch(referencedTagIds, 1); tagService.decreaseReferenceCountBatch(referencedTagIds, 1);
} }
......
...@@ -331,7 +331,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i ...@@ -331,7 +331,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
List<String> referencedTopicIds = List<String> referencedTopicIds =
topicReferenceService.list(topicReferenceQueryWrapper).stream() topicReferenceService.list(topicReferenceQueryWrapper).stream()
.map(TopicReference::getTopicId).collect(Collectors.toList()); .map(TopicReference::getTopicId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(referencedTopicIds)) { if (!CollectionUtils.isEmpty(referencedTopicIds)) {
// 减少话题引用数量 // 减少话题引用数量
topicService.decreaseReferenceCountBatch(referencedTopicIds, 1); topicService.decreaseReferenceCountBatch(referencedTopicIds, 1);
} }
...@@ -369,7 +369,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i ...@@ -369,7 +369,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
List<String> referencedTagIds = List<String> referencedTagIds =
questionTagService.list(questionTagQueryWrapper).stream() questionTagService.list(questionTagQueryWrapper).stream()
.map(QuestionTag::getTagId).collect(Collectors.toList()); .map(QuestionTag::getTagId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(referencedTagIds)) { if (!CollectionUtils.isEmpty(referencedTagIds)) {
// 减少标签引用数量 // 减少标签引用数量
tagService.decreaseReferenceCountBatch(referencedTagIds, 1); tagService.decreaseReferenceCountBatch(referencedTagIds, 1);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment