fix
Helius
2022-08-30 d39169d41038ed62d1f6a9b25513b247a1a8c02f
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ArticleServiceImpl.java
@@ -132,6 +132,10 @@
        articleEntity.setType(adminAddArticleDto.getType());
        articleEntity.setContentType(adminAddArticleDto.getContentType());
        this.baseMapper.insert(articleEntity);
        if (adminAddArticleDto.getSaveState() == 2) {
            releaseService.releaseArticle(articleEntity.getId(), articleEntity.getCompanyId());
        }
        return Result.ok("添加成功");
    }
@@ -211,6 +215,10 @@
        String authorBelong = adminUpdateArticleDto.getAuthorBelong();
        articleEntity.setAuthorBelong(authorBelong);
        this.baseMapper.updateById(articleEntity);
        if (adminUpdateArticleDto.getSaveState() == 2) {
            releaseService.releaseArticle(articleEntity.getId(), articleEntity.getCompanyId());
        }
        return Result.ok("更新成功");
    }
@@ -223,8 +231,11 @@
                Long articleId = Long.valueOf(articleIdStr);
                ArticleEntity articleEntity = this.baseMapper.selectById(articleId);
                articleEntity.setDelStatus(ArticleEntity.DELETE_STATUS_YES);
                this.baseMapper.updateById(articleEntity);
//                articleEntity.setDelStatus(ArticleEntity.DELETE_STATUS_YES);
//                this.baseMapper.updateById(articleEntity);
                if (articleEntity != null) {
                    this.baseMapper.deleteById(articleId);
                }
            }
        }
        return Result.ok("删除成功");
@@ -292,6 +303,15 @@
            articleEntity.setTimeType(timeType);
        }
        IPage<WebArticleVo> list = this.baseMapper.selectWebArticleInPage(page,articleEntity);
        if (CollUtil.isNotEmpty(list.getRecords())) {
            for (WebArticleVo record : list.getRecords()) {
                // 站内
                if (record.getType() == 1) {
                    record.setArticleUrl(record.getBaseUrl() + record.getPath() + "/" + record.getId() + ".html");
                }
            }
        }
        return Result.ok(list);
    }
@@ -303,7 +323,6 @@
            return Result.fail("文章不存在");
        }
        articleEntity.setReleaseStatus(ArticleEntity.RELEASE_STATUS_YES);
        articleEntity.setBeforeColumnId(null);
        this.baseMapper.updateById(articleEntity);
        releaseService.releaseArticle(articleEntity.getId(), companyId);