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 + +