|
|
@@ -157,13 +157,13 @@ public class ArticleInfoService extends ServiceImpl<ArticleInfoMapper, ArticleIn
|
|
|
articleInfo.setDigest(infoDTO.getDigest());
|
|
|
articleInfo.updateById();
|
|
|
|
|
|
- // 先删除原有的关联关系
|
|
|
- articleCategoryRelationService.remove(new LambdaQueryWrapper<ArticleCategoryRelation>()
|
|
|
- .eq(ArticleCategoryRelation::getArticleId, articleId));
|
|
|
-
|
|
|
// 再添加新的关联关系
|
|
|
List<Integer> categoryIds = infoDTO.getCategoryIds();
|
|
|
if (!CollectionUtils.isEmpty(categoryIds)) {
|
|
|
+ // 先删除原有的关联关系
|
|
|
+ articleCategoryRelationService.remove(new LambdaQueryWrapper<ArticleCategoryRelation>()
|
|
|
+ .eq(ArticleCategoryRelation::getArticleId, articleId));
|
|
|
+
|
|
|
for (Integer categoryId : categoryIds) {
|
|
|
ArticleCategoryRelation relation = new ArticleCategoryRelation();
|
|
|
relation.setArticleId(articleId);
|