src/main/java/com/xcong/farmer/cms/core/handler/ArticlesDataParserHandler.java
@@ -34,7 +34,6 @@ log.info("文章列表解析"); Long companyId = (Long) node.getSystemDataValue("companyId"); Articles param = (Articles) node.getParam(); ArticleEntity article = new ArticleEntity(); Page<ArticleEntity> page = new Page<>(Integer.parseInt(param.getPage()), Integer.parseInt(param.getLimit())); if (StrUtil.isEmpty(param.getColId())) { @@ -51,6 +50,10 @@ article.setColumnIds(colIds); } article.setCompanyId(companyId); Integer releaseType = (Integer) node.getSystemDataValue("releaseType"); article.setReleaseType(releaseType); IPage<ArticleEntity> listPage = articleMapper.selectArticleInPage(page, article); List<ArticleData> list = new ArrayList<>(); src/main/java/com/xcong/farmer/cms/modules/system/entity/ArticleEntity.java
@@ -108,4 +108,7 @@ @TableField(exist = false) private String timeType; @TableField(exist = false) private Integer releaseType; } src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ReleaseServiceImpl.java
@@ -79,6 +79,7 @@ ColumnEntity columnEntity = columnMapper.selectById(id); Map<String, Object> map = buildColumnData(columnEntity); map.put("releaseType", type); executor.execute(() -> { cmsCoreService.columnProcess(map, columnEntity.getListTemplate()); releaseIndex(companyId); @@ -93,8 +94,20 @@ Map<String, Object> data = buildColumnData(column); cmsCoreService.columnProcess(data, column.getListTemplate()); List<Long> ids = articleMapper.selectArticleIdsByColumnId(column.getId(), companyId,type); cmsCoreService.articlesProcess(data, ids, column.getArticleTemplate(), column.getPath()); List<ArticleEntity> articles = articleMapper.selectArticleByColumnId(columnEntity.getId(), companyId, type); if (CollUtil.isNotEmpty(articles)) { for (ArticleEntity article : articles) { if (article.getReleaseStatus() == 0) { article.setReleaseStatus(1); articleMapper.updateById(article); } if (article.getType() == 1) { map.put("id", article.getId()); cmsCoreService.articleProcess(map, columnEntity.getArticleTemplate(), columnEntity.getPath()); } } } } } } @@ -102,6 +115,11 @@ List<ArticleEntity> articles = articleMapper.selectArticleByColumnId(columnEntity.getId(), companyId, type); if (CollUtil.isNotEmpty(articles)) { for (ArticleEntity article : articles) { if (article.getReleaseStatus() == 0) { article.setReleaseStatus(1); articleMapper.updateById(article); } if (article.getType() == 1) { map.put("id", article.getId()); cmsCoreService.articleProcess(map, columnEntity.getArticleTemplate(), columnEntity.getPath()); src/main/resources/mapper/ArticleMapper.xml
@@ -48,7 +48,7 @@ <select id="selectPrevOrNextArticle" resultType="com.xcong.farmer.cms.modules.system.entity.ArticleEntity"> select * from t_article a, t_column b where a.id!=#{id} and (a.column_id=b.id or a.column_id=b.parent_id) and a.column_id=#{columnId} where a.id!=#{id} and (a.column_id=b.id or a.column_id=b.parent_id) and a.column_id=#{columnId} and release_status=1 <!--上一篇--> <if test="type == 1"> order by a.id @@ -86,6 +86,9 @@ ${item} </foreach> </if> <if test="record.releaseType == 2"> and release_status = 1 </if> </where> order by release_time desc </select>