From 8af03f655afc278f4fc4c3c95491a124a6adfd54 Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 24 Apr 2023 14:44:20 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=EF=BC=9A=E3=80=90=E7=81=B5?= =?UTF-8?q?=E5=B1=B1=E5=A4=A7=E5=B1=8F-=E5=85=9A=E5=BB=BA=E5=AE=A3?= =?UTF-8?q?=E4=BC=A0=E3=80=91=E5=88=97=E8=A1=A8-=E5=A2=9E=E5=8A=A0category?= =?UTF-8?q?=E5=8F=82=E6=95=B0=EF=BC=8C=E4=BC=A0=E9=80=92=E4=B8=80=E7=BA=A7?= =?UTF-8?q?=E6=A0=8F=E7=9B=AEid=EF=BC=8C=E6=9F=A5=E8=AF=A2=E8=AF=A5?= =?UTF-8?q?=E6=A0=8F=E7=9B=AE=E4=B8=8B=E7=9A=84=E6=96=87=E7=AB=A0=E3=80=82?= =?UTF-8?q?2.=E4=BF=AE=E6=94=B9=EF=BC=9A=E3=80=90=E7=81=B5=E5=B1=B1?= =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E3=80=91=E6=96=87=E7=AB=A0=E8=AF=A6=E6=83=85?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0categroy=E5=92=8CcategoryName?= =?UTF-8?q?=E7=9A=84=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/ArticleListFormDTO.java | 10 ++++++++ .../dto/result/PublishedListResultDTO.java | 5 ++++ .../service/impl/ArticleServiceImpl.java | 23 +++++++++++++++++++ .../src/main/resources/mapper/ArticleDao.xml | 8 +++++++ 4 files changed, 46 insertions(+) diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleListFormDTO.java index 0a601e9802..aad4177f65 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleListFormDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleListFormDTO.java @@ -14,6 +14,16 @@ import java.util.List; public class ArticleListFormDTO implements Serializable { private static final long serialVersionUID = 6397877545890473794L; + /** + * 栏目 + */ + private String category; + + /** + * 子栏目列表 + */ + private List subCategories; + /** * 文章标题 */ diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/PublishedListResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/PublishedListResultDTO.java index 78ff5fe7f9..c776b6c943 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/PublishedListResultDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/PublishedListResultDTO.java @@ -26,6 +26,11 @@ public class PublishedListResultDTO implements Serializable { * 分类 */ private String category; + + /** + * 栏目名称 + */ + private String categoryName; /** * 组织Id */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index c8146140d2..f51170a09c 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -131,6 +131,9 @@ public class ArticleServiceImpl extends BaseServiceImpl subCategories; + if (StringUtils.isNotBlank(categoryId = formDTO.getCategory())) { + LambdaQueryWrapper cq = new LambdaQueryWrapper<>(); + cq.eq(CategoryDictEntity::getPid, categoryId); + List subCtgs = categoryDictDao.selectList(cq); + if (! CollectionUtils.isEmpty(subCtgs)) { + subCategories = subCtgs.stream().map(CategoryDictEntity::getId).collect(Collectors.toList()); + formDTO.setSubCategories(subCategories); + } + } + List list = baseDao.selectAllArticle(formDTO); PageInfo pageInfo = new PageInfo<>(list); @@ -1790,6 +1807,12 @@ public class ArticleServiceImpl extends BaseServiceImpl + + and a.CATEGORY in ( + + #{category} + + ) + AND a.id = #{articleId}