Browse Source

修改:文章在编辑时isPublic值跟随分类改变

GDW 10 months ago
parent
commit
e2dccfc4c1

+ 7 - 0
jeecg-module-kms/src/main/java/org/jeecg/modules/kms/knowledge/service/impl/ArticleServiceImpl.java

@@ -109,6 +109,13 @@ public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> impl
 
     @Override
     public void updateArticle(Article article) {
+        String categoryId = article.getCategoryId();
+        Category category = categoryService.getById(categoryId);
+        if (category.getIsPublic().equals("1")){
+            article.setIsPublic("1");
+        } else {
+            article.setIsPublic("0");
+        }
         this.deleteCategoryR(article.getId());
         this.deleteTagR(article.getId());
         this.updateById(article);