From 661b04c4283a8c5d9905c7cdee72ed23c353f116 Mon Sep 17 00:00:00 2001 From: Bill <771989711@qq.com> Date: Mon, 9 Oct 2023 10:06:13 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91=E9=80=9A=E8=BF=87=E6=A0=87=E7=AD=BE=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=96=87=E7=AB=A0=E5=88=97=E8=A1=A8=201.?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E7=AB=A0=E6=A0=87=E7=AD=BEtag=5Fcus?= =?UTF-8?q?tomer=E8=A1=A8=201.1=20tag=5Fcustomer=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=97=E6=AE=B5=20TAG=5FCATEGORY=20?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=88=86=E7=B1=BB(=E5=85=9A=E5=BB=BA?= =?UTF-8?q?=E5=A3=B0=E9=9F=B3=EF=BC=9AVOICE=EF=BC=9B=E7=A4=BE=E5=8C=BA?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=EF=BC=9ANOTICE=EF=BC=9B=E9=BB=98=E8=AE=A4DEF?= =?UTF-8?q?AULTD=201.2=20=E7=BB=99=E5=AF=B9=E5=BA=94=E7=9A=84=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E7=9A=84=E5=88=86=E7=B1=BB=E5=AD=97=E6=AE=B5=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E8=B5=8B=E5=80=BC=202.=E9=80=9A=E8=BF=87=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E5=88=86=E7=B1=BB=E8=8E=B7=E5=8F=96=E6=94=B9=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E4=B8=8B=E7=9A=84=E6=89=80=E6=9C=89=E6=A0=87=E7=AD=BE?= =?UTF-8?q?ID=EF=BC=88=E5=AD=90=E6=9F=A5=E8=AF=A2=EF=BC=89=EF=BC=8C?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=AF=B9=E5=BA=94=E7=9A=84=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/ArticleListFormDTO.java | 5 ++ .../dto/form/TagCustomerPageFormDTO.java | 5 ++ .../epmet/controller/ArticleController.java | 7 ++ .../main/java/com/epmet/dao/ArticleDao.java | 2 + .../java/com/epmet/dao/TagCustomerDao.java | 2 +- .../com/epmet/service/ArticleService.java | 2 + .../service/impl/ArticleServiceImpl.java | 39 ++++++++++ .../service/impl/TagCustomerServiceImpl.java | 2 +- .../db/migration/V0.0.13__tag_category.sql | 2 + .../src/main/resources/mapper/ArticleDao.xml | 74 +++++++++++++++++++ .../main/resources/mapper/TagCustomerDao.xml | 3 + 11 files changed, 141 insertions(+), 2 deletions(-) create mode 100644 code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.13__tag_category.sql diff --git a/code/smart-community/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleListFormDTO.java b/code/smart-community/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleListFormDTO.java index 0a601e98..80be0456 100644 --- a/code/smart-community/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleListFormDTO.java +++ b/code/smart-community/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleListFormDTO.java @@ -57,4 +57,9 @@ public class ArticleListFormDTO implements Serializable { private String agencyId; private String staffId; + /** + * 文章标签分类 + */ + private String tagCategory; + } diff --git a/code/smart-community/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TagCustomerPageFormDTO.java b/code/smart-community/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TagCustomerPageFormDTO.java index 04ee2370..21e40f58 100644 --- a/code/smart-community/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TagCustomerPageFormDTO.java +++ b/code/smart-community/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TagCustomerPageFormDTO.java @@ -34,6 +34,11 @@ public class TagCustomerPageFormDTO implements Serializable { */ private String tagName; + /** + * 标签分类 + */ + private String tagCategory; + @NotNull(message = "页码不能为空", groups = PageUserInternalGroup.class) private Integer pageNo; diff --git a/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 77ef7f43..da150691 100644 --- a/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -441,6 +441,13 @@ public class ArticleController { return new Result>().ok(articleService.articleListV2(formDTO)); } + @PostMapping("articleList") + public Result> articleList(@LoginUser TokenDto tokenDTO, @RequestBody ArticleListFormDTO formDTO) { + formDTO.setCustomerId(tokenDTO.getCustomerId()); +// formDTO.setStaffId(tokenDTO.getUserId()); + return new Result>().ok(articleService.articleList(formDTO)); + } + /** * 文章置顶、取消置顶 * @param formDTO diff --git a/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java b/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java index c9749471..abfe3ddc 100644 --- a/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java +++ b/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java @@ -168,6 +168,8 @@ public interface ArticleDao extends BaseDao { List selectAllArticle(ArticleListFormDTO formDTO); + List selectAllArticle2(ArticleListFormDTO formDTO); + /** * 根据标签名,查询文章列表 * @param gridId diff --git a/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.java b/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.java index fcc0e268..c870a8e6 100644 --- a/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.java +++ b/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.java @@ -63,7 +63,7 @@ public interface TagCustomerDao extends BaseDao { * @param tagName * @return */ - List pageList(@Param("customerId") String customerId, @Param("tagName")String tagName); + List pageList(@Param("customerId") String customerId, @Param("tagName")String tagName, @Param("tagCategory") String tagCategory); /** * 钉钉实时动态,获取网格所属社区下, 的标签列表 diff --git a/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index 499ed51a..d56c8d03 100644 --- a/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -254,6 +254,8 @@ public interface ArticleService extends BaseService { PageData articleListV2(ArticleListFormDTO formDTO); + PageData articleList(ArticleListFormDTO formDTO); + PublishedListResultDTO detailV2(ArticleListFormDTO formDTO); void topArticle(String articleId, String type,String imgUrl); diff --git a/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index f51705af..f6b7db3a 100644 --- a/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -1737,6 +1737,45 @@ public class ArticleServiceImpl extends BaseServiceImpl(list, pageInfo.getTotal()); } + @Override + public PageData articleList(ArticleListFormDTO formDTO) { + +// TagCustomerPageFormDTO tagFormDTO = new TagCustomerPageFormDTO(); +// tagFormDTO.setCustomerId(formDTO.getCustomerId()); +// tagFormDTO.setTagCategory(formDTO.getTagCategory()); +// tagFormDTO.setPageNo(1); +// tagFormDTO.setPageSize(Integer.MAX_VALUE); +// +// PageData pageData = tagCustomerService.page(tagFormDTO); +// if(pageData != null) { +// List tagCustomerDTOS = pageData.getList(); +// +// if(tagCustomerDTOS != null && tagCustomerDTOS.size() != 0) { +// List tagIds = new ArrayList<>(); +// for (TagCustomerDTO tag: tagCustomerDTOS) { +// tagIds.add(tag.getId()); +// } +// +// formDTO.setTagIds(tagIds); +// } +// } + + //列表查询 + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = baseDao.selectAllArticle2(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + + //封装数据 + if (!CollectionUtils.isEmpty(list)) { + list.forEach(l->{ + l.setTagNameList(StringUtils.isNotBlank(l.getTags())?Arrays.asList(l.getTags().split("[|]")):new ArrayList<>()); + l.setIsMePublished(l.getCreatedBy().equals(formDTO.getStaffId())?true:false); + }); + } + + return new PageData<>(list, pageInfo.getTotal()); + } + @Override public PublishedListResultDTO detailV2(ArticleListFormDTO formDTO) { PublishedListResultDTO resultDTO = new PublishedListResultDTO(); diff --git a/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java b/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java index 380ac1c6..a183ff6d 100644 --- a/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java +++ b/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java @@ -86,7 +86,7 @@ public class TagCustomerServiceImpl extends BaseServiceImpl page(TagCustomerPageFormDTO formDTO) { PageHelper.startPage(formDTO.getPageNo(),formDTO.getPageSize()); - List list=baseDao.pageList(formDTO.getCustomerId(),formDTO.getTagName()); + List list=baseDao.pageList(formDTO.getCustomerId(),formDTO.getTagName(), formDTO.getTagCategory()); PageInfo pageInfo = new PageInfo<>(list); return new PageData<>(list, pageInfo.getTotal()); } diff --git a/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.13__tag_category.sql b/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.13__tag_category.sql new file mode 100644 index 00000000..57713121 --- /dev/null +++ b/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.13__tag_category.sql @@ -0,0 +1,2 @@ +ALTER TABLE `epmet_gov_voice`.`tag_customer` + MODIFY COLUMN `TAG_CATEGORY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签分类(党建声音:VOICE;社区通知:NOTICE;默认DEFAULTD)' AFTER `TAG_NAME`; \ No newline at end of file diff --git a/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml b/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml index 04b8d0d7..7eebcc9e 100644 --- a/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml +++ b/code/smart-community/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml @@ -508,6 +508,80 @@ ORDER BY a.publish_date DESC, a.updated_time DESC + +