From 6f088cbbb6021a42d739f4c0a9296017ff194f8f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 1 Jun 2020 23:23:06 +0800 Subject: [PATCH 01/54] =?UTF-8?q?=E5=85=9A=E5=BB=BA=E5=A3=B0=E9=9F=B3?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96controller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/ArticleController.java | 9 +++++++++ .../java/com/epmet/controller/DraftController.java | 9 +++++++++ .../main/java/com/epmet/controller/TagController.java | 9 +++++++++ .../src/main/java/com/epmet/dao/.gitkeep | 0 .../src/main/java/com/epmet/service/.gitkeep | 0 .../src/main/resources/mapper/.gitkeep | 0 .../java/com/epmet/controller/VoiceController.java | 11 +++++++++++ .../java/com/epmet/controller/ArticleController.java | 9 +++++++++ 8 files changed, 47 insertions(+) create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/.gitkeep create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/.gitkeep create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/.gitkeep create mode 100644 epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/VoiceController.java create mode 100644 epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java new file mode 100644 index 0000000000..46cce7aeed --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -0,0 +1,9 @@ +package com.epmet.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("article") +public class ArticleController { +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java new file mode 100644 index 0000000000..d7cfa21d01 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java @@ -0,0 +1,9 @@ +package com.epmet.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("draft") +public class DraftController { +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java new file mode 100644 index 0000000000..40c0d0e5e4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java @@ -0,0 +1,9 @@ +package com.epmet.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("tag") +public class TagController { +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/.gitkeep b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/.gitkeep b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/.gitkeep b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/VoiceController.java b/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/VoiceController.java new file mode 100644 index 0000000000..7e05f3c359 --- /dev/null +++ b/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/VoiceController.java @@ -0,0 +1,11 @@ +package com.epmet.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("voice") +public class VoiceController { + //最新党建声音列表 + //首页轮播图列表 +} diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java new file mode 100644 index 0000000000..46cce7aeed --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -0,0 +1,9 @@ +package com.epmet.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("article") +public class ArticleController { +} From b90b0e8aa115a0ea0564a5a1572edc24cf2f6995 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 2 Jun 2020 09:54:53 +0800 Subject: [PATCH 02/54] =?UTF-8?q?gov-voice=E6=9C=8D=E5=8A=A1=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/ArticleContentDTO.java | 106 ++++++++++++ .../java/com/epmet/dto/ArticleCoverDTO.java | 96 +++++++++++ .../main/java/com/epmet/dto/ArticleDTO.java | 156 ++++++++++++++++++ .../epmet/dto/ArticleOperateRecordDTO.java | 101 ++++++++++++ .../com/epmet/dto/ArticlePublishRangeDTO.java | 96 +++++++++++ .../java/com/epmet/dto/ArticleTagsDTO.java | 91 ++++++++++ .../com/epmet/dto/ArticleVisitRecordDTO.java | 91 ++++++++++ .../java/com/epmet/dto/DraftContentDTO.java | 106 ++++++++++++ .../java/com/epmet/dto/DraftCoverDTO.java | 96 +++++++++++ .../src/main/java/com/epmet/dto/DraftDTO.java | 146 ++++++++++++++++ .../com/epmet/dto/DraftPublishRangeDTO.java | 96 +++++++++++ .../java/com/epmet/dto/TagCustomerDTO.java | 86 ++++++++++ .../java/com/epmet/dto/TagDefaultDTO.java | 76 +++++++++ .../main/java/com/epmet/dto/TagGridDTO.java | 96 +++++++++++ .../main/java/com/epmet/dto/form}/.gitkeep | 0 .../main/java/com/epmet/dto/result}/.gitkeep | 0 .../com/epmet/constant/ArticleConstant.java | 17 ++ .../com/epmet/constant/DraftConstant.java | 17 ++ .../java/com/epmet/constant/TagConstant.java | 17 ++ .../controller/ArticleContentController.java | 94 +++++++++++ .../epmet/controller/ArticleController.java | 91 +++++++++- .../controller/ArticleCoverController.java | 94 +++++++++++ .../ArticleOperateRecordController.java | 94 +++++++++++ .../ArticlePublishRangeController.java | 94 +++++++++++ .../controller/ArticleTagsController.java | 94 +++++++++++ .../ArticleVisitRecordController.java | 94 +++++++++++ .../controller/DraftContentController.java | 94 +++++++++++ .../com/epmet/controller/DraftController.java | 91 +++++++++- .../controller/DraftCoverController.java | 94 +++++++++++ .../DraftPublishRangeController.java | 94 +++++++++++ .../controller/TagCustomerController.java | 94 +++++++++++ .../controller/TagDefaultController.java | 94 +++++++++++ .../epmet/controller/TagGridController.java | 94 +++++++++++ .../java/com/epmet/dao/ArticleContentDao.java | 33 ++++ .../java/com/epmet/dao/ArticleCoverDao.java | 33 ++++ .../main/java/com/epmet/dao/ArticleDao.java | 33 ++++ .../epmet/dao/ArticleOperateRecordDao.java | 33 ++++ .../com/epmet/dao/ArticlePublishRangeDao.java | 33 ++++ .../java/com/epmet/dao/ArticleTagsDao.java | 33 ++++ .../com/epmet/dao/ArticleVisitRecordDao.java | 33 ++++ .../java/com/epmet/dao/DraftContentDao.java | 33 ++++ .../java/com/epmet/dao/DraftCoverDao.java | 33 ++++ .../src/main/java/com/epmet/dao/DraftDao.java | 33 ++++ .../com/epmet/dao/DraftPublishRangeDao.java | 33 ++++ .../java/com/epmet/dao/TagCustomerDao.java | 33 ++++ .../java/com/epmet/dao/TagDefaultDao.java | 33 ++++ .../main/java/com/epmet/dao/TagGridDao.java | 33 ++++ .../epmet/entity/ArticleContentEntity.java | 76 +++++++++ .../com/epmet/entity/ArticleCoverEntity.java | 66 ++++++++ .../java/com/epmet/entity/ArticleEntity.java | 126 ++++++++++++++ .../entity/ArticleOperateRecordEntity.java | 71 ++++++++ .../entity/ArticlePublishRangeEntity.java | 66 ++++++++ .../com/epmet/entity/ArticleTagsEntity.java | 61 +++++++ .../entity/ArticleVisitRecordEntity.java | 61 +++++++ .../com/epmet/entity/DraftContentEntity.java | 76 +++++++++ .../com/epmet/entity/DraftCoverEntity.java | 66 ++++++++ .../java/com/epmet/entity/DraftEntity.java | 116 +++++++++++++ .../epmet/entity/DraftPublishRangeEntity.java | 66 ++++++++ .../com/epmet/entity/TagCustomerEntity.java | 56 +++++++ .../com/epmet/entity/TagDefaultEntity.java | 46 ++++++ .../java/com/epmet/entity/TagGridEntity.java | 66 ++++++++ .../com/epmet/excel/ArticleContentExcel.java | 77 +++++++++ .../com/epmet/excel/ArticleCoverExcel.java | 71 ++++++++ .../java/com/epmet/excel/ArticleExcel.java | 107 ++++++++++++ .../excel/ArticleOperateRecordExcel.java | 74 +++++++++ .../epmet/excel/ArticlePublishRangeExcel.java | 71 ++++++++ .../com/epmet/excel/ArticleTagsExcel.java | 68 ++++++++ .../epmet/excel/ArticleVisitRecordExcel.java | 68 ++++++++ .../com/epmet/excel/DraftContentExcel.java | 77 +++++++++ .../java/com/epmet/excel/DraftCoverExcel.java | 71 ++++++++ .../main/java/com/epmet/excel/DraftExcel.java | 101 ++++++++++++ .../epmet/excel/DraftPublishRangeExcel.java | 71 ++++++++ .../com/epmet/excel/TagCustomerExcel.java | 65 ++++++++ .../java/com/epmet/excel/TagDefaultExcel.java | 59 +++++++ .../java/com/epmet/excel/TagGridExcel.java | 71 ++++++++ .../com/epmet/redis/ArticleContentRedis.java | 47 ++++++ .../com/epmet/redis/ArticleCoverRedis.java | 47 ++++++ .../redis/ArticleOperateRecordRedis.java | 47 ++++++ .../epmet/redis/ArticlePublishRangeRedis.java | 47 ++++++ .../java/com/epmet/redis/ArticleRedis.java | 47 ++++++ .../com/epmet/redis/ArticleTagsRedis.java | 47 ++++++ .../epmet/redis/ArticleVisitRecordRedis.java | 47 ++++++ .../com/epmet/redis/DraftContentRedis.java | 47 ++++++ .../java/com/epmet/redis/DraftCoverRedis.java | 47 ++++++ .../epmet/redis/DraftPublishRangeRedis.java | 47 ++++++ .../main/java/com/epmet/redis/DraftRedis.java | 47 ++++++ .../com/epmet/redis/TagCustomerRedis.java | 47 ++++++ .../java/com/epmet/redis/TagDefaultRedis.java | 47 ++++++ .../java/com/epmet/redis/TagGridRedis.java | 47 ++++++ .../epmet/service/ArticleContentService.java | 95 +++++++++++ .../epmet/service/ArticleCoverService.java | 95 +++++++++++ .../service/ArticleOperateRecordService.java | 95 +++++++++++ .../service/ArticlePublishRangeService.java | 95 +++++++++++ .../com/epmet/service/ArticleService.java | 95 +++++++++++ .../com/epmet/service/ArticleTagsService.java | 95 +++++++++++ .../service/ArticleVisitRecordService.java | 95 +++++++++++ .../epmet/service/DraftContentService.java | 95 +++++++++++ .../com/epmet/service/DraftCoverService.java | 95 +++++++++++ .../service/DraftPublishRangeService.java | 95 +++++++++++ .../java/com/epmet/service/DraftService.java | 95 +++++++++++ .../com/epmet/service/TagCustomerService.java | 95 +++++++++++ .../com/epmet/service/TagDefaultService.java | 95 +++++++++++ .../com/epmet/service/TagGridService.java | 95 +++++++++++ .../impl/ArticleContentServiceImpl.java | 104 ++++++++++++ .../service/impl/ArticleCoverServiceImpl.java | 104 ++++++++++++ .../impl/ArticleOperateRecordServiceImpl.java | 104 ++++++++++++ .../impl/ArticlePublishRangeServiceImpl.java | 104 ++++++++++++ .../service/impl/ArticleServiceImpl.java | 104 ++++++++++++ .../service/impl/ArticleTagsServiceImpl.java | 104 ++++++++++++ .../impl/ArticleVisitRecordServiceImpl.java | 104 ++++++++++++ .../service/impl/DraftContentServiceImpl.java | 104 ++++++++++++ .../service/impl/DraftCoverServiceImpl.java | 104 ++++++++++++ .../impl/DraftPublishRangeServiceImpl.java | 104 ++++++++++++ .../epmet/service/impl/DraftServiceImpl.java | 104 ++++++++++++ .../service/impl/TagCustomerServiceImpl.java | 104 ++++++++++++ .../service/impl/TagDefaultServiceImpl.java | 104 ++++++++++++ .../service/impl/TagGridServiceImpl.java | 104 ++++++++++++ .../src/main/resources/mapper/.gitkeep | 0 .../resources/mapper/ArticleContentDao.xml | 7 + .../main/resources/mapper/ArticleCoverDao.xml | 7 + .../src/main/resources/mapper/ArticleDao.xml | 6 + .../mapper/ArticleOperateRecordDao.xml | 7 + .../mapper/ArticlePublishRangeDao.xml | 7 + .../main/resources/mapper/ArticleTagsDao.xml | 7 + .../mapper/ArticleVisitRecordDao.xml | 7 + .../main/resources/mapper/DraftContentDao.xml | 7 + .../main/resources/mapper/DraftCoverDao.xml | 7 + .../src/main/resources/mapper/DraftDao.xml | 7 + .../resources/mapper/DraftPublishRangeDao.xml | 7 + .../main/resources/mapper/TagCustomerDao.xml | 7 + .../main/resources/mapper/TagDefaultDao.xml | 7 + .../src/main/resources/mapper/TagGridDao.xml | 7 + 132 files changed, 8867 insertions(+), 6 deletions(-) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleCoverDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleOperateRecordDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticlePublishRangeDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleTagsDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleVisitRecordDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftCoverDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftPublishRangeDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagCustomerDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagDefaultDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagGridDTO.java rename epmet-module/gov-voice/{gov-voice-server/src/main/java/com/epmet/dao => gov-voice-client/src/main/java/com/epmet/dto/form}/.gitkeep (100%) rename epmet-module/gov-voice/{gov-voice-server/src/main/java/com/epmet/service => gov-voice-client/src/main/java/com/epmet/dto/result}/.gitkeep (100%) create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleContentController.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleCoverController.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleOperateRecordController.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticlePublishRangeController.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleTagsController.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleVisitRecordController.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftContentController.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftCoverController.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftPublishRangeController.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagCustomerController.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagDefaultController.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagGridController.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleContentDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleCoverDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleOperateRecordDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticlePublishRangeDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleTagsDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleVisitRecordDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftContentDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftCoverDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftPublishRangeDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagDefaultDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagGridDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleContentEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleCoverEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleOperateRecordEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticlePublishRangeEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleTagsEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleVisitRecordEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftContentEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftCoverEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftPublishRangeEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagCustomerEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagDefaultEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagGridEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleContentExcel.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleCoverExcel.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleExcel.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleOperateRecordExcel.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticlePublishRangeExcel.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleTagsExcel.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleVisitRecordExcel.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftContentExcel.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftCoverExcel.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftExcel.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftPublishRangeExcel.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/TagCustomerExcel.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/TagDefaultExcel.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/TagGridExcel.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleContentRedis.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleCoverRedis.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleOperateRecordRedis.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticlePublishRangeRedis.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleRedis.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleTagsRedis.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleVisitRecordRedis.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftContentRedis.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftCoverRedis.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftPublishRangeRedis.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftRedis.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagCustomerRedis.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagDefaultRedis.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagGridRedis.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleContentService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleCoverService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleOperateRecordService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticlePublishRangeService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleTagsService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleVisitRecordService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftContentService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftCoverService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftPublishRangeService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagDefaultService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagGridService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleContentServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleCoverServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleOperateRecordServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticlePublishRangeServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleTagsServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleVisitRecordServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftContentServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftCoverServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftPublishRangeServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagDefaultServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagGridServiceImpl.java delete mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/.gitkeep create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleContentDao.xml create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleCoverDao.xml create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleOperateRecordDao.xml create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.xml create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleTagsDao.xml create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleVisitRecordDao.xml create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftContentDao.xml create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftCoverDao.xml create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftPublishRangeDao.xml create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagDefaultDao.xml create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagGridDao.xml diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java new file mode 100644 index 0000000000..88aa05b3a8 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticleContentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 审核状态 通过:pass;失败:fail;审核中:auditing + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleCoverDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleCoverDTO.java new file mode 100644 index 0000000000..ad9e063b58 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleCoverDTO.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticleCoverDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 封面图片地址 url地址 + */ + private String imgUrl; + + /** + * 审核状态 通过:pass;失败:fail;审核中:auditing + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleDTO.java new file mode 100644 index 0000000000..79cb1bb2bd --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleDTO.java @@ -0,0 +1,156 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 草稿ID + */ + private String draftId; + + /** + * 文章标题 + */ + private String title; + + /** + * 文章内容 精简内容 + */ + private String previewContent; + + /** + * 是否置顶 + */ + private Integer isTop; + + /** + * 发布范围描述 所有发布范围集合 + */ + private String publishRangeDesc; + + /** + * 发布单位ID + */ + private String publisherId; + + /** + * 发布单位名称 + */ + private String publisherName; + + /** + * 发布单位类型 机关:agency;部门:department;网格:grid + */ + private Integer publisherType; + + /** + * 发布时间 + */ + private Date publishDate; + + /** + * 发布状态 已发布:published;已下线:offline + */ + private String statusFlag; + + /** + * 下线时间 + */ + private Date offLineTime; + + /** + * 文章标签串 竖杠分割的标签名称 + */ + private String tags; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织ID路径 eg:字段为def:abc + */ + private String orgIdPath; + + /** + * 网格ID 数据权限使用 + */ + private String gridId; + + /** + * 部门ID 数据权限使用 + */ + private String departmentId; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleOperateRecordDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleOperateRecordDTO.java new file mode 100644 index 0000000000..2bc20ce5ae --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleOperateRecordDTO.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticleOperateRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 执行人 xx街道-xx中心-姓名 + */ + private String opUser; + + /** + * 操作内容 操作内容,eg:重新编辑文章; + */ + private String content; + + /** + * 操作类型 发布文章:publish;取消文章置顶:canceltop;设置置顶:settom;下线文章:offline;修改文章发布范围:updatepublishrange + */ + private String opType; + + /** + * 操作时间 + */ + private Date opTime; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticlePublishRangeDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticlePublishRangeDTO.java new file mode 100644 index 0000000000..84a24f947b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticlePublishRangeDTO.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticlePublishRangeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 下线时间 + */ + private Date offLineTime; + + /** + * 发布状态 + */ + private String publishStatus; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleTagsDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleTagsDTO.java new file mode 100644 index 0000000000..0db5cd3f30 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleTagsDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticleTagsDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 标签ID + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleVisitRecordDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleVisitRecordDTO.java new file mode 100644 index 0000000000..4ac7e6a720 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleVisitRecordDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticleVisitRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 用户ID + */ + private String userId; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java new file mode 100644 index 0000000000..b0699b4c59 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class DraftContentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 草稿ID + */ + private String draftId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 审核状态 通过:pass;失败:fail; + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftCoverDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftCoverDTO.java new file mode 100644 index 0000000000..e3b5c98a04 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftCoverDTO.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 草稿封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class DraftCoverDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 草稿ID + */ + private String draftId; + + /** + * 封面图片地址 url地址 + */ + private String imgUrl; + + /** + * 审核状态 通过:pass;失败:fail; + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftDTO.java new file mode 100644 index 0000000000..0e4ebd954b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftDTO.java @@ -0,0 +1,146 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 草稿表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class DraftDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章标题 + */ + private String title; + + /** + * 文章内容 精简内容 + */ + private String previewContent; + + /** + * 是否置顶 + */ + private Integer isTop; + + /** + * 发布范围描述 所有发布范围集合 + */ + private String publishRangeDesc; + + /** + * 发布单位ID + */ + private String publisherId; + + /** + * 发布单位名称 + */ + private String publisherName; + + /** + * 发布单位类型 机关:agency;部门:department;网格:grid + */ + private Integer publisherType; + + /** + * 发布时间 + */ + private Date publishDate; + + /** + * 发布状态 未发布:unpublish ;已发布:published,审核中:auditing + */ + private String statusFlag; + + /** + * 文章标签串 竖杠分割的标签名称 + */ + private String tags; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织ID路径 eg:字段为def:abc + */ + private String orgIdPath; + + /** + * 网格ID 数据权限使用 + */ + private String gridId; + + /** + * 部门ID 数据权限使用 + */ + private String departmentId; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftPublishRangeDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftPublishRangeDTO.java new file mode 100644 index 0000000000..b0c57bb112 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftPublishRangeDTO.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 草稿发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class DraftPublishRangeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * ID草稿 + */ + private String draftId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 下线时间 + */ + private Date offLineTime; + + /** + * 发布状态 未发布:unpublish ;已发布:published + */ + private String publishStatus; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagCustomerDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagCustomerDTO.java new file mode 100644 index 0000000000..33415b9d95 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagCustomerDTO.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class TagCustomerDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 使用计数 + */ + private Integer useCount; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagDefaultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagDefaultDTO.java new file mode 100644 index 0000000000..5a0a6524a7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagDefaultDTO.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 默认标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class TagDefaultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagGridDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagGridDTO.java new file mode 100644 index 0000000000..d5a6ae2760 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagGridDTO.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 网格标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class TagGridDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 使用计数 + */ + private Integer useCount; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/.gitkeep b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/.gitkeep similarity index 100% rename from epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/.gitkeep rename to epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/.gitkeep diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/.gitkeep b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/.gitkeep similarity index 100% rename from epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/.gitkeep rename to epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/.gitkeep diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java new file mode 100644 index 0000000000..308585c78b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.epmet.constant; + +/** + * 常量 + * @author sun + * @since 1.0.0 + */ +public interface ArticleConstant { +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java new file mode 100644 index 0000000000..915a4eef57 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.epmet.constant; + +/** + * 常量 + * @author sun + * @since 1.0.0 + */ +public interface DraftConstant { +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java new file mode 100644 index 0000000000..bac2953abd --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.epmet.constant; + +/** + * 常量 + * @author sun + * @since 1.0.0 + */ +public interface TagConstant { +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleContentController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleContentController.java new file mode 100644 index 0000000000..4edca1a60d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleContentController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.ArticleContentDTO; +import com.epmet.excel.ArticleContentExcel; +import com.epmet.service.ArticleContentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 文章内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("articlecontent") +public class ArticleContentController { + + @Autowired + private ArticleContentService articleContentService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = articleContentService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ArticleContentDTO data = articleContentService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ArticleContentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + articleContentService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ArticleContentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + articleContentService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + articleContentService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = articleContentService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ArticleContentExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 46cce7aeed..e1f69c6a2e 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -1,9 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package com.epmet.controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.ArticleDTO; +import com.epmet.excel.ArticleExcel; +import com.epmet.service.ArticleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + +/** + * 文章表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ @RestController @RequestMapping("article") public class ArticleController { -} + + @Autowired + private ArticleService articleService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = articleService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ArticleDTO data = articleService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ArticleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + articleService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ArticleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + articleService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + articleService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = articleService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ArticleExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleCoverController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleCoverController.java new file mode 100644 index 0000000000..5f84494bab --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleCoverController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.ArticleCoverDTO; +import com.epmet.excel.ArticleCoverExcel; +import com.epmet.service.ArticleCoverService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 文章封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("articlecover") +public class ArticleCoverController { + + @Autowired + private ArticleCoverService articleCoverService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = articleCoverService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ArticleCoverDTO data = articleCoverService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ArticleCoverDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + articleCoverService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ArticleCoverDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + articleCoverService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + articleCoverService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = articleCoverService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ArticleCoverExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleOperateRecordController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleOperateRecordController.java new file mode 100644 index 0000000000..3fd7dbfeeb --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleOperateRecordController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.ArticleOperateRecordDTO; +import com.epmet.excel.ArticleOperateRecordExcel; +import com.epmet.service.ArticleOperateRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 文章操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("articleoperaterecord") +public class ArticleOperateRecordController { + + @Autowired + private ArticleOperateRecordService articleOperateRecordService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = articleOperateRecordService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ArticleOperateRecordDTO data = articleOperateRecordService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ArticleOperateRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + articleOperateRecordService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ArticleOperateRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + articleOperateRecordService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + articleOperateRecordService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = articleOperateRecordService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ArticleOperateRecordExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticlePublishRangeController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticlePublishRangeController.java new file mode 100644 index 0000000000..e075ec871a --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticlePublishRangeController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.ArticlePublishRangeDTO; +import com.epmet.excel.ArticlePublishRangeExcel; +import com.epmet.service.ArticlePublishRangeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("articlepublishrange") +public class ArticlePublishRangeController { + + @Autowired + private ArticlePublishRangeService articlePublishRangeService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = articlePublishRangeService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ArticlePublishRangeDTO data = articlePublishRangeService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ArticlePublishRangeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + articlePublishRangeService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ArticlePublishRangeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + articlePublishRangeService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + articlePublishRangeService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = articlePublishRangeService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ArticlePublishRangeExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleTagsController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleTagsController.java new file mode 100644 index 0000000000..deccf70345 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleTagsController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.ArticleTagsDTO; +import com.epmet.excel.ArticleTagsExcel; +import com.epmet.service.ArticleTagsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("articletags") +public class ArticleTagsController { + + @Autowired + private ArticleTagsService articleTagsService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = articleTagsService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ArticleTagsDTO data = articleTagsService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ArticleTagsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + articleTagsService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ArticleTagsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + articleTagsService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + articleTagsService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = articleTagsService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ArticleTagsExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleVisitRecordController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleVisitRecordController.java new file mode 100644 index 0000000000..8d3bfa3859 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleVisitRecordController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.ArticleVisitRecordDTO; +import com.epmet.excel.ArticleVisitRecordExcel; +import com.epmet.service.ArticleVisitRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("articlevisitrecord") +public class ArticleVisitRecordController { + + @Autowired + private ArticleVisitRecordService articleVisitRecordService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = articleVisitRecordService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ArticleVisitRecordDTO data = articleVisitRecordService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ArticleVisitRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + articleVisitRecordService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ArticleVisitRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + articleVisitRecordService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + articleVisitRecordService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = articleVisitRecordService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ArticleVisitRecordExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftContentController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftContentController.java new file mode 100644 index 0000000000..c05fda4cc7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftContentController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.DraftContentDTO; +import com.epmet.excel.DraftContentExcel; +import com.epmet.service.DraftContentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("draftcontent") +public class DraftContentController { + + @Autowired + private DraftContentService draftContentService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = draftContentService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + DraftContentDTO data = draftContentService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody DraftContentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + draftContentService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody DraftContentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + draftContentService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + draftContentService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = draftContentService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, DraftContentExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java index d7cfa21d01..9b69445888 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java @@ -1,9 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package com.epmet.controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.DraftDTO; +import com.epmet.excel.DraftExcel; +import com.epmet.service.DraftService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + +/** + * 草稿表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ @RestController @RequestMapping("draft") public class DraftController { -} + + @Autowired + private DraftService draftService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = draftService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + DraftDTO data = draftService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody DraftDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + draftService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody DraftDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + draftService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + draftService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = draftService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, DraftExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftCoverController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftCoverController.java new file mode 100644 index 0000000000..e4606661bb --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftCoverController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.DraftCoverDTO; +import com.epmet.excel.DraftCoverExcel; +import com.epmet.service.DraftCoverService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 草稿封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("draftcover") +public class DraftCoverController { + + @Autowired + private DraftCoverService draftCoverService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = draftCoverService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + DraftCoverDTO data = draftCoverService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody DraftCoverDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + draftCoverService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody DraftCoverDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + draftCoverService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + draftCoverService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = draftCoverService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, DraftCoverExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftPublishRangeController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftPublishRangeController.java new file mode 100644 index 0000000000..a17d349e66 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftPublishRangeController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.DraftPublishRangeDTO; +import com.epmet.excel.DraftPublishRangeExcel; +import com.epmet.service.DraftPublishRangeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 草稿发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("draftpublishrange") +public class DraftPublishRangeController { + + @Autowired + private DraftPublishRangeService draftPublishRangeService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = draftPublishRangeService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + DraftPublishRangeDTO data = draftPublishRangeService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody DraftPublishRangeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + draftPublishRangeService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody DraftPublishRangeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + draftPublishRangeService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + draftPublishRangeService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = draftPublishRangeService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, DraftPublishRangeExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagCustomerController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagCustomerController.java new file mode 100644 index 0000000000..9e358543c1 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagCustomerController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.TagCustomerDTO; +import com.epmet.excel.TagCustomerExcel; +import com.epmet.service.TagCustomerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 客户标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("tagcustomer") +public class TagCustomerController { + + @Autowired + private TagCustomerService tagCustomerService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = tagCustomerService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + TagCustomerDTO data = tagCustomerService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody TagCustomerDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + tagCustomerService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody TagCustomerDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + tagCustomerService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + tagCustomerService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = tagCustomerService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, TagCustomerExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagDefaultController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagDefaultController.java new file mode 100644 index 0000000000..4983388eea --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagDefaultController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.TagDefaultDTO; +import com.epmet.excel.TagDefaultExcel; +import com.epmet.service.TagDefaultService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 默认标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("tagdefault") +public class TagDefaultController { + + @Autowired + private TagDefaultService tagDefaultService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = tagDefaultService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + TagDefaultDTO data = tagDefaultService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody TagDefaultDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + tagDefaultService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody TagDefaultDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + tagDefaultService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + tagDefaultService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = tagDefaultService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, TagDefaultExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagGridController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagGridController.java new file mode 100644 index 0000000000..eb51f03d87 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagGridController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.TagGridDTO; +import com.epmet.excel.TagGridExcel; +import com.epmet.service.TagGridService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 网格标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("taggrid") +public class TagGridController { + + @Autowired + private TagGridService tagGridService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = tagGridService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + TagGridDTO data = tagGridService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody TagGridDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + tagGridService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody TagGridDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + tagGridService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + tagGridService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = tagGridService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, TagGridExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleContentDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleContentDao.java new file mode 100644 index 0000000000..44d12946d9 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleContentDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ArticleContentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface ArticleContentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleCoverDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleCoverDao.java new file mode 100644 index 0000000000..cd087445ae --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleCoverDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ArticleCoverEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface ArticleCoverDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java new file mode 100644 index 0000000000..d9c4204004 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ArticleEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface ArticleDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleOperateRecordDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleOperateRecordDao.java new file mode 100644 index 0000000000..1b60fdd5d6 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleOperateRecordDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ArticleOperateRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface ArticleOperateRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticlePublishRangeDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticlePublishRangeDao.java new file mode 100644 index 0000000000..d42919cd95 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticlePublishRangeDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ArticlePublishRangeEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface ArticlePublishRangeDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleTagsDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleTagsDao.java new file mode 100644 index 0000000000..44852adba8 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleTagsDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ArticleTagsEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface ArticleTagsDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleVisitRecordDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleVisitRecordDao.java new file mode 100644 index 0000000000..7c89f6ef0b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleVisitRecordDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ArticleVisitRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface ArticleVisitRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftContentDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftContentDao.java new file mode 100644 index 0000000000..8d36568edf --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftContentDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.DraftContentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface DraftContentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftCoverDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftCoverDao.java new file mode 100644 index 0000000000..b625204667 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftCoverDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.DraftCoverEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 草稿封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface DraftCoverDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java new file mode 100644 index 0000000000..53ecc6e594 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.DraftEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 草稿表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface DraftDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftPublishRangeDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftPublishRangeDao.java new file mode 100644 index 0000000000..98a6a65f8e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftPublishRangeDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.DraftPublishRangeEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 草稿发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface DraftPublishRangeDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.java new file mode 100644 index 0000000000..af76d0fdad --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.TagCustomerEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface TagCustomerDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagDefaultDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagDefaultDao.java new file mode 100644 index 0000000000..4de3aae4bf --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagDefaultDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.TagDefaultEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 默认标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface TagDefaultDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagGridDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagGridDao.java new file mode 100644 index 0000000000..ac6dbaf6fe --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagGridDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.TagGridEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface TagGridDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleContentEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleContentEntity.java new file mode 100644 index 0000000000..f4a961b974 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleContentEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("article_content") +public class ArticleContentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 审核状态 通过:pass;失败:fail;审核中:auditing + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleCoverEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleCoverEntity.java new file mode 100644 index 0000000000..9e7d6c8751 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleCoverEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("article_cover") +public class ArticleCoverEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 封面图片地址 url地址 + */ + private String imgUrl; + + /** + * 审核状态 通过:pass;失败:fail;审核中:auditing + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java new file mode 100644 index 0000000000..5768366568 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("article") +public class ArticleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 草稿ID + */ + private String draftId; + + /** + * 文章标题 + */ + private String title; + + /** + * 文章内容 精简内容 + */ + private String previewContent; + + /** + * 是否置顶 + */ + private Integer isTop; + + /** + * 发布范围描述 所有发布范围集合 + */ + private String publishRangeDesc; + + /** + * 发布单位ID + */ + private String publisherId; + + /** + * 发布单位名称 + */ + private String publisherName; + + /** + * 发布单位类型 机关:agency;部门:department;网格:grid + */ + private Integer publisherType; + + /** + * 发布时间 + */ + private Date publishDate; + + /** + * 发布状态 已发布:published;已下线:offline + */ + private String statusFlag; + + /** + * 下线时间 + */ + private Date offLineTime; + + /** + * 文章标签串 竖杠分割的标签名称 + */ + private String tags; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织ID路径 eg:字段为def:abc + */ + private String orgIdPath; + + /** + * 网格ID 数据权限使用 + */ + private String gridId; + + /** + * 部门ID 数据权限使用 + */ + private String departmentId; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleOperateRecordEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleOperateRecordEntity.java new file mode 100644 index 0000000000..bae61d92f1 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleOperateRecordEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("article_operate_record") +public class ArticleOperateRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 执行人 xx街道-xx中心-姓名 + */ + private String opUser; + + /** + * 操作内容 操作内容,eg:重新编辑文章; + */ + private String content; + + /** + * 操作类型 发布文章:publish;取消文章置顶:canceltop;设置置顶:settom;下线文章:offline;修改文章发布范围:updatepublishrange + */ + private String opType; + + /** + * 操作时间 + */ + private Date opTime; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticlePublishRangeEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticlePublishRangeEntity.java new file mode 100644 index 0000000000..9ee3aa1afa --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticlePublishRangeEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("article_publish_range") +public class ArticlePublishRangeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 下线时间 + */ + private Date offLineTime; + + /** + * 发布状态 + */ + private String publishStatus; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleTagsEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleTagsEntity.java new file mode 100644 index 0000000000..af09af33fd --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleTagsEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("article_tags") +public class ArticleTagsEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 标签ID + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleVisitRecordEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleVisitRecordEntity.java new file mode 100644 index 0000000000..6805243128 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleVisitRecordEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("article_visit_record") +public class ArticleVisitRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 用户ID + */ + private String userId; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftContentEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftContentEntity.java new file mode 100644 index 0000000000..a5ab64db0e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftContentEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("draft_content") +public class DraftContentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 草稿ID + */ + private String draftId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 审核状态 通过:pass;失败:fail; + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftCoverEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftCoverEntity.java new file mode 100644 index 0000000000..b7cd32ccd3 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftCoverEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 草稿封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("draft_cover") +public class DraftCoverEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 草稿ID + */ + private String draftId; + + /** + * 封面图片地址 url地址 + */ + private String imgUrl; + + /** + * 审核状态 通过:pass;失败:fail; + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftEntity.java new file mode 100644 index 0000000000..d7fd299501 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftEntity.java @@ -0,0 +1,116 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 草稿表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("draft") +public class DraftEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章标题 + */ + private String title; + + /** + * 文章内容 精简内容 + */ + private String previewContent; + + /** + * 是否置顶 + */ + private Integer isTop; + + /** + * 发布范围描述 所有发布范围集合 + */ + private String publishRangeDesc; + + /** + * 发布单位ID + */ + private String publisherId; + + /** + * 发布单位名称 + */ + private String publisherName; + + /** + * 发布单位类型 机关:agency;部门:department;网格:grid + */ + private Integer publisherType; + + /** + * 发布时间 + */ + private Date publishDate; + + /** + * 发布状态 未发布:unpublish ;已发布:published,审核中:auditing + */ + private String statusFlag; + + /** + * 文章标签串 竖杠分割的标签名称 + */ + private String tags; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织ID路径 eg:字段为def:abc + */ + private String orgIdPath; + + /** + * 网格ID 数据权限使用 + */ + private String gridId; + + /** + * 部门ID 数据权限使用 + */ + private String departmentId; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftPublishRangeEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftPublishRangeEntity.java new file mode 100644 index 0000000000..93833228cf --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftPublishRangeEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 草稿发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("draft_publish_range") +public class DraftPublishRangeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * ID草稿 + */ + private String draftId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 下线时间 + */ + private Date offLineTime; + + /** + * 发布状态 未发布:unpublish ;已发布:published + */ + private String publishStatus; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagCustomerEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagCustomerEntity.java new file mode 100644 index 0000000000..878b9e05e5 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagCustomerEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("tag_customer") +public class TagCustomerEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 使用计数 + */ + private Integer useCount; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagDefaultEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagDefaultEntity.java new file mode 100644 index 0000000000..479d068761 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagDefaultEntity.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 默认标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("tag_default") +public class TagDefaultEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 标签名称 + */ + private String tagName; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagGridEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagGridEntity.java new file mode 100644 index 0000000000..507aed9cd0 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagGridEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 网格标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("tag_grid") +public class TagGridEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 使用计数 + */ + private Integer useCount; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleContentExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleContentExcel.java new file mode 100644 index 0000000000..090b11ce59 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleContentExcel.java @@ -0,0 +1,77 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 文章内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticleContentExcel { + + @Excel(name = "主键ID 主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "文章ID") + private String articleId; + + @Excel(name = "内容") + private String content; + + @Excel(name = "内容类型 图片:img;文字:text") + private String contentType; + + @Excel(name = "审核状态 通过:pass;失败:fail;审核中:auditing") + private String auditStatus; + + @Excel(name = "审核理由") + private String auditReason; + + @Excel(name = "内容顺序 从1开始") + private Integer orderNum; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleCoverExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleCoverExcel.java new file mode 100644 index 0000000000..3b0523effc --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleCoverExcel.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 文章封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticleCoverExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "文章ID") + private String articleId; + + @Excel(name = "封面图片地址 url地址") + private String imgUrl; + + @Excel(name = "审核状态 通过:pass;失败:fail;审核中:auditing") + private String auditStatus; + + @Excel(name = "审核理由") + private String auditReason; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleExcel.java new file mode 100644 index 0000000000..d1c47ccefb --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleExcel.java @@ -0,0 +1,107 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 文章表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticleExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "草稿ID") + private String draftId; + + @Excel(name = "文章标题") + private String title; + + @Excel(name = "文章内容 精简内容") + private String previewContent; + + @Excel(name = "是否置顶") + private Integer isTop; + + @Excel(name = "发布范围描述 所有发布范围集合") + private String publishRangeDesc; + + @Excel(name = "发布单位ID") + private String publisherId; + + @Excel(name = "发布单位名称") + private String publisherName; + + @Excel(name = "发布单位类型 机关:agency;部门:department;网格:grid") + private Integer publisherType; + + @Excel(name = "发布时间") + private Date publishDate; + + @Excel(name = "发布状态 已发布:published;已下线:offline") + private String statusFlag; + + @Excel(name = "下线时间") + private Date offLineTime; + + @Excel(name = "文章标签串 竖杠分割的标签名称") + private String tags; + + @Excel(name = "组织ID") + private String orgId; + + @Excel(name = "组织ID路径 eg:字段为def:abc") + private String orgIdPath; + + @Excel(name = "网格ID 数据权限使用") + private String gridId; + + @Excel(name = "部门ID 数据权限使用") + private String departmentId; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleOperateRecordExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleOperateRecordExcel.java new file mode 100644 index 0000000000..23a6ee7c7d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleOperateRecordExcel.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 文章操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticleOperateRecordExcel { + + @Excel(name = "主键ID 主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "文章ID") + private String articleId; + + @Excel(name = "执行人 xx街道-xx中心-姓名") + private String opUser; + + @Excel(name = "操作内容 操作内容,eg:重新编辑文章;") + private String content; + + @Excel(name = "操作类型 发布文章:publish;取消文章置顶:canceltop;设置置顶:settom;下线文章:offline;修改文章发布范围:updatepublishrange") + private String opType; + + @Excel(name = "操作时间") + private Date opTime; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticlePublishRangeExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticlePublishRangeExcel.java new file mode 100644 index 0000000000..6ac248177e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticlePublishRangeExcel.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticlePublishRangeExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "文章ID") + private String articleId; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "下线时间") + private Date offLineTime; + + @Excel(name = "发布状态") + private String publishStatus; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleTagsExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleTagsExcel.java new file mode 100644 index 0000000000..524f8d972f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleTagsExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticleTagsExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "文章ID") + private String articleId; + + @Excel(name = "标签ID") + private String tagId; + + @Excel(name = "标签名称") + private String tagName; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleVisitRecordExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleVisitRecordExcel.java new file mode 100644 index 0000000000..17baa06b2d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleVisitRecordExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticleVisitRecordExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "文章ID") + private String articleId; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftContentExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftContentExcel.java new file mode 100644 index 0000000000..196a2668c0 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftContentExcel.java @@ -0,0 +1,77 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class DraftContentExcel { + + @Excel(name = "主键ID 主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "草稿ID") + private String draftId; + + @Excel(name = "内容") + private String content; + + @Excel(name = "内容类型 图片:img;文字:text") + private String contentType; + + @Excel(name = "审核状态 通过:pass;失败:fail;") + private String auditStatus; + + @Excel(name = "审核理由") + private String auditReason; + + @Excel(name = "内容顺序 从1开始") + private Integer orderNum; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftCoverExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftCoverExcel.java new file mode 100644 index 0000000000..79be31f82e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftCoverExcel.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 草稿封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class DraftCoverExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "草稿ID") + private String draftId; + + @Excel(name = "封面图片地址 url地址") + private String imgUrl; + + @Excel(name = "审核状态 通过:pass;失败:fail;") + private String auditStatus; + + @Excel(name = "审核理由") + private String auditReason; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftExcel.java new file mode 100644 index 0000000000..55cc07b78c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftExcel.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 草稿表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class DraftExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "文章标题") + private String title; + + @Excel(name = "文章内容 精简内容") + private String previewContent; + + @Excel(name = "是否置顶") + private Integer isTop; + + @Excel(name = "发布范围描述 所有发布范围集合") + private String publishRangeDesc; + + @Excel(name = "发布单位ID") + private String publisherId; + + @Excel(name = "发布单位名称") + private String publisherName; + + @Excel(name = "发布单位类型 机关:agency;部门:department;网格:grid") + private Integer publisherType; + + @Excel(name = "发布时间") + private Date publishDate; + + @Excel(name = "发布状态 未发布:unpublish ;已发布:published,审核中:auditing") + private String statusFlag; + + @Excel(name = "文章标签串 竖杠分割的标签名称") + private String tags; + + @Excel(name = "组织ID") + private String orgId; + + @Excel(name = "组织ID路径 eg:字段为def:abc") + private String orgIdPath; + + @Excel(name = "网格ID 数据权限使用") + private String gridId; + + @Excel(name = "部门ID 数据权限使用") + private String departmentId; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftPublishRangeExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftPublishRangeExcel.java new file mode 100644 index 0000000000..96cabd9723 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftPublishRangeExcel.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 草稿发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class DraftPublishRangeExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "ID草稿") + private String draftId; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "下线时间") + private Date offLineTime; + + @Excel(name = "发布状态 未发布:unpublish ;已发布:published") + private String publishStatus; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/TagCustomerExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/TagCustomerExcel.java new file mode 100644 index 0000000000..498d15587f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/TagCustomerExcel.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 客户标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class TagCustomerExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "标签名称") + private String tagName; + + @Excel(name = "使用计数") + private Integer useCount; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/TagDefaultExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/TagDefaultExcel.java new file mode 100644 index 0000000000..c09474c21b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/TagDefaultExcel.java @@ -0,0 +1,59 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 默认标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class TagDefaultExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "标签名称") + private String tagName; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/TagGridExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/TagGridExcel.java new file mode 100644 index 0000000000..9a08ad832a --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/TagGridExcel.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 网格标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class TagGridExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "标签ID") + private String tagId; + + @Excel(name = "标签名称") + private String tagName; + + @Excel(name = "使用计数") + private Integer useCount; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleContentRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleContentRedis.java new file mode 100644 index 0000000000..46e5931a9f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleContentRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 文章内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class ArticleContentRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleCoverRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleCoverRedis.java new file mode 100644 index 0000000000..a07e70e34f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleCoverRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 文章封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class ArticleCoverRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleOperateRecordRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleOperateRecordRedis.java new file mode 100644 index 0000000000..a9f0b87082 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleOperateRecordRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 文章操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class ArticleOperateRecordRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticlePublishRangeRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticlePublishRangeRedis.java new file mode 100644 index 0000000000..2d6973a237 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticlePublishRangeRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class ArticlePublishRangeRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleRedis.java new file mode 100644 index 0000000000..f3b51ce245 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 文章表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class ArticleRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleTagsRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleTagsRedis.java new file mode 100644 index 0000000000..c4df800cac --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleTagsRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class ArticleTagsRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleVisitRecordRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleVisitRecordRedis.java new file mode 100644 index 0000000000..5143fb466c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleVisitRecordRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class ArticleVisitRecordRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftContentRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftContentRedis.java new file mode 100644 index 0000000000..8defdcfa5d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftContentRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class DraftContentRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftCoverRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftCoverRedis.java new file mode 100644 index 0000000000..43ad67a79c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftCoverRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 草稿封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class DraftCoverRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftPublishRangeRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftPublishRangeRedis.java new file mode 100644 index 0000000000..7de60b82e2 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftPublishRangeRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 草稿发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class DraftPublishRangeRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftRedis.java new file mode 100644 index 0000000000..efbd69581c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 草稿表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class DraftRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagCustomerRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagCustomerRedis.java new file mode 100644 index 0000000000..08faa58c43 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagCustomerRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 客户标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class TagCustomerRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagDefaultRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagDefaultRedis.java new file mode 100644 index 0000000000..2889f6208c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagDefaultRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 默认标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class TagDefaultRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagGridRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagGridRedis.java new file mode 100644 index 0000000000..86527b7153 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagGridRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 网格标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class TagGridRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleContentService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleContentService.java new file mode 100644 index 0000000000..d99c8a3e97 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleContentService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ArticleContentDTO; +import com.epmet.entity.ArticleContentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 文章内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface ArticleContentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ArticleContentDTO + * @author generator + * @date 2020-06-02 + */ + ArticleContentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(ArticleContentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(ArticleContentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleCoverService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleCoverService.java new file mode 100644 index 0000000000..0320c2f173 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleCoverService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ArticleCoverDTO; +import com.epmet.entity.ArticleCoverEntity; + +import java.util.List; +import java.util.Map; + +/** + * 文章封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface ArticleCoverService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ArticleCoverDTO + * @author generator + * @date 2020-06-02 + */ + ArticleCoverDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(ArticleCoverDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(ArticleCoverDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleOperateRecordService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleOperateRecordService.java new file mode 100644 index 0000000000..c8cd715443 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleOperateRecordService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ArticleOperateRecordDTO; +import com.epmet.entity.ArticleOperateRecordEntity; + +import java.util.List; +import java.util.Map; + +/** + * 文章操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface ArticleOperateRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ArticleOperateRecordDTO + * @author generator + * @date 2020-06-02 + */ + ArticleOperateRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(ArticleOperateRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(ArticleOperateRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticlePublishRangeService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticlePublishRangeService.java new file mode 100644 index 0000000000..e6c23554e7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticlePublishRangeService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ArticlePublishRangeDTO; +import com.epmet.entity.ArticlePublishRangeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface ArticlePublishRangeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ArticlePublishRangeDTO + * @author generator + * @date 2020-06-02 + */ + ArticlePublishRangeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(ArticlePublishRangeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(ArticlePublishRangeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java new file mode 100644 index 0000000000..ce2f27cfbc --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ArticleDTO; +import com.epmet.entity.ArticleEntity; + +import java.util.List; +import java.util.Map; + +/** + * 文章表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface ArticleService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ArticleDTO + * @author generator + * @date 2020-06-02 + */ + ArticleDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(ArticleDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(ArticleDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleTagsService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleTagsService.java new file mode 100644 index 0000000000..6a0fae3346 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleTagsService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ArticleTagsDTO; +import com.epmet.entity.ArticleTagsEntity; + +import java.util.List; +import java.util.Map; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface ArticleTagsService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ArticleTagsDTO + * @author generator + * @date 2020-06-02 + */ + ArticleTagsDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(ArticleTagsDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(ArticleTagsDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleVisitRecordService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleVisitRecordService.java new file mode 100644 index 0000000000..cdaa50388c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleVisitRecordService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ArticleVisitRecordDTO; +import com.epmet.entity.ArticleVisitRecordEntity; + +import java.util.List; +import java.util.Map; + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface ArticleVisitRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ArticleVisitRecordDTO + * @author generator + * @date 2020-06-02 + */ + ArticleVisitRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(ArticleVisitRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(ArticleVisitRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftContentService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftContentService.java new file mode 100644 index 0000000000..bc28794b91 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftContentService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.DraftContentDTO; +import com.epmet.entity.DraftContentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface DraftContentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DraftContentDTO + * @author generator + * @date 2020-06-02 + */ + DraftContentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(DraftContentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(DraftContentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftCoverService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftCoverService.java new file mode 100644 index 0000000000..ff35690eb2 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftCoverService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.DraftCoverDTO; +import com.epmet.entity.DraftCoverEntity; + +import java.util.List; +import java.util.Map; + +/** + * 草稿封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface DraftCoverService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DraftCoverDTO + * @author generator + * @date 2020-06-02 + */ + DraftCoverDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(DraftCoverDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(DraftCoverDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftPublishRangeService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftPublishRangeService.java new file mode 100644 index 0000000000..adcf30f72b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftPublishRangeService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.DraftPublishRangeDTO; +import com.epmet.entity.DraftPublishRangeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 草稿发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface DraftPublishRangeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DraftPublishRangeDTO + * @author generator + * @date 2020-06-02 + */ + DraftPublishRangeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(DraftPublishRangeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(DraftPublishRangeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java new file mode 100644 index 0000000000..12446f2e2d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.DraftDTO; +import com.epmet.entity.DraftEntity; + +import java.util.List; +import java.util.Map; + +/** + * 草稿表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface DraftService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DraftDTO + * @author generator + * @date 2020-06-02 + */ + DraftDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(DraftDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(DraftDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java new file mode 100644 index 0000000000..5747f098e8 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.TagCustomerDTO; +import com.epmet.entity.TagCustomerEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface TagCustomerService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return TagCustomerDTO + * @author generator + * @date 2020-06-02 + */ + TagCustomerDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(TagCustomerDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(TagCustomerDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagDefaultService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagDefaultService.java new file mode 100644 index 0000000000..18fdbd0988 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagDefaultService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.TagDefaultDTO; +import com.epmet.entity.TagDefaultEntity; + +import java.util.List; +import java.util.Map; + +/** + * 默认标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface TagDefaultService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return TagDefaultDTO + * @author generator + * @date 2020-06-02 + */ + TagDefaultDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(TagDefaultDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(TagDefaultDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagGridService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagGridService.java new file mode 100644 index 0000000000..d32414d636 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagGridService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.TagGridDTO; +import com.epmet.entity.TagGridEntity; + +import java.util.List; +import java.util.Map; + +/** + * 网格标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface TagGridService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return TagGridDTO + * @author generator + * @date 2020-06-02 + */ + TagGridDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(TagGridDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(TagGridDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleContentServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleContentServiceImpl.java new file mode 100644 index 0000000000..a7b59c26c4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleContentServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ArticleContentDao; +import com.epmet.dto.ArticleContentDTO; +import com.epmet.entity.ArticleContentEntity; +import com.epmet.redis.ArticleContentRedis; +import com.epmet.service.ArticleContentService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 文章内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class ArticleContentServiceImpl extends BaseServiceImpl implements ArticleContentService { + + @Autowired + private ArticleContentRedis articleContentRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ArticleContentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ArticleContentDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ArticleContentDTO get(String id) { + ArticleContentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ArticleContentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ArticleContentDTO dto) { + ArticleContentEntity entity = ConvertUtils.sourceToTarget(dto, ArticleContentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ArticleContentDTO dto) { + ArticleContentEntity entity = ConvertUtils.sourceToTarget(dto, ArticleContentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleCoverServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleCoverServiceImpl.java new file mode 100644 index 0000000000..79da94dd42 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleCoverServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ArticleCoverDao; +import com.epmet.dto.ArticleCoverDTO; +import com.epmet.entity.ArticleCoverEntity; +import com.epmet.redis.ArticleCoverRedis; +import com.epmet.service.ArticleCoverService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 文章封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class ArticleCoverServiceImpl extends BaseServiceImpl implements ArticleCoverService { + + @Autowired + private ArticleCoverRedis articleCoverRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ArticleCoverDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ArticleCoverDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ArticleCoverDTO get(String id) { + ArticleCoverEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ArticleCoverDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ArticleCoverDTO dto) { + ArticleCoverEntity entity = ConvertUtils.sourceToTarget(dto, ArticleCoverEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ArticleCoverDTO dto) { + ArticleCoverEntity entity = ConvertUtils.sourceToTarget(dto, ArticleCoverEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleOperateRecordServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleOperateRecordServiceImpl.java new file mode 100644 index 0000000000..ca6fe17651 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleOperateRecordServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ArticleOperateRecordDao; +import com.epmet.dto.ArticleOperateRecordDTO; +import com.epmet.entity.ArticleOperateRecordEntity; +import com.epmet.redis.ArticleOperateRecordRedis; +import com.epmet.service.ArticleOperateRecordService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 文章操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class ArticleOperateRecordServiceImpl extends BaseServiceImpl implements ArticleOperateRecordService { + + @Autowired + private ArticleOperateRecordRedis articleOperateRecordRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ArticleOperateRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ArticleOperateRecordDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ArticleOperateRecordDTO get(String id) { + ArticleOperateRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ArticleOperateRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ArticleOperateRecordDTO dto) { + ArticleOperateRecordEntity entity = ConvertUtils.sourceToTarget(dto, ArticleOperateRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ArticleOperateRecordDTO dto) { + ArticleOperateRecordEntity entity = ConvertUtils.sourceToTarget(dto, ArticleOperateRecordEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticlePublishRangeServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticlePublishRangeServiceImpl.java new file mode 100644 index 0000000000..db2e800930 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticlePublishRangeServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ArticlePublishRangeDao; +import com.epmet.dto.ArticlePublishRangeDTO; +import com.epmet.entity.ArticlePublishRangeEntity; +import com.epmet.redis.ArticlePublishRangeRedis; +import com.epmet.service.ArticlePublishRangeService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class ArticlePublishRangeServiceImpl extends BaseServiceImpl implements ArticlePublishRangeService { + + @Autowired + private ArticlePublishRangeRedis articlePublishRangeRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ArticlePublishRangeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ArticlePublishRangeDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ArticlePublishRangeDTO get(String id) { + ArticlePublishRangeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ArticlePublishRangeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ArticlePublishRangeDTO dto) { + ArticlePublishRangeEntity entity = ConvertUtils.sourceToTarget(dto, ArticlePublishRangeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ArticlePublishRangeDTO dto) { + ArticlePublishRangeEntity entity = ConvertUtils.sourceToTarget(dto, ArticlePublishRangeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..682df1669e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ArticleDao; +import com.epmet.dto.ArticleDTO; +import com.epmet.entity.ArticleEntity; +import com.epmet.redis.ArticleRedis; +import com.epmet.service.ArticleService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 文章表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class ArticleServiceImpl extends BaseServiceImpl implements ArticleService { + + @Autowired + private ArticleRedis articleRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ArticleDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ArticleDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ArticleDTO get(String id) { + ArticleEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ArticleDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ArticleDTO dto) { + ArticleEntity entity = ConvertUtils.sourceToTarget(dto, ArticleEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ArticleDTO dto) { + ArticleEntity entity = ConvertUtils.sourceToTarget(dto, ArticleEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleTagsServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleTagsServiceImpl.java new file mode 100644 index 0000000000..7d0eac9bf6 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleTagsServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ArticleTagsDao; +import com.epmet.dto.ArticleTagsDTO; +import com.epmet.entity.ArticleTagsEntity; +import com.epmet.redis.ArticleTagsRedis; +import com.epmet.service.ArticleTagsService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class ArticleTagsServiceImpl extends BaseServiceImpl implements ArticleTagsService { + + @Autowired + private ArticleTagsRedis articleTagsRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ArticleTagsDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ArticleTagsDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ArticleTagsDTO get(String id) { + ArticleTagsEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ArticleTagsDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ArticleTagsDTO dto) { + ArticleTagsEntity entity = ConvertUtils.sourceToTarget(dto, ArticleTagsEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ArticleTagsDTO dto) { + ArticleTagsEntity entity = ConvertUtils.sourceToTarget(dto, ArticleTagsEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleVisitRecordServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleVisitRecordServiceImpl.java new file mode 100644 index 0000000000..dc622799f3 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleVisitRecordServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ArticleVisitRecordDao; +import com.epmet.dto.ArticleVisitRecordDTO; +import com.epmet.entity.ArticleVisitRecordEntity; +import com.epmet.redis.ArticleVisitRecordRedis; +import com.epmet.service.ArticleVisitRecordService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class ArticleVisitRecordServiceImpl extends BaseServiceImpl implements ArticleVisitRecordService { + + @Autowired + private ArticleVisitRecordRedis articleVisitRecordRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ArticleVisitRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ArticleVisitRecordDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ArticleVisitRecordDTO get(String id) { + ArticleVisitRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ArticleVisitRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ArticleVisitRecordDTO dto) { + ArticleVisitRecordEntity entity = ConvertUtils.sourceToTarget(dto, ArticleVisitRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ArticleVisitRecordDTO dto) { + ArticleVisitRecordEntity entity = ConvertUtils.sourceToTarget(dto, ArticleVisitRecordEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftContentServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftContentServiceImpl.java new file mode 100644 index 0000000000..2bf0807e44 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftContentServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.DraftContentDao; +import com.epmet.dto.DraftContentDTO; +import com.epmet.entity.DraftContentEntity; +import com.epmet.redis.DraftContentRedis; +import com.epmet.service.DraftContentService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class DraftContentServiceImpl extends BaseServiceImpl implements DraftContentService { + + @Autowired + private DraftContentRedis draftContentRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DraftContentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DraftContentDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public DraftContentDTO get(String id) { + DraftContentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DraftContentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DraftContentDTO dto) { + DraftContentEntity entity = ConvertUtils.sourceToTarget(dto, DraftContentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DraftContentDTO dto) { + DraftContentEntity entity = ConvertUtils.sourceToTarget(dto, DraftContentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftCoverServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftCoverServiceImpl.java new file mode 100644 index 0000000000..722ef35742 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftCoverServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.DraftCoverDao; +import com.epmet.dto.DraftCoverDTO; +import com.epmet.entity.DraftCoverEntity; +import com.epmet.redis.DraftCoverRedis; +import com.epmet.service.DraftCoverService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 草稿封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class DraftCoverServiceImpl extends BaseServiceImpl implements DraftCoverService { + + @Autowired + private DraftCoverRedis draftCoverRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DraftCoverDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DraftCoverDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public DraftCoverDTO get(String id) { + DraftCoverEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DraftCoverDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DraftCoverDTO dto) { + DraftCoverEntity entity = ConvertUtils.sourceToTarget(dto, DraftCoverEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DraftCoverDTO dto) { + DraftCoverEntity entity = ConvertUtils.sourceToTarget(dto, DraftCoverEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftPublishRangeServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftPublishRangeServiceImpl.java new file mode 100644 index 0000000000..9e5554e0c0 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftPublishRangeServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.DraftPublishRangeDao; +import com.epmet.dto.DraftPublishRangeDTO; +import com.epmet.entity.DraftPublishRangeEntity; +import com.epmet.redis.DraftPublishRangeRedis; +import com.epmet.service.DraftPublishRangeService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 草稿发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class DraftPublishRangeServiceImpl extends BaseServiceImpl implements DraftPublishRangeService { + + @Autowired + private DraftPublishRangeRedis draftPublishRangeRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DraftPublishRangeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DraftPublishRangeDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public DraftPublishRangeDTO get(String id) { + DraftPublishRangeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DraftPublishRangeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DraftPublishRangeDTO dto) { + DraftPublishRangeEntity entity = ConvertUtils.sourceToTarget(dto, DraftPublishRangeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DraftPublishRangeDTO dto) { + DraftPublishRangeEntity entity = ConvertUtils.sourceToTarget(dto, DraftPublishRangeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java new file mode 100644 index 0000000000..21402cb7a2 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.DraftDao; +import com.epmet.dto.DraftDTO; +import com.epmet.entity.DraftEntity; +import com.epmet.redis.DraftRedis; +import com.epmet.service.DraftService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 草稿表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class DraftServiceImpl extends BaseServiceImpl implements DraftService { + + @Autowired + private DraftRedis draftRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DraftDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DraftDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public DraftDTO get(String id) { + DraftEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DraftDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DraftDTO dto) { + DraftEntity entity = ConvertUtils.sourceToTarget(dto, DraftEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DraftDTO dto) { + DraftEntity entity = ConvertUtils.sourceToTarget(dto, DraftEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java new file mode 100644 index 0000000000..8094215a25 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.TagCustomerDao; +import com.epmet.dto.TagCustomerDTO; +import com.epmet.entity.TagCustomerEntity; +import com.epmet.redis.TagCustomerRedis; +import com.epmet.service.TagCustomerService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 客户标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class TagCustomerServiceImpl extends BaseServiceImpl implements TagCustomerService { + + @Autowired + private TagCustomerRedis tagCustomerRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, TagCustomerDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, TagCustomerDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public TagCustomerDTO get(String id) { + TagCustomerEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, TagCustomerDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TagCustomerDTO dto) { + TagCustomerEntity entity = ConvertUtils.sourceToTarget(dto, TagCustomerEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(TagCustomerDTO dto) { + TagCustomerEntity entity = ConvertUtils.sourceToTarget(dto, TagCustomerEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagDefaultServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagDefaultServiceImpl.java new file mode 100644 index 0000000000..b89506b691 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagDefaultServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.TagDefaultDao; +import com.epmet.dto.TagDefaultDTO; +import com.epmet.entity.TagDefaultEntity; +import com.epmet.redis.TagDefaultRedis; +import com.epmet.service.TagDefaultService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 默认标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class TagDefaultServiceImpl extends BaseServiceImpl implements TagDefaultService { + + @Autowired + private TagDefaultRedis tagDefaultRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, TagDefaultDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, TagDefaultDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public TagDefaultDTO get(String id) { + TagDefaultEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, TagDefaultDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TagDefaultDTO dto) { + TagDefaultEntity entity = ConvertUtils.sourceToTarget(dto, TagDefaultEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(TagDefaultDTO dto) { + TagDefaultEntity entity = ConvertUtils.sourceToTarget(dto, TagDefaultEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagGridServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagGridServiceImpl.java new file mode 100644 index 0000000000..6593a5c0e4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagGridServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.TagGridDao; +import com.epmet.dto.TagGridDTO; +import com.epmet.entity.TagGridEntity; +import com.epmet.redis.TagGridRedis; +import com.epmet.service.TagGridService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 网格标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class TagGridServiceImpl extends BaseServiceImpl implements TagGridService { + + @Autowired + private TagGridRedis tagGridRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, TagGridDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, TagGridDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public TagGridDTO get(String id) { + TagGridEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, TagGridDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TagGridDTO dto) { + TagGridEntity entity = ConvertUtils.sourceToTarget(dto, TagGridEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(TagGridDTO dto) { + TagGridEntity entity = ConvertUtils.sourceToTarget(dto, TagGridEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/.gitkeep b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleContentDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleContentDao.xml new file mode 100644 index 0000000000..fb55860502 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleContentDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleCoverDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleCoverDao.xml new file mode 100644 index 0000000000..684910ea8d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleCoverDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml new file mode 100644 index 0000000000..488e2fe7cd --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleOperateRecordDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleOperateRecordDao.xml new file mode 100644 index 0000000000..7b47ccdac5 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleOperateRecordDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.xml new file mode 100644 index 0000000000..595df8b5ea --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleTagsDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleTagsDao.xml new file mode 100644 index 0000000000..d4dcad3ce6 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleTagsDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleVisitRecordDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleVisitRecordDao.xml new file mode 100644 index 0000000000..7647247b63 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleVisitRecordDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftContentDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftContentDao.xml new file mode 100644 index 0000000000..ad230ebefc --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftContentDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftCoverDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftCoverDao.xml new file mode 100644 index 0000000000..f514eeceb3 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftCoverDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml new file mode 100644 index 0000000000..1ba9e7524c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftPublishRangeDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftPublishRangeDao.xml new file mode 100644 index 0000000000..2d2c8df78a --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftPublishRangeDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml new file mode 100644 index 0000000000..21234d2e14 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagDefaultDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagDefaultDao.xml new file mode 100644 index 0000000000..4916e09728 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagDefaultDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagGridDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagGridDao.xml new file mode 100644 index 0000000000..7346056561 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagGridDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file From 794267cfda1b7f8f18bd1cf4d2179c49ed6fe69d Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Tue, 2 Jun 2020 15:33:33 +0800 Subject: [PATCH 03/54] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF=E5=B7=B2?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E5=88=97=E8=A1=A8=E9=A1=B5=E7=9A=84=E6=A0=87?= =?UTF-8?q?=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/RedisUtils.java | 12 ++++ .../epmet/dto/result/TagInfoResultDto.java | 27 ++++++++ .../gov-voice/gov-voice-server/pom.xml | 5 ++ .../java/com/epmet/constant/TagConstant.java | 18 +++++ .../com/epmet/controller/TagController.java | 24 +++++++ .../main/java/com/epmet/redis/TagRedis.java | 68 +++++++++++++++++++ .../java/com/epmet/service/TagService.java | 17 +++++ .../epmet/service/impl/TagServiceImpl.java | 41 +++++++++++ .../epmet/dto/form/TagCustomerFormDTO.java | 16 +++++ .../dto/result/TagCustomerResultDTO.java | 20 ++++++ .../com/epmet/feign/EpmetUserFeignClient.java | 28 ++++++++ .../EpmetUserFeignClientFallBack.java | 23 +++++++ 12 files changed, 299 insertions(+) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDto.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagServiceImpl.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/TagCustomerFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/TagCustomerResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java index 2e45203dc0..c51a4458ac 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java @@ -9,6 +9,7 @@ package com.epmet.commons.tools.redis; import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; import org.springframework.data.redis.core.HashOperations; @@ -262,4 +263,15 @@ public class RedisUtils { return hGetAll(key); } + + /** + * @Description 获取集合的元素, 从大到小排序 + * @param key + * @param start + * @param end + * @author zxc + */ + public Set zRevRange(String key, long start, long end) { + return redisTemplate.opsForZSet().reverseRange(key, start, end); + } } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDto.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDto.java new file mode 100644 index 0000000000..f0470751e7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDto.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/2 9:47 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@Data +public class TagInfoResultDto implements Serializable { + + private static final long serialVersionUID = 4366515668545958124L; + + /** + * 标签id + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; +} diff --git a/epmet-module/gov-voice/gov-voice-server/pom.xml b/epmet-module/gov-voice/gov-voice-server/pom.xml index aee9221446..f546dac50a 100644 --- a/epmet-module/gov-voice/gov-voice-server/pom.xml +++ b/epmet-module/gov-voice/gov-voice-server/pom.xml @@ -19,6 +19,11 @@ gov-voice-client 2.0.0 + + com.epmet + epmet-user-client + 2.0.0 + com.epmet epmet-commons-tools diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java index bac2953abd..1ca78d3ac2 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java @@ -14,4 +14,22 @@ package com.epmet.constant; * @since 1.0.0 */ public interface TagConstant { + + /** + * 客户维度(政府端) 热度标签 key的前缀 【zset】 + */ + String GOV_TAG_KEY = "epmet:customer:articletag:"; + + /** + * 客户维度(政府端) 关联标签 key的前缀 【set】 + */ + String GOV_RETAG_KEY = "epmet:customer:article:retag:"; + + /** + * 冒号 + */ + String COLON = ":"; + + + } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java index 40c0d0e5e4..61cb7fc94f 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java @@ -1,9 +1,33 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.TagInfoResultDto; +import com.epmet.service.TagService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RestController @RequestMapping("tag") public class TagController { + + @Autowired + private TagService tagService; + + /** + * @Description 已发布列表页的标签 + * @param tokenDto + * @author zxc + */ + @PostMapping("taglist") + public Result> tagList(@LoginUser TokenDto tokenDto){ + return new Result>().ok(tagService.tagList(tokenDto)); + } + + } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java new file mode 100644 index 0000000000..35117b41c3 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.alibaba.druid.sql.visitor.functions.Concat; +import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.constant.TagConstant; +import com.epmet.dto.result.TagInfoResultDto; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +@Component +public class TagRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + + public List zRevRange(String key){ + long start = 0; + long end = -1; + String tagKey = TagConstant.GOV_TAG_KEY+key; + Set objects = redisUtils.zRevRange(tagKey, start, end); + if (objects.size()== NumConstant.ZERO){ + return new ArrayList<>(); + } + List result = new ArrayList(); + ObjectMapper objectMapper = new ObjectMapper(); + for (Object object : objects) { + TagInfoResultDto tagInfoResultDto = objectMapper.convertValue(object, TagInfoResultDto.class); + result.add(tagInfoResultDto); + } + return result; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagService.java new file mode 100644 index 0000000000..681d43da18 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagService.java @@ -0,0 +1,17 @@ +package com.epmet.service; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.result.TagInfoResultDto; + +import java.util.List; + +public interface TagService { + + /** + * @Description 已发布列表页的标签 + * @param tokenDto + * @author zxc + */ + List tagList(TokenDto tokenDto); + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagServiceImpl.java new file mode 100644 index 0000000000..c6f8115267 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagServiceImpl.java @@ -0,0 +1,41 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.TagCustomerFormDTO; +import com.epmet.dto.result.TagCustomerResultDTO; +import com.epmet.dto.result.TagInfoResultDto; +import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.redis.TagRedis; +import com.epmet.service.TagService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service +public class TagServiceImpl implements TagService { + + @Autowired + private TagRedis tagRedis; + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + + /** + * @Description 已发布列表页的标签 + * @param tokenDto + * @author zxc + */ + @Override + public List tagList(TokenDto tokenDto) { + TagCustomerFormDTO formDTO = new TagCustomerFormDTO(); + formDTO.setUserId(tokenDto.getUserId()); + TagCustomerResultDTO data = epmetUserFeignClient.getCustomerIdByUserId(formDTO).getData(); + if (StringUtils.isBlank(data.getCustomerId())){ + return new ArrayList<>(); + } + List resultDtos = tagRedis.zRevRange(data.getCustomerId()); + return resultDtos; + } +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/TagCustomerFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/TagCustomerFormDTO.java new file mode 100644 index 0000000000..62dd66c8a0 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/TagCustomerFormDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class TagCustomerFormDTO implements Serializable{ + + private static final long serialVersionUID = -6722269597588807655L; + /** + * 用户Id + * */ + private String userId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/TagCustomerResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/TagCustomerResultDTO.java new file mode 100644 index 0000000000..73f3498b2e --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/TagCustomerResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zxc + */ +@Data +public class TagCustomerResultDTO implements Serializable { + + private static final long serialVersionUID = 4890020932450803062L; + /** + * 客户id + * */ + private String customerId; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java new file mode 100644 index 0000000000..d9b27309bc --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -0,0 +1,28 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.TagCustomerFormDTO; +import com.epmet.dto.result.TagCustomerResultDTO; +import com.epmet.feign.fallback.EpmetUserFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * @Author zxc + * @CreateTime 2020/6/2 14:05 + * , url = "localhost:8087" + */ +@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallBack.class, url = "localhost:8087") +public interface EpmetUserFeignClient { + + /** + * @Description 根据userId获取customerId + * @param formDTO + * @author zxc + */ + @PostMapping("/epmetuser/user/getcustomeridbyuserid") + Result getCustomerIdByUserId(@RequestBody TagCustomerFormDTO formDTO); + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java new file mode 100644 index 0000000000..38a0fc01bd --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java @@ -0,0 +1,23 @@ +package com.epmet.feign.fallback; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.TagCustomerFormDTO; +import com.epmet.dto.result.TagCustomerResultDTO; +import com.epmet.feign.EpmetUserFeignClient; +import org.springframework.stereotype.Component; + +/** + * @Description 居民端-陌生人导览 调用gov-org服务 + * @Author sun + * @Date 2020/3/16 + */ +@Component +public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { + + @Override + public Result getCustomerIdByUserId(TagCustomerFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerIdByUserId", formDTO); + } +} From 090d642cb6afad3fcea92b280ff60fea22e0e7cb Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 2 Jun 2020 16:03:07 +0800 Subject: [PATCH 04/54] =?UTF-8?q?=E5=85=9A=E5=BB=BA=E5=A3=B0=E9=9F=B3-?= =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF-=E5=8F=AF=E9=80=89=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E8=8C=83=E5=9B=B4=E6=8E=A5=E5=8F=A3=E9=A6=96=E6=AC=A1?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/feign/GovOrgSelfFeignClient.java | 28 ++++++ .../GovOrgSelfFeignClientFallBack.java | 21 ++++ .../dto/result/AgencyGridListResultDTO.java | 41 ++++++++ .../dto/result/ArticleGridResultDTO.java | 57 +++++++++++ .../constant/CustomerAgencyConstant.java | 12 +++ .../controller/CustomerAgencyController.java | 11 +++ .../java/com/epmet/dao/CustomerAgencyDao.java | 8 ++ .../java/com/epmet/dao/CustomerGridDao.java | 8 ++ .../com/epmet/dao/CustomerStaffAgencyDao.java | 8 ++ .../com/epmet/dao/CustomerStaffGridDao.java | 7 ++ .../epmet/service/CustomerAgencyService.java | 8 ++ .../impl/CustomerAgencyServiceImpl.java | 95 +++++++++++++++++++ .../resources/mapper/CustomerAgencyDao.xml | 11 +++ .../main/resources/mapper/CustomerGridDao.xml | 9 ++ .../mapper/CustomerStaffAgencyDao.xml | 12 +++ .../resources/mapper/CustomerStaffGridDao.xml | 11 +++ .../gov-voice/gov-voice-server/pom.xml | 6 ++ .../epmet/controller/ArticleController.java | 16 ++++ .../com/epmet/service/ArticleService.java | 10 ++ .../service/impl/ArticleServiceImpl.java | 19 ++++ .../form/CustomerStaffRoleListFormDTO.java | 26 +++++ .../CustomerStaffRoleListResultDTO.java | 41 ++++++++ .../epmet/feign/EpmetUserSelfFeignClient.java | 29 ++++++ .../EpmetUserSelfFeignClientFallBack.java | 24 +++++ .../epmet/controller/StaffRoleController.java | 16 +++- .../main/java/com/epmet/dao/StaffRoleDao.java | 12 ++- .../com/epmet/service/StaffRoleService.java | 8 ++ .../service/impl/StaffRoleServiceImpl.java | 11 +++ .../main/resources/mapper/StaffRoleDao.xml | 23 +++++ 29 files changed, 580 insertions(+), 8 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridListResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ArticleGridResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerStaffRoleListFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CustomerStaffRoleListResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserSelfFeignClient.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserSelfFeignClientFallBack.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java new file mode 100644 index 0000000000..1388593063 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java @@ -0,0 +1,28 @@ +package com.epmet.dto.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.feign.fallback.GovOrgSelfFeignClientFallBack; +import com.epmet.dto.result.ArticleGridResultDTO; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +/** + * @Description gov-org服务 + * @Author sun + */ +@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgSelfFeignClientFallBack.class) +public interface GovOrgSelfFeignClient { + + /** + * @param staffId + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布范围接口调用 + **/ + @PostMapping(value = "gov/org/customeragency/getagencygridlist/{staffId}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result getAgencyGridList(@PathVariable("staffId") String staffId); + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java new file mode 100644 index 0000000000..d1210a4f23 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java @@ -0,0 +1,21 @@ +package com.epmet.dto.feign.fallback; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.feign.GovOrgSelfFeignClient; +import com.epmet.dto.result.ArticleGridResultDTO; +import org.springframework.stereotype.Component; + +/** + * @Description gov-org服务 + * @Author sun + */ +@Component +public class GovOrgSelfFeignClientFallBack implements GovOrgSelfFeignClient { + + @Override + public Result getAgencyGridList(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyGridList", staffId); + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridListResultDTO.java new file mode 100644 index 0000000000..5474009956 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridListResultDTO.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 党建声音-可选发布范围-接口返参 + * + * @author sun + */ +@Data +public class AgencyGridListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + private String gridId = ""; + private String gridName = ""; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ArticleGridResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ArticleGridResultDTO.java new file mode 100644 index 0000000000..2e83e432c3 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ArticleGridResultDTO.java @@ -0,0 +1,57 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 党建声音-可选发布范围-接口返参 + * + * @author sun + */ +@Data +public class ArticleGridResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + private String agencyId = ""; + /** + * 机关组织名称 + */ + private String agencyName = ""; + /** + * 当前机关的下属网格列表 + */ + private List gridList; + /** + * 当前组织的所有下级组织信息(递归) + */ + private List subAgencyGridList; + /** + * 所有上级机关Ids + */ + private String pids = ""; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java index c4d48ee458..b1a42c4209 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java @@ -55,4 +55,16 @@ public interface CustomerAgencyConstant { * 调用epmet-user服务查询用户基础信息失败 */ String SELECT_USER_EXCEPTION = "获取用户基本信息失败"; + /** + * 获取组织人员关系表数据失败 + */ + String SELECT_AGENCY_STAFF_EXCEPTION = "获取机关下人员信息失败"; + /** + * 党建负责人角色 + */ + String PARTY_PRINCIPALS = "party_principals"; + /** + * 网格党建指导员角色 + */ + String GRID_PARTY_DIRECTOR = "grid_party_director"; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 2bc9b1e136..5c6d37a701 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -163,4 +163,15 @@ public class CustomerAgencyController { return new Result().ok(customerAgencyService.getProcessorList(agencyId)); } + /** + * @param staffId + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布范围接口调用-根据人员角色查询对应的不同发布范围 + **/ + @PostMapping("getagencygridlist/{agencyId}") + public Result getAgencyGridList(@PathVariable("staffId") String staffId) { + return new Result().ok(customerAgencyService.getAgencyGridList(staffId)); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index ec559ccaa6..8a51d3ad19 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -116,4 +116,12 @@ public interface CustomerAgencyDao extends BaseDao { * @return java.lang.String */ String selectAgencyName(@Param("agencyId") String agencyId); + + /** + * @param subAgencyPids + * @return + * @Author sun + * @Description 递归查询当前机关的下一级机关列表 + **/ + List selectAllSubAgency(@Param("subAgencyPids") String subAgencyPids); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index 2256263cd0..2f2fd75797 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -184,4 +184,12 @@ public interface CustomerGridDao extends BaseDao { * @date 2020.05.13 11:01 **/ CommonDataFilterResultDTO getGridDataFilterMsg(@Param("gridId")String gridId); + + /** + * @param agencyId + * @return + * @Author sun + * @Description 查询组织下网格列表 + **/ + List selectAgencyGridList(@Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java index 767b073359..7f980cb8c8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java @@ -72,4 +72,12 @@ public interface CustomerStaffAgencyDao extends BaseDao selectAgencyStaffList(@Param("agencyId") String agencyId); + + /** + * @param dto + * @return + * @Author sun + * @Description 根据staffId查询数据 + **/ + CustomerStaffAgencyDTO selectByStaffId(CustomerStaffAgencyDTO dto); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java index 2a160f8a90..54cad95662 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java @@ -90,4 +90,11 @@ public interface CustomerStaffGridDao extends BaseDao { * @Description 遍历查询每个部门下人员 */ List selectGridStaffs(@Param("gridIdList") List gridIdList); + + /** + * + * @Author sun + * @Description 查询人员在客户下参与的网格列表 + */ + List selectStaffGridList(CustomerStaffGridDTO staffGridDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index e29bff8bf1..bbd40017b2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -156,4 +156,12 @@ public interface CustomerAgencyService extends BaseService * @return java.lang.String */ String getAgencyName(String agencyId); + + /** + * @param staffId + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布范围接口调用-根据人员角色查询对应的不同发布范围 + **/ + ArticleGridResultDTO getAgencyGridList(String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index bf01b2e618..45f234258d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -35,6 +35,7 @@ import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerGridEntity; import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.EpmetUserSelfFeignClient; import com.epmet.feign.OperCrmFeignClient; import com.epmet.redis.CustomerAgencyRedis; import com.epmet.service.CustomerAgencyService; @@ -75,6 +76,8 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl page(Map params) { @@ -628,4 +631,96 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl> listResult = epmetUserSelfFeignClient.getCustomerStaffRoleList(formDTO); + if(null==listResult.getData()||listResult.getData().size() RoleList = listResult.getData(); + + //3:判断用户是否具有机关党建负责人或网格指导员角色 + boolean party = false;//机关党建负责人角色 + boolean gridParty = false;//网格指导员角色 + for(CustomerStaffRoleListResultDTO role : RoleList){ + if(CustomerAgencyConstant.PARTY_PRINCIPALS.equals(role.getRoleKey())){ + party = true; + } + if(CustomerAgencyConstant.GRID_PARTY_DIRECTOR.equals(role.getRoleKey())){ + gridParty = true; + } + } + if(!party&&!gridParty){ + return returnDTO; + } + + //4:根据不同角色查询不同数据 + if(party){ + //4.1:查询当前机关的网格列表以及所有下级机关的网格列表 + //当前机关下网格列表 + List gridList = customerGridDao.selectAgencyGridList(agencyEntity.getId()); + returnDTO.setGridList(gridList); + //递归查询当前组织的下级组织以及每个下级组织对应的网格列表 + List subAgencyGridList = getGridList(agencyEntity.getPids() + ":" + agencyEntity.getId()); + returnDTO.setSubAgencyGridList(subAgencyGridList); + }else if(gridParty){ + //4.2:查询人员在当前机关下参与的网格列表 + //查询当前组织下的网格列表 + List gridList = customerGridDao.selectAgencyGridList(agencyEntity.getId()); + //查询该工作人员在该客户下参与的网格列表 + CustomerStaffGridDTO staffGridDTO = new CustomerStaffGridDTO(); + staffGridDTO.setCustomerId(staffAgencyDTO.getCustomerId()); + staffGridDTO.setUserId(staffId); + List gridDTOList = customerStaffGridDao.selectStaffGridList(staffGridDTO); + //遍历取出该人员在该组织下参与的网格列表 + List resultList = gridList.stream().flatMap(agencyGrid -> gridDTOList.stream().filter(staffGrid -> + agencyGrid.getGridId().equals(staffGrid.getGridId())).map(grid -> { + AgencyGridListResultDTO resultDTO = ConvertUtils.sourceToTarget(agencyGrid, AgencyGridListResultDTO.class); + return resultDTO; + })).collect(Collectors.toList()); + + returnDTO.setGridList(resultList); + } + return returnDTO; + } + /** + * @Author sun + * @Description 递归查询当前机关的下一级机关列表 + **/ + private List getGridList(String subAgencyPids) { + List subAgencyList = baseDao.selectAllSubAgency(subAgencyPids); + if (subAgencyList.size() > NumConstant.ZERO) { + for (ArticleGridResultDTO sub : subAgencyList) { + List gridList = customerGridDao.selectAgencyGridList(sub.getAgencyId()); + sub.setGridList(gridList); + List subAgency = getGridList(sub.getPids() + ":" + sub.getAgencyId()); + sub.setSubAgencyGridList(subAgency); + } + } + return subAgencyList; + } + + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 6b7afa1455..2f9ea62ff0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -156,4 +156,15 @@ WHERE a.ID = #{agencyId} + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index c82576b64b..cbced7f6d6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -320,4 +320,13 @@ AND agency.DEL_FLAG = '0' AND grid.ID = #{gridId} + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml index cd4f40f9fb..21d9cf139c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml @@ -105,4 +105,16 @@ AND agency_id =#{agencyId} + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml index 1e6501c6bb..7f1a8d3220 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml @@ -77,6 +77,17 @@ + + insert into customer_staff_grid diff --git a/epmet-module/gov-voice/gov-voice-server/pom.xml b/epmet-module/gov-voice/gov-voice-server/pom.xml index aee9221446..f5f6490001 100644 --- a/epmet-module/gov-voice/gov-voice-server/pom.xml +++ b/epmet-module/gov-voice/gov-voice-server/pom.xml @@ -55,6 +55,12 @@ feign-httpclient 10.3.0 + + com.epmet + gov-org-client + 2.0.0 + compile + diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index e1f69c6a2e..ed34ef585d 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -17,7 +17,9 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -26,6 +28,9 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.ArticleDTO; +import com.epmet.dto.form.LatestListFormDTO; +import com.epmet.dto.result.ArticleGridResultDTO; +import com.epmet.dto.result.LatestListResultDTO; import com.epmet.excel.ArticleExcel; import com.epmet.service.ArticleService; import org.springframework.beans.factory.annotation.Autowired; @@ -91,4 +96,15 @@ public class ArticleController { ExcelUtils.exportExcelToTarget(response, null, list, ArticleExcel.class); } + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布范围 + **/ + @PostMapping("agencygridlist") + public Result agencyGridList(@LoginUser TokenDto tokenDTO) { + return new Result().ok(articleService.agencyGridList(tokenDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index ce2f27cfbc..10d6d9adb9 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -19,7 +19,9 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.ArticleDTO; +import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.entity.ArticleEntity; import java.util.List; @@ -92,4 +94,12 @@ public interface ArticleService extends BaseService { * @date 2020-06-02 */ void delete(String[] ids); + + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布范围 + **/ + ArticleGridResultDTO agencyGridList(TokenDto tokenDTO); } \ No newline at end of file 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 682df1669e..f1ea163a90 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 @@ -21,10 +21,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.ArticleDao; import com.epmet.dto.ArticleDTO; +import com.epmet.dto.feign.GovOrgSelfFeignClient; +import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.entity.ArticleEntity; import com.epmet.redis.ArticleRedis; import com.epmet.service.ArticleService; @@ -32,6 +36,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.PathVariable; import java.util.Arrays; import java.util.List; @@ -48,6 +53,8 @@ public class ArticleServiceImpl extends BaseServiceImpl page(Map params) { @@ -101,4 +108,16 @@ public class ArticleServiceImpl extends BaseServiceImpl result = govOrgSelfFeignClient.getAgencyGridList(tokenDTO.getUserId()); + return result.getData(); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerStaffRoleListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerStaffRoleListFormDTO.java new file mode 100644 index 0000000000..050dc62091 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerStaffRoleListFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 查询客户下人员拥有的角色列表-接口入参 + * @Author sun + */ +@Data +public class CustomerStaffRoleListFormDTO implements Serializable{ + private static final long serialVersionUID = -7994579456530273809L; + + /** + * 客户Id + * */ + private String customerId; + /** + * 用户Id + * */ + @NotBlank(message = "用户Id不能为空") + private String staffId; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CustomerStaffRoleListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CustomerStaffRoleListResultDTO.java new file mode 100644 index 0000000000..66b843e924 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CustomerStaffRoleListResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 根据客户Id staffId查询人员在客户下的角色列表-接口返参 + * @Author sun + */ +@Data +public class CustomerStaffRoleListResultDTO implements Serializable { + private static final long serialVersionUID = -2049883620062097446L; + + /** + * 客户Id + * */ + private String customerId; + /** + * 员工Id + * */ + private String staffId; + /** + * 员工姓名 + * */ + private String staffName; + /** + * 角色Id + * */ + private String roleId; + /** + * 角色Key + * */ + private String roleKey; + /** + * 角色名称 + * */ + private String roleName; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserSelfFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserSelfFeignClient.java new file mode 100644 index 0000000000..1a944da826 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserSelfFeignClient.java @@ -0,0 +1,29 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.CustomerStaffRoleListFormDTO; +import com.epmet.dto.result.CustomerStaffRoleListResultDTO; +import com.epmet.feign.fallback.EpmetUserSelfFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; + +/** + * @dscription epmet-user服务 + * @author sun + */ +@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserSelfFeignClientFallBack.class) +public interface EpmetUserSelfFeignClient { + + /** + * @param formDTO + * @return + * @Author sun + * @Description 根据客户Id和staffId查询一个员工在指定客户下的角色列表 + **/ + @PostMapping("/epmetuser/staffrole/getcustomerstaffrolelist") + Result> getCustomerStaffRoleList(CustomerStaffRoleListFormDTO formDTO); + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserSelfFeignClientFallBack.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserSelfFeignClientFallBack.java new file mode 100644 index 0000000000..4f14d7eac4 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserSelfFeignClientFallBack.java @@ -0,0 +1,24 @@ +package com.epmet.feign.fallback; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.CustomerStaffRoleListFormDTO; +import com.epmet.dto.result.CustomerStaffRoleListResultDTO; +import com.epmet.feign.EpmetUserSelfFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @dscription epmet-user服务 + * @author sun + */ +@Component +public class EpmetUserSelfFeignClientFallBack implements EpmetUserSelfFeignClient { + + @Override + public Result> getCustomerStaffRoleList(CustomerStaffRoleListFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffRoleList", formDTO); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java index 7b9424076f..5e86a9a74c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java @@ -5,10 +5,8 @@ import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.GovStaffRoleDTO; -import com.epmet.dto.form.CommonUserFormDTO; -import com.epmet.dto.form.CustomerRoleFormDTO; -import com.epmet.dto.form.RolesUsersListFormDTO; -import com.epmet.dto.form.StaffRoleFormDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.CustomerStaffRoleListResultDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.dto.result.StaffRolesResultDTO; import com.epmet.entity.GovStaffRoleEntity; @@ -142,4 +140,14 @@ public class StaffRoleController { GovStaffRoleDTO role = govStaffRoleService.getRoleByCustomerIdAndRoleKey(form.getCustomerId(), form.getRoleKey()); return new Result().ok(role); } + + /** + * @Description 根据客户Id和staffId查询一个员工在指定客户下的角色列表 + * @Author sun + **/ + @PostMapping("getcustomerstaffrolelist") + public Result> getCustomerStaffRoleList(@RequestBody CustomerStaffRoleListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(staffRoleService.getCustomerStaffRoleList(formDTO)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java index c7e1be6e9c..c376850ac1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java @@ -22,10 +22,8 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.CommonUserFormDTO; -import com.epmet.dto.result.CustomerStaffRoleResultDTO; -import com.epmet.dto.result.GovStaffRoleResultDTO; -import com.epmet.dto.result.StaffListResultDTO; -import com.epmet.dto.result.StaffRolesResultDTO; +import com.epmet.dto.form.CustomerStaffRoleListFormDTO; +import com.epmet.dto.result.*; import com.epmet.entity.StaffRoleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -85,4 +83,10 @@ public interface StaffRoleDao extends BaseDao { * @Description 根据staffId集合查询人员拥有的所有角色信息 **/ List selectStaffRoleList(@Param("staffIdList") List staffIdList); + + /** + * @Description 根据客户Id和staffId查询一个员工在指定客户下的角色列表 + * @Author sun + **/ + List selectCustomerStaffRoleList(CustomerStaffRoleListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java index 04dfb2d94f..d8de0777d0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java @@ -23,7 +23,9 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.CommonUserFormDTO; +import com.epmet.dto.form.CustomerStaffRoleListFormDTO; import com.epmet.dto.form.RolesUsersListFormDTO; +import com.epmet.dto.result.CustomerStaffRoleListResultDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.dto.result.StaffRolesResultDTO; import com.epmet.entity.StaffRoleEntity; @@ -130,4 +132,10 @@ public interface StaffRoleService extends BaseService { * @date 2020.04.29 23:44 **/ Result> getSpecificRolesStaffs(RolesUsersListFormDTO rolesUsersListFormDTO); + + /** + * @Description 根据客户Id和staffId查询一个员工在指定客户下的角色列表 + * @Author sun + **/ + List getCustomerStaffRoleList(CustomerStaffRoleListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java index a38188f700..07181e174e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java @@ -31,7 +31,9 @@ import com.epmet.dao.GovStaffRoleTemplateDao; import com.epmet.dao.StaffRoleDao; import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.CommonUserFormDTO; +import com.epmet.dto.form.CustomerStaffRoleListFormDTO; import com.epmet.dto.form.RolesUsersListFormDTO; +import com.epmet.dto.result.CustomerStaffRoleListResultDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.dto.result.GovStaffRoleTemplateDTO; import com.epmet.dto.result.StaffRolesResultDTO; @@ -163,4 +165,13 @@ public class StaffRoleServiceImpl extends BaseServiceImpl>().ok(new ArrayList<>()); } + /** + * @Description 根据客户Id和staffId查询一个员工在指定客户下的角色列表 + * @Author sun + **/ + @Override + public List getCustomerStaffRoleList(CustomerStaffRoleListFormDTO formDTO) { + return baseDao.selectCustomerStaffRoleList(formDTO); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml index 1f570a073d..a90bdc4938 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml @@ -119,4 +119,27 @@ sr.staff_id = #{staffId} + \ No newline at end of file From d3c982088fe7fd6f58775e4e2daf702c7e924d18 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 2 Jun 2020 16:25:41 +0800 Subject: [PATCH 05/54] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=20=E4=BF=AE=E6=94=B9publisherType=E7=B1=BB=E5=9E=8B;?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=86=85=E5=AE=B9=E6=8E=A5=E5=8F=A3=E6=9A=82?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/ArticleDTO.java | 5 +- .../src/main/java/com/epmet/dto/DraftDTO.java | 5 +- .../epmet/dto/form/DraftContentFromDTO.java | 98 ++++++++ .../epmet/controller/ArticleController.java | 14 +- .../controller/DraftContentController.java | 2 +- .../java/com/epmet/entity/ArticleEntity.java | 2 +- .../java/com/epmet/entity/DraftEntity.java | 2 +- .../java/com/epmet/excel/ArticleExcel.java | 2 +- .../main/java/com/epmet/excel/DraftExcel.java | 2 +- .../com/epmet/service/ArticleService.java | 8 + .../service/impl/ArticleServiceImpl.java | 226 +++++++++++++----- 11 files changed, 301 insertions(+), 65 deletions(-) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleDTO.java index 79cb1bb2bd..4c72866e27 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -81,7 +82,7 @@ public class ArticleDTO implements Serializable { /** * 发布单位类型 机关:agency;部门:department;网格:grid */ - private Integer publisherType; + private String publisherType; /** * 发布时间 diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftDTO.java index 0e4ebd954b..c7a383a56d 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -76,7 +77,7 @@ public class DraftDTO implements Serializable { /** * 发布单位类型 机关:agency;部门:department;网格:grid */ - private Integer publisherType; + private String publisherType; /** * 发布时间 diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java new file mode 100644 index 0000000000..81d39fa698 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java @@ -0,0 +1,98 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + + +/** + * 保存文章内容form + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class DraftContentFromDTO implements Serializable { + + + private static final long serialVersionUID = -4206020151361420221L; + /** + * 文章ID 重新编辑时必填 + */ + private String articleId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 草稿ID + */ + private String draftId; + + /** + * 文章标题 + */ + @NotBlank(message = "文章标题不能为空") + private String title; + + /** + * 内容列表 + */ + private List contentList; + + @Data + public static class DraftContentDTO { + public DraftContentDTO() { + } + + /** + * 内容Id + */ + private String draftId; + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 审核状态 通过:pass;失败:fail; + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + } +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index ed34ef585d..e72213a34d 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -25,12 +25,13 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.ArticleDTO; import com.epmet.dto.form.LatestListFormDTO; import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.dto.result.LatestListResultDTO; +import com.epmet.dto.form.DraftContentFromDTO; import com.epmet.excel.ArticleExcel; import com.epmet.service.ArticleService; import org.springframework.beans.factory.annotation.Autowired; @@ -107,4 +108,15 @@ public class ArticleController { return new Result().ok(articleService.agencyGridList(tokenDTO)); } + /** + * desc:保存或修改文章内容 + * @param fromDTO + * @throws Exception + */ + @GetMapping("savecontent") + public Result savecontent(@RequestBody DraftContentFromDTO fromDTO) throws Exception { + String draftId = articleService.saveOrUpdateContent(fromDTO); + return new Result().ok(draftId); + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftContentController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftContentController.java index c05fda4cc7..82243e0e48 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftContentController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftContentController.java @@ -23,8 +23,8 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.DraftContentDTO; import com.epmet.excel.DraftContentExcel; import com.epmet.service.DraftContentService; diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java index 5768366568..eb2b026fb7 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java @@ -81,7 +81,7 @@ public class ArticleEntity extends BaseEpmetEntity { /** * 发布单位类型 机关:agency;部门:department;网格:grid */ - private Integer publisherType; + private String publisherType; /** * 发布时间 diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftEntity.java index d7fd299501..b3c7fd96b6 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftEntity.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftEntity.java @@ -76,7 +76,7 @@ public class DraftEntity extends BaseEpmetEntity { /** * 发布单位类型 机关:agency;部门:department;网格:grid */ - private Integer publisherType; + private String publisherType; /** * 发布时间 diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleExcel.java index d1c47ccefb..a5f28f84a3 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleExcel.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleExcel.java @@ -59,7 +59,7 @@ public class ArticleExcel { private String publisherName; @Excel(name = "发布单位类型 机关:agency;部门:department;网格:grid") - private Integer publisherType; + private String publisherType; @Excel(name = "发布时间") private Date publishDate; diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftExcel.java index 55cc07b78c..6f913525d7 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftExcel.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftExcel.java @@ -56,7 +56,7 @@ public class DraftExcel { private String publisherName; @Excel(name = "发布单位类型 机关:agency;部门:department;网格:grid") - private Integer publisherType; + private String publisherType; @Excel(name = "发布时间") private Date publishDate; diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index 10d6d9adb9..9cae7ed196 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.ArticleDTO; import com.epmet.dto.result.ArticleGridResultDTO; +import com.epmet.dto.form.DraftContentFromDTO; import com.epmet.entity.ArticleEntity; import java.util.List; @@ -102,4 +103,11 @@ public interface ArticleService extends BaseService { * @Description 党建声音-政府端-可选发布范围 **/ ArticleGridResultDTO agencyGridList(TokenDto tokenDTO); + + /** + * desc:保存或修改文章内容 + * @param fromDTO + * @return + */ + String saveOrUpdateContent(DraftContentFromDTO fromDTO); } \ No newline at end of file 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 f1ea163a90..3b082d2776 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 @@ -17,30 +17,43 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dao.ArticleDao; +import com.epmet.dao.DraftContentDao; +import com.epmet.dao.DraftDao; import com.epmet.dto.ArticleDTO; import com.epmet.dto.feign.GovOrgSelfFeignClient; import com.epmet.dto.result.ArticleGridResultDTO; +import com.epmet.dto.form.DraftContentFromDTO; import com.epmet.entity.ArticleEntity; +import com.epmet.entity.DraftContentEntity; +import com.epmet.entity.DraftEntity; import com.epmet.redis.ArticleRedis; import com.epmet.service.ArticleService; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.util.CollectionUtils; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; /** * 文章表 @@ -55,58 +68,68 @@ public class ArticleServiceImpl extends BaseServiceImpl page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, ArticleDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, ArticleDTO.class); - } - - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - - return wrapper; - } - - @Override - public ArticleDTO get(String id) { - ArticleEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, ArticleDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(ArticleDTO dto) { - ArticleEntity entity = ConvertUtils.sourceToTarget(dto, ArticleEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(ArticleDTO dto) { - ArticleEntity entity = ConvertUtils.sourceToTarget(dto, ArticleEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } + private final Log logger = LogFactory.getLog(getClass()); + @Autowired + private ArticleRedis articleRedis; + + @Autowired + private DraftDao draftDao; + @Autowired + private DraftContentDao draftContentDao; + @Autowired + private ArticleDao articleDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ArticleDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ArticleDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ArticleDTO get(String id) { + ArticleEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ArticleDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ArticleDTO dto) { + ArticleEntity entity = ConvertUtils.sourceToTarget(dto, ArticleEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ArticleDTO dto) { + ArticleEntity entity = ConvertUtils.sourceToTarget(dto, ArticleEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } /** * @param tokenDTO @@ -120,4 +143,97 @@ public class ArticleServiceImpl extends BaseServiceImpl articleParamMap = new HashMap<>(); + articleParamMap.put("ARTICLE_ID", fromDTO.getArticleId()); + articleParamMap.put("ARTICLE_ID", fromDTO.getArticleId()); + articleDao.selectByMap(articleParamMap); + } + + DraftEntity draftEntity = null; + List draftContentList = null; + if (StringUtils.isNotBlank(fromDTO.getDraftId())) { + //TODO + + draftEntity = draftDao.selectById(fromDTO.getDraftId()); + if (draftEntity == null) { + logger.warn("saveOrUpdateContent draftId is not exist in db"); + throw new RenException("参数错误"); + } + draftEntity.setTitle(draftEntity.getTitle()); + draftEntity.setUpdatedTime(new Date()); + draftDao.updateById(draftEntity); + + } else { + draftEntity = new DraftEntity(); + draftEntity.setTitle(fromDTO.getTitle()); + draftDao.insert(draftEntity); + } + + if (CollectionUtils.isEmpty(draftContentList)) { + logger.warn("saveOrUpdateContent contentList is empty"); + throw new RenException("参数错误"); + } + draftContentList = buildDraftContent(fromDTO, havePublished); + //TODO 改为批量插入 + draftContentList.forEach(content -> draftContentDao.insert(content)); + + String draftId = draftEntity.getId(); + + + return null; + } + + /** + * desc:构建 内容对象 + * + * @param fromDTO + * @param havePublished + * @return + */ + private List buildDraftContent(DraftContentFromDTO fromDTO, boolean havePublished) { + //如果已发布 则需要校验内容是否更改过 没有更改则 不对审核状态进行重置 + List newContentList = new ArrayList<>(); + Map oldContentMap = null; + Map draftIdMap = new HashMap<>(); + draftIdMap.put("DRAFT_ID", fromDTO.getDraftId()); + if (havePublished) { + List oldContentEntities = draftContentDao.selectByMap(draftIdMap); + oldContentMap = oldContentEntities.stream().collect(Collectors.toMap(DraftContentEntity::getId, content -> content)); + //删掉所有 + draftContentDao.deleteByMap(draftIdMap); + } + List contentList = fromDTO.getContentList(); + + Map finalOldContentMap = oldContentMap; + Set orderNumSet = new HashSet<>(); + contentList.forEach(content -> { + if (finalOldContentMap != null && finalOldContentMap.get(content.getDraftId()) != null) { + DraftContentEntity oldContent = finalOldContentMap.get(content.getDraftId()); + if (oldContent.getContent().equals(content.getContent())) { + content.setAuditReason(oldContent.getAuditReason()); + content.setAuditStatus(oldContent.getAuditStatus()); + } + } + DraftContentEntity entity = ConvertUtils.sourceToTarget(content, DraftContentEntity.class); + entity.setId(content.getDraftId()); + orderNumSet.add(content.getOrderNum()); + newContentList.add(entity); + }); + if (orderNumSet.size() != newContentList.size()) { + logger.warn("saveOrUpdateContent contentList orderNum is repeat"); + throw new RenException("参数错误"); + } + return newContentList; + } + } \ No newline at end of file From 448dbf7b3a1ebace39e568088c0317c23b48dfbd Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 2 Jun 2020 16:28:19 +0800 Subject: [PATCH 06/54] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=20=E4=BF=AE=E6=94=B9publisherType=E7=B1=BB=E5=9E=8B;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/migration/epmet_gov_voice.sql | 269 ++++++++++++++++++ 1 file changed, 269 insertions(+) create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql new file mode 100644 index 0000000000..d616dd51e2 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql @@ -0,0 +1,269 @@ +/* + Date: 2/06/2020 16:13:38 +*/ + +-- SET NAMES utf8mb4; +-- #SET FOREIGN_KEY_CHECKS = 0; + +CREATE DATABASE `epmet_gov_access` DEFAULT CHARACTER SET utf8mb4; +CREATE TABLE tag_default( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + TAG_NAME VARCHAR(32) NOT NULL COMMENT '标签名称' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT NOT NULL COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , + CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , + UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '默认标签表 默认标签表'; + +ALTER TABLE tag_default COMMENT '默认标签表'; +CREATE TABLE tag_customer( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + TAG_NAME VARCHAR(32) NOT NULL COMMENT '标签名称' , + USE_COUNT INT NOT NULL DEFAULT 0 COMMENT '使用计数' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT NOT NULL COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , + CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , + UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '客户标签表 客户标签表'; + +ALTER TABLE tag_customer ADD INDEX INX_TAG_NAME(TAG_NAME); +ALTER TABLE tag_customer COMMENT '客户标签表'; +CREATE TABLE tag_grid( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + GRID_ID VARCHAR(64) NOT NULL COMMENT '网格ID' , + TAG_ID VARCHAR(64) NOT NULL COMMENT '标签ID' , + TAG_NAME VARCHAR(32) NOT NULL COMMENT '标签名称' , + USE_COUNT INT NOT NULL DEFAULT 0 COMMENT '使用计数' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT NOT NULL COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , + CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , + UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '网格标签表 网格标签表'; + +ALTER TABLE tag_grid COMMENT '网格标签表'; +CREATE TABLE article_tags( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , + TAG_ID VARCHAR(64) NOT NULL COMMENT '标签ID' , + TAG_NAME VARCHAR(32) NOT NULL COMMENT '标签名称' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT NOT NULL COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , + CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , + UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '文章标签表 文章标签表'; + +ALTER TABLE article_tags ADD INDEX IDX_ARTICLE_ID(ARTICLE_ID); +ALTER TABLE article_tags COMMENT '文章标签表'; +CREATE TABLE draft( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + TITLE VARCHAR(128) NOT NULL COMMENT '文章标题' , + PREVIEW_CONTENT VARCHAR(512) NOT NULL COMMENT '文章内容 精简内容' , + IS_TOP INT NOT NULL COMMENT '是否置顶' , + PUBLISH_RANGE_DESC VARCHAR(512) NOT NULL COMMENT '发布范围描述 所有发布范围集合' , + PUBLISHER_ID VARCHAR(64) NOT NULL COMMENT '发布单位ID' , + PUBLISHER_NAME VARCHAR(128) NOT NULL COMMENT '发布单位名称' , + PUBLISHER_TYPE VARCHAR(32) NOT NULL COMMENT '发布单位类型 机关:agency;部门:department;网格:grid' , + PUBLISH_DATE DATE NOT NULL COMMENT '发布时间' , + STATUS_FLAG VARCHAR(32) NOT NULL COMMENT '发布状态 未发布:unpublish ;已发布:published,审核中:auditing,审核失败:auditfail' , + TAGS VARCHAR(512) NOT NULL COMMENT '文章标签串 竖杠分割的标签名称' , + ORG_ID VARCHAR(64) COMMENT '组织ID' , + ORG_ID_PATH VARCHAR(512) COMMENT '组织ID路径 eg:字段为def:abc' , + GRID_ID VARCHAR(64) COMMENT '网格ID 数据权限使用' , + DEPARTMENT_ID VARCHAR(32) COMMENT '部门ID 数据权限使用' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT NOT NULL COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , + CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , + UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '草稿表 草稿表'; + +ALTER TABLE draft COMMENT '草稿表'; +CREATE TABLE draft_content( + ID VARCHAR(64) NOT NULL COMMENT '主键ID 主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + DRAFT_ID VARCHAR(64) NOT NULL COMMENT '草稿ID' , + CONTENT VARCHAR(1024) NOT NULL COMMENT '内容' , + CONTENT_TYPE VARCHAR(32) NOT NULL COMMENT '内容类型 图片:img;文字:text' , + AUDIT_STATUS VARCHAR(32) NOT NULL COMMENT '审核状态 通过:pass;失败:fail;' , + AUDIT_REASON VARCHAR(128) NOT NULL COMMENT '审核理由' , + ORDER_NUM INT NOT NULL COMMENT '内容顺序 从1开始' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT NOT NULL COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , + CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , + UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '草稿内容表 草稿内容表'; + +ALTER TABLE draft_content COMMENT '草稿内容表'; +CREATE TABLE draft_publish_range( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + DRAFT_ID VARCHAR(64) NOT NULL COMMENT 'ID草稿' , + GRID_ID VARCHAR(64) NOT NULL COMMENT '网格ID' , + OFF_LINE_TIME DATETIME COMMENT '下线时间' , + PUBLISH_STATUS VARCHAR(32) NOT NULL COMMENT '发布状态 未发布:unpublish ;已发布:published' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT NOT NULL COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , + CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , + UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '草稿发布范围表 草稿发布范围表'; + +ALTER TABLE draft_publish_range COMMENT '草稿发布范围表'; +CREATE TABLE draft_cover( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + DRAFT_ID VARCHAR(64) NOT NULL COMMENT '草稿ID' , + IMG_URL VARCHAR(512) NOT NULL COMMENT '封面图片地址 url地址' , + AUDIT_STATUS VARCHAR(32) NOT NULL COMMENT '审核状态 通过:pass;失败:fail;' , + AUDIT_REASON VARCHAR(128) NOT NULL COMMENT '审核理由' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT NOT NULL COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , + CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , + UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '草稿封面表 草稿封面表'; + +ALTER TABLE draft_cover COMMENT '草稿封面表'; +CREATE TABLE article( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + DRAFT_ID VARCHAR(64) NOT NULL COMMENT '草稿ID' , + TITLE VARCHAR(128) NOT NULL COMMENT '文章标题' , + PREVIEW_CONTENT VARCHAR(512) NOT NULL COMMENT '文章内容 精简内容' , + IS_TOP INT NOT NULL COMMENT '是否置顶' , + PUBLISH_RANGE_DESC VARCHAR(512) NOT NULL COMMENT '发布范围描述 所有发布范围集合' , + PUBLISHER_ID VARCHAR(64) NOT NULL COMMENT '发布单位ID' , + PUBLISHER_NAME VARCHAR(128) NOT NULL COMMENT '发布单位名称' , + PUBLISHER_TYPE VARCHAR(32) NOT NULL COMMENT '发布单位类型 机关:agency;部门:department;网格:grid' , + PUBLISH_DATE DATE NOT NULL COMMENT '发布时间' , + STATUS_FLAG VARCHAR(32) NOT NULL DEFAULT 0 COMMENT '发布状态 已发布:published;已下线:offline' , + OFF_LINE_TIME DATETIME COMMENT '下线时间' , + TAGS VARCHAR(512) COMMENT '文章标签串 竖杠分割的标签名称' , + ORG_ID VARCHAR(64) COMMENT '组织ID' , + ORG_ID_PATH VARCHAR(512) COMMENT '组织ID路径 eg:字段为def:abc' , + GRID_ID VARCHAR(64) COMMENT '网格ID 数据权限使用' , + DEPARTMENT_ID VARCHAR(32) COMMENT '部门ID 数据权限使用' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT NOT NULL COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , + CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , + UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '文章表 正式文章表'; + +ALTER TABLE article COMMENT '文章表'; +CREATE TABLE article_content( + ID VARCHAR(64) NOT NULL COMMENT '主键ID 主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , + CONTENT VARCHAR(1024) NOT NULL COMMENT '内容' , + CONTENT_TYPE VARCHAR(32) NOT NULL COMMENT '内容类型 图片:img;文字:text' , + AUDIT_STATUS VARCHAR(32) NOT NULL COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing' , + AUDIT_REASON VARCHAR(128) NOT NULL COMMENT '审核理由' , + ORDER_NUM INT NOT NULL COMMENT '内容顺序 从1开始' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT NOT NULL COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , + CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , + UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '文章内容表 文章内容表'; + +ALTER TABLE article_content COMMENT '文章内容表'; +CREATE TABLE article_cover( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , + IMG_URL VARCHAR(512) NOT NULL COMMENT '封面图片地址 url地址' , + AUDIT_STATUS VARCHAR(32) NOT NULL COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing' , + AUDIT_REASON VARCHAR(128) NOT NULL COMMENT '审核理由' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT NOT NULL COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , + CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , + UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '文章封面表 文章封面表'; + +ALTER TABLE article_cover COMMENT '文章封面表'; +CREATE TABLE article_publish_range( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , + GRID_ID VARCHAR(64) NOT NULL COMMENT '网格ID' , + OFF_LINE_TIME DATETIME COMMENT '下线时间' , + PUBLISH_STATUS VARCHAR(32) NOT NULL COMMENT '发布状态' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT NOT NULL COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , + CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , + UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '文章发布范围表 文章发布范围表'; + +ALTER TABLE article_publish_range ADD INDEX IDX_ARTICLE_ID(ARTICLE_ID); +ALTER TABLE article_publish_range COMMENT '文章发布范围表'; +CREATE TABLE article_operate_record( + ID VARCHAR(64) NOT NULL COMMENT '主键ID 主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , + OP_USER VARCHAR(128) NOT NULL COMMENT '执行人 xx街道-xx中心-姓名' , + CONTENT VARCHAR(512) NOT NULL COMMENT '操作内容 操作内容,eg:重新编辑文章;' , + OP_TYPE VARCHAR(32) NOT NULL COMMENT '操作类型 发布文章:publish;取消文章置顶:canceltop;设置置顶:settom;下线文章:offline;修改文章发布范围:updatepublishrange' , + OP_TIME DATETIME NOT NULL COMMENT '操作时间' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT NOT NULL COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , + CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , + UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '文章操作记录表 文章操作记录表'; + +ALTER TABLE article_operate_record COMMENT '文章操作记录表'; +CREATE TABLE article_visit_record( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + GRID_ID VARCHAR(64) NOT NULL COMMENT '网格ID' , + ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , + USER_ID VARCHAR(64) NOT NULL COMMENT '用户ID' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT NOT NULL COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , + CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , + UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '文章访问记录表 文章访问记录表'; + +ALTER TABLE article_visit_record ADD UNIQUE UNX_INDEX(ARTICLE_ID,GRID_ID,USER_ID); +ALTER TABLE article_visit_record COMMENT '文章访问记录表'; From ddcbe527ead6a449ce8e7e86756635fd685ab376 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 2 Jun 2020 17:14:26 +0800 Subject: [PATCH 07/54] =?UTF-8?q?=E5=85=9A=E5=BB=BA=E5=A3=B0=E9=9F=B3-?= =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF-=E5=8F=AF=E9=80=89=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E5=8D=95=E4=BD=8D=E6=8E=A5=E5=8F=A3=E9=A6=96=E6=AC=A1?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/feign/GovOrgSelfFeignClient.java | 9 ++ .../GovOrgSelfFeignClientFallBack.java | 6 + .../com/epmet/dto/result/AgencyDeptList.java | 44 +++++++ .../com/epmet/dto/result/AgencyGridList.java | 44 +++++++ .../result/PublishAgencyListResultDTO.java | 53 +++++++++ .../controller/CustomerAgencyController.java | 13 ++- .../com/epmet/dao/CustomerDepartmentDao.java | 9 ++ .../java/com/epmet/dao/CustomerGridDao.java | 8 ++ .../epmet/service/CustomerAgencyService.java | 8 ++ .../impl/CustomerAgencyServiceImpl.java | 109 +++++++++++++++--- .../mapper/CustomerDepartmentDao.xml | 17 +++ .../main/resources/mapper/CustomerGridDao.xml | 17 +++ .../epmet/controller/ArticleController.java | 12 ++ .../com/epmet/service/ArticleService.java | 9 ++ .../service/impl/ArticleServiceImpl.java | 13 +++ 15 files changed, 357 insertions(+), 14 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyDeptList.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridList.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PublishAgencyListResultDTO.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java index 1388593063..7358d0faed 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.feign.fallback.GovOrgSelfFeignClientFallBack; import com.epmet.dto.result.ArticleGridResultDTO; +import com.epmet.dto.result.PublishAgencyListResultDTO; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.PathVariable; @@ -25,4 +26,12 @@ public interface GovOrgSelfFeignClient { @PostMapping(value = "gov/org/customeragency/getagencygridlist/{staffId}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result getAgencyGridList(@PathVariable("staffId") String staffId); + /** + * @param staffId + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布单位接口调用 + **/ + @PostMapping(value = "gov/org/customeragency/getpublishagencylist/{staffId}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result getPublishAgencyList(@PathVariable("staffId") String staffId); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java index d1210a4f23..655e7359f0 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.feign.GovOrgSelfFeignClient; import com.epmet.dto.result.ArticleGridResultDTO; +import com.epmet.dto.result.PublishAgencyListResultDTO; import org.springframework.stereotype.Component; /** @@ -18,4 +19,9 @@ public class GovOrgSelfFeignClientFallBack implements GovOrgSelfFeignClient { public Result getAgencyGridList(String staffId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyGridList", staffId); } + + @Override + public Result getPublishAgencyList(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getPublishAgencyList", staffId); + } } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyDeptList.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyDeptList.java new file mode 100644 index 0000000000..c678c1a723 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyDeptList.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 添加组织-接口返参 + * + * @author sun + */ +@Data +public class AgencyDeptList implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 部门Id + */ + private String departmentId = ""; + /** + * 机关-部门名称 + */ + private String agencyDeptName = ""; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridList.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridList.java new file mode 100644 index 0000000000..ad2c907fd5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridList.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 添加组织-接口返参 + * + * @author sun + */ +@Data +public class AgencyGridList implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格Id + */ + private String gridId = ""; + /** + * 机关-网格名称 + */ + private String agencyGridName = ""; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PublishAgencyListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PublishAgencyListResultDTO.java new file mode 100644 index 0000000000..baa54e8f73 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PublishAgencyListResultDTO.java @@ -0,0 +1,53 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 党建声音-可选发布单位-接口返参 + * + * @author sun + */ +@Data +public class PublishAgencyListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + private String agencyId = ""; + /** + * 机关组织名称 + */ + private String agencyName = ""; + /** + * 机关下部门列表信息 + */ + private List agencyDeptList; + /** + * 机关下网格列表信息 + */ + private List agencyGridList; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 5c6d37a701..0c254f904d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -169,9 +169,20 @@ public class CustomerAgencyController { * @Author sun * @Description 党建声音-政府端-可选发布范围接口调用-根据人员角色查询对应的不同发布范围 **/ - @PostMapping("getagencygridlist/{agencyId}") + @PostMapping("getagencygridlist/{staffId}") public Result getAgencyGridList(@PathVariable("staffId") String staffId) { return new Result().ok(customerAgencyService.getAgencyGridList(staffId)); } + /** + * @param staffId + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布范围接口调用-根据人员角色查询对应的不同发布范围 + **/ + @PostMapping("getpublishagencylist/{staffId}") + public Result getPublishAgencyList(@PathVariable("staffId") String staffId) { + return new Result().ok(customerAgencyService.getPublishAgencyList(staffId)); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java index 13cb1da0ea..2debda4fce 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerDepartmentDTO; import com.epmet.dto.CustomerIdDTO; +import com.epmet.dto.result.AgencyDeptList; import com.epmet.dto.result.DepartmentListResultDTO; import com.epmet.dto.result.SubListResultDTO; import com.epmet.entity.CustomerDepartmentEntity; @@ -75,4 +76,12 @@ public interface CustomerDepartmentDao extends BaseDao * @Description 批量查询部门信息 **/ List selectDeptListByIds(@Param("deptIdList") List deptIdList); + + /** + * @param agencyId + * @return + * @Author sun + * @Description 查询机关下部门列表信息 + **/ + List selectAgencyDeptMsgList(@Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index 2f2fd75797..86303b5b28 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -192,4 +192,12 @@ public interface CustomerGridDao extends BaseDao { * @Description 查询组织下网格列表 **/ List selectAgencyGridList(@Param("agencyId") String agencyId); + + /** + * @param agencyId + * @return + * @Author sun + * @Description 查询机关下网格列表信息 + **/ + List selectAgencyGridMsgList(@Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index bbd40017b2..eaf18432ad 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -164,4 +164,12 @@ public interface CustomerAgencyService extends BaseService * @Description 党建声音-政府端-可选发布范围接口调用-根据人员角色查询对应的不同发布范围 **/ ArticleGridResultDTO getAgencyGridList(String staffId); + + /** + * @param staffId + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布单位接口调用-根据人员角色查询对应的不同发布单位 + **/ + PublishAgencyListResultDTO getPublishAgencyList(String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 45f234258d..26ff3d0358 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -640,52 +640,55 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl> listResult = epmetUserSelfFeignClient.getCustomerStaffRoleList(formDTO); - if(null==listResult.getData()||listResult.getData().size() RoleList = listResult.getData(); //3:判断用户是否具有机关党建负责人或网格指导员角色 - boolean party = false;//机关党建负责人角色 - boolean gridParty = false;//网格指导员角色 - for(CustomerStaffRoleListResultDTO role : RoleList){ - if(CustomerAgencyConstant.PARTY_PRINCIPALS.equals(role.getRoleKey())){ + //机关党建负责人角色 + boolean party = false; + //网格指导员角色 + boolean gridParty = false; + for (CustomerStaffRoleListResultDTO role : RoleList) { + if (CustomerAgencyConstant.PARTY_PRINCIPALS.equals(role.getRoleKey())) { party = true; } - if(CustomerAgencyConstant.GRID_PARTY_DIRECTOR.equals(role.getRoleKey())){ + if (CustomerAgencyConstant.GRID_PARTY_DIRECTOR.equals(role.getRoleKey())) { gridParty = true; } } - if(!party&&!gridParty){ + if (!party && !gridParty) { return returnDTO; } //4:根据不同角色查询不同数据 - if(party){ + CustomerAgencyEntity agencyEntity = baseDao.selectById(staffAgencyDTO.getAgencyId()); + if (party) { //4.1:查询当前机关的网格列表以及所有下级机关的网格列表 + //当前机关信息 + returnDTO.setAgencyId(agencyEntity.getId()); + returnDTO.setAgencyName(agencyEntity.getOrganizationName()); //当前机关下网格列表 List gridList = customerGridDao.selectAgencyGridList(agencyEntity.getId()); returnDTO.setGridList(gridList); //递归查询当前组织的下级组织以及每个下级组织对应的网格列表 List subAgencyGridList = getGridList(agencyEntity.getPids() + ":" + agencyEntity.getId()); returnDTO.setSubAgencyGridList(subAgencyGridList); - }else if(gridParty){ + } else if (gridParty) { //4.2:查询人员在当前机关下参与的网格列表 //查询当前组织下的网格列表 List gridList = customerGridDao.selectAgencyGridList(agencyEntity.getId()); @@ -722,5 +725,85 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl> listResult = epmetUserSelfFeignClient.getCustomerStaffRoleList(formDTO); + if (null == listResult.getData() || listResult.getData().size() < NumConstant.ONE) { + return returnDTO; + } + List RoleList = listResult.getData(); + + //3:判断用户是否具有机关党建负责人或网格指导员角色 + //机关党建负责人角色 + boolean party = false; + //网格指导员角色 + boolean gridParty = false; + for (CustomerStaffRoleListResultDTO role : RoleList) { + if (CustomerAgencyConstant.PARTY_PRINCIPALS.equals(role.getRoleKey())) { + party = true; + } + if (CustomerAgencyConstant.GRID_PARTY_DIRECTOR.equals(role.getRoleKey())) { + gridParty = true; + } + } + if (!party && !gridParty) { + return returnDTO; + } + + //4:根据不同角色查询不同数据 + CustomerAgencyEntity agencyEntity = baseDao.selectById(staffAgencyDTO.getAgencyId()); + if (party) { + //4.1:查询当前机关的网格列表以及所有下级机关的网格列表 + //当前机关信息 + returnDTO.setAgencyId(agencyEntity.getId()); + returnDTO.setAgencyName(agencyEntity.getOrganizationName()); + //当前机关下部门列表信息 + List agencyDeptList = customerDepartmentDao.selectAgencyDeptMsgList(agencyEntity.getId()); + returnDTO.setAgencyDeptList(agencyDeptList); + //当前机关下网格列表 + List agencyGridList = customerGridDao.selectAgencyGridMsgList(agencyEntity.getId()); + returnDTO.setAgencyGridList(agencyGridList); + } else if (gridParty) { + //4.2:查询人员在当前机关下参与的网格列表 + //查询当前组织下的网格列表 + List gridList = customerGridDao.selectAgencyGridList(agencyEntity.getId()); + //查询该工作人员在该客户下参与的网格列表 + CustomerStaffGridDTO staffGridDTO = new CustomerStaffGridDTO(); + staffGridDTO.setCustomerId(staffAgencyDTO.getCustomerId()); + staffGridDTO.setUserId(staffId); + List gridDTOList = customerStaffGridDao.selectStaffGridList(staffGridDTO); + //遍历取出该人员在该组织下参与的网格列表 + List resultList = gridList.stream().flatMap(agencyGrid -> gridDTOList.stream().filter(staffGrid -> + agencyGrid.getGridId().equals(staffGrid.getGridId())).map(grid -> { + AgencyGridList resultDTO = new AgencyGridList(); + resultDTO.setGridId(agencyGrid.getGridId()); + resultDTO.setAgencyGridName(agencyEntity.getOrganizationName() + "-" + agencyGrid.getGridName()); + return resultDTO; + })).collect(Collectors.toList()); + + returnDTO.setAgencyGridList(resultList); + } + + return returnDTO; + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml index 47273d910c..a31747facc 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml @@ -54,4 +54,21 @@ id = #{departmentId} + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index cbced7f6d6..11744f7f5a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -329,4 +329,21 @@ WHERE del_flag = '0' AND pid = #{agencyId} + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index ed34ef585d..f1f93005ca 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -31,6 +31,7 @@ import com.epmet.dto.ArticleDTO; import com.epmet.dto.form.LatestListFormDTO; import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.dto.result.LatestListResultDTO; +import com.epmet.dto.result.PublishAgencyListResultDTO; import com.epmet.excel.ArticleExcel; import com.epmet.service.ArticleService; import org.springframework.beans.factory.annotation.Autowired; @@ -107,4 +108,15 @@ public class ArticleController { return new Result().ok(articleService.agencyGridList(tokenDTO)); } + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布单位 + **/ + @PostMapping("publishagencylist") + public Result publishAgencyList(@LoginUser TokenDto tokenDTO) { + return new Result().ok(articleService.publishAgencyList(tokenDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index 10d6d9adb9..3d0c3ad7d5 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.ArticleDTO; import com.epmet.dto.result.ArticleGridResultDTO; +import com.epmet.dto.result.PublishAgencyListResultDTO; import com.epmet.entity.ArticleEntity; import java.util.List; @@ -102,4 +103,12 @@ public interface ArticleService extends BaseService { * @Description 党建声音-政府端-可选发布范围 **/ ArticleGridResultDTO agencyGridList(TokenDto tokenDTO); + + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布单位 + **/ + PublishAgencyListResultDTO publishAgencyList(TokenDto tokenDTO); } \ No newline at end of file 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 f1ea163a90..cd28c63f23 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 @@ -29,6 +29,7 @@ import com.epmet.dao.ArticleDao; import com.epmet.dto.ArticleDTO; import com.epmet.dto.feign.GovOrgSelfFeignClient; import com.epmet.dto.result.ArticleGridResultDTO; +import com.epmet.dto.result.PublishAgencyListResultDTO; import com.epmet.entity.ArticleEntity; import com.epmet.redis.ArticleRedis; import com.epmet.service.ArticleService; @@ -120,4 +121,16 @@ public class ArticleServiceImpl extends BaseServiceImpl result = govOrgSelfFeignClient.getPublishAgencyList(tokenDTO.getUserId()); + return result.getData(); + } + } \ No newline at end of file From 0a2ed77683ea2b61d9cbcb79dedb5340c945be8a Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Tue, 2 Jun 2020 17:22:02 +0800 Subject: [PATCH 08/54] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF=E5=B7=B2?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E5=88=97=E8=A1=A8=E9=A1=B5=E7=9A=84=E6=A0=87?= =?UTF-8?q?=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/feign/GovVoiceFeignClient.java | 31 +++++++++++++++++ .../fallback/GovVoiceFeignClientFallBack.java | 23 +++++++++++++ .../epmet/dto/form/ResiTagListFormDto.java | 30 ++++++++++++++++ .../gov-voice/gov-voice-server/pom.xml | 5 +++ .../java/com/epmet/constant/TagConstant.java | 5 +++ .../com/epmet/controller/TagController.java | 7 +++- .../main/java/com/epmet/dao/ArticleDao.java | 10 +++++- .../main/java/com/epmet/redis/TagRedis.java | 27 +++++++++++++++ .../java/com/epmet/service/TagService.java | 11 +++++- .../service/impl/ArticleServiceImpl.java | 3 -- .../epmet/service/impl/TagServiceImpl.java | 28 +++++++++++---- .../src/main/resources/mapper/ArticleDao.xml | 12 +++++++ .../epmet/dto/form/ResiTagListFormDto.java | 31 +++++++++++++++++ .../resi-voice/resi-voice-server/pom.xml | 5 +++ .../epmet/controller/ArticleController.java | 25 ++++++++++++++ .../com/epmet/service/ArticleService.java | 21 ++++++++++++ .../service/impl/ArticleServiceImpl.java | 34 +++++++++++++++++++ 17 files changed, 295 insertions(+), 13 deletions(-) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/fallback/GovVoiceFeignClientFallBack.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java create mode 100644 epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java create mode 100644 epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/ArticleService.java create mode 100644 epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java new file mode 100644 index 0000000000..aa60bb70f0 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java @@ -0,0 +1,31 @@ +package com.epmet.dto.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.feign.fallback.GovVoiceFeignClientFallBack; +import com.epmet.dto.form.ResiTagListFormDto; +import com.epmet.dto.result.TagInfoResultDto; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/2 16:05 + * , url = "localhost:8105" + */ +@FeignClient(name = ServiceConstant.GOV_VOICE_SERVER, fallback = GovVoiceFeignClientFallBack.class, url = "localhost:8105") +public interface GovVoiceFeignClient { + + /** + * @Description 已发布列表页的标签——居民端 + * @param formDto + * @author zxc + */ + @PostMapping("/gov/voice/tag/resitaglist") + Result> resiTagList(@RequestBody ResiTagListFormDto formDto); + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/fallback/GovVoiceFeignClientFallBack.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/fallback/GovVoiceFeignClientFallBack.java new file mode 100644 index 0000000000..a8ad4e7af3 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/fallback/GovVoiceFeignClientFallBack.java @@ -0,0 +1,23 @@ +package com.epmet.dto.feign.fallback; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.feign.GovVoiceFeignClient; +import com.epmet.dto.form.ResiTagListFormDto; +import com.epmet.dto.result.TagInfoResultDto; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/2 16:07 + */ +@Component +public class GovVoiceFeignClientFallBack implements GovVoiceFeignClient { + @Override + public Result> resiTagList(ResiTagListFormDto formDto) { + return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "resiTagList", formDto); + } +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java new file mode 100644 index 0000000000..b63fa61a8f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java @@ -0,0 +1,30 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/2 15:50 + */ +@Data +public class ResiTagListFormDto implements Serializable { + + private static final long serialVersionUID = 4337657473061285656L; + /** + * 网格id + */ + private String gridId; + + /** + * 用户id + */ + private String customerId; + + /** + * 用户id + */ + private String userId; +} diff --git a/epmet-module/gov-voice/gov-voice-server/pom.xml b/epmet-module/gov-voice/gov-voice-server/pom.xml index 09030c6c9b..1ae17d3e45 100644 --- a/epmet-module/gov-voice/gov-voice-server/pom.xml +++ b/epmet-module/gov-voice/gov-voice-server/pom.xml @@ -24,6 +24,11 @@ epmet-user-client 2.0.0 + + com.epmet + resi-voice-client + 2.0.0 + com.epmet epmet-commons-tools diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java index 1ca78d3ac2..30697d832c 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java @@ -25,6 +25,11 @@ public interface TagConstant { */ String GOV_RETAG_KEY = "epmet:customer:article:retag:"; + /** + * 网格热度标签 key的前缀 【zset】 + */ + String GRID_TAG_KEY = "epmet:grid:articletag:"; + /** * 冒号 */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java index 61cb7fc94f..b7e0a0b73f 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java @@ -3,6 +3,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.ResiTagListFormDto; import com.epmet.dto.result.TagInfoResultDto; import com.epmet.service.TagService; import org.springframework.beans.factory.annotation.Autowired; @@ -20,7 +21,7 @@ public class TagController { private TagService tagService; /** - * @Description 已发布列表页的标签 + * @Description 已发布列表页的标签——政府端 * @param tokenDto * @author zxc */ @@ -29,5 +30,9 @@ public class TagController { return new Result>().ok(tagService.tagList(tokenDto)); } + @PostMapping("resitaglist") + public Result> resiTagList(@LoginUser ResiTagListFormDto formDto){ + return new Result>().ok(tagService.resiTagList(formDto)); + } } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java index d9c4204004..e04c6d8231 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.ResiTagListFormDto; import com.epmet.entity.ArticleEntity; import org.apache.ibatis.annotations.Mapper; @@ -29,5 +30,12 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ArticleDao extends BaseDao { - + + /** + * @Description + * @param formDto + * @author zxc + */ + Integer checkPublishArticle(ResiTagListFormDto formDto); + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java index 35117b41c3..143a86df45 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java @@ -48,6 +48,11 @@ public class TagRedis { return null; } + /** + * @Description 获取标签(政府端),按使用次数倒叙 + * @param key == customerId + * @author zxc + */ public List zRevRange(String key){ long start = 0; long end = -1; @@ -65,4 +70,26 @@ public class TagRedis { return result; } + /** + * @Description 获取标签(居民端) + * @param key == gridId + * @author zxc + */ + public List zGridRevRange(String key){ + long start = 0; + long end = -1; + String tagKey = TagConstant.GRID_TAG_KEY+key; + Set objects = redisUtils.zRevRange(tagKey, start, end); + if (objects.size()== NumConstant.ZERO){ + return new ArrayList<>(); + } + List result = new ArrayList(); + ObjectMapper objectMapper = new ObjectMapper(); + for (Object object : objects) { + TagInfoResultDto tagInfoResultDto = objectMapper.convertValue(object, TagInfoResultDto.class); + result.add(tagInfoResultDto); + } + return result; + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagService.java index 681d43da18..10f325e9d3 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagService.java @@ -1,6 +1,8 @@ package com.epmet.service; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.ResiTagListFormDto; import com.epmet.dto.result.TagInfoResultDto; import java.util.List; @@ -8,10 +10,17 @@ import java.util.List; public interface TagService { /** - * @Description 已发布列表页的标签 + * @Description 已发布列表页的标签——政府端 * @param tokenDto * @author zxc */ List tagList(TokenDto tokenDto); + /** + * @Description 已发布列表页的标签——居民端 + * @param formDto + * @author zxc + */ + List resiTagList( ResiTagListFormDto formDto); + } \ No newline at end of file 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 3b082d2776..afd4c22b29 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 @@ -69,9 +69,6 @@ public class ArticleServiceImpl extends BaseServiceImpl tagList(TokenDto tokenDto) { - TagCustomerFormDTO formDTO = new TagCustomerFormDTO(); - formDTO.setUserId(tokenDto.getUserId()); - TagCustomerResultDTO data = epmetUserFeignClient.getCustomerIdByUserId(formDTO).getData(); - if (StringUtils.isBlank(data.getCustomerId())){ + String customerId = tokenDto.getCustomerId(); + List resultDtos = tagRedis.zRevRange(customerId); + return resultDtos; + } + + /** + * @Description 已发布列表页的标签——居民端 + * @param formDto + * @author zxc + */ + @Override + public List resiTagList(ResiTagListFormDto formDto) { + Integer articleCounts = articleDao.checkPublishArticle(formDto); + if (articleCounts== NumConstant.ZERO){ return new ArrayList<>(); } - List resultDtos = tagRedis.zRevRange(data.getCustomerId()); - return resultDtos; + return tagRedis.zGridRevRange(formDto.getGridId()); } } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml index 488e2fe7cd..12c869c5f2 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml @@ -3,4 +3,16 @@ + + \ No newline at end of file diff --git a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java new file mode 100644 index 0000000000..1c7de733b7 --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/2 15:50 + */ +@Data +public class ResiTagListFormDto implements Serializable { + private static final long serialVersionUID = -794399801200532922L; + + /** + * 网格id + */ + @NotBlank(message = "网格id不能为空") + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 用户id + */ + private String userId; +} diff --git a/epmet-module/resi-voice/resi-voice-server/pom.xml b/epmet-module/resi-voice/resi-voice-server/pom.xml index 702124f779..836d94fe43 100644 --- a/epmet-module/resi-voice/resi-voice-server/pom.xml +++ b/epmet-module/resi-voice/resi-voice-server/pom.xml @@ -19,6 +19,11 @@ resi-voice-client 2.0.0 + + com.epmet + gov-voice-client + 2.0.0 + com.epmet epmet-commons-tools diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 46cce7aeed..68cd236d45 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -1,9 +1,34 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.ResiTagListFormDto; +import com.epmet.dto.result.TagInfoResultDto; +import com.epmet.service.ArticleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RestController @RequestMapping("article") public class ArticleController { + + @Autowired + private ArticleService articleService; + + /** + * @Description 首页标签及更多——居民端 + * @param formDto + * @author zxc + */ + @PostMapping("taglist") + public Result> resiTagList(@LoginUser TokenDto tokenDto, @RequestBody ResiTagListFormDto formDto){ + return new Result>().ok(articleService.resiTagList(tokenDto,formDto)); + } + } diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/ArticleService.java new file mode 100644 index 0000000000..5d58c7f4cd --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -0,0 +1,21 @@ +package com.epmet.service; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.ResiTagListFormDto; +import com.epmet.dto.result.TagInfoResultDto; + +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/2 15:59 + */ +public interface ArticleService { + + /** + * @Description 首页标签及更多——居民端 + * @param formDto + * @author zxc + */ + List resiTagList(TokenDto tokenDto, ResiTagListFormDto formDto); +} diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java new file mode 100644 index 0000000000..96f8addfd4 --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -0,0 +1,34 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.feign.GovVoiceFeignClient; +import com.epmet.dto.form.ResiTagListFormDto; +import com.epmet.dto.result.TagInfoResultDto; +import com.epmet.service.ArticleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/2 16:00 + */ +@Service +public class ArticleServiceImpl implements ArticleService { + + @Autowired + private GovVoiceFeignClient govVoiceFeignClient; + + /** + * @Description 首页标签及更多——居民端 + * @param formDto + * @author zxc + */ + @Override + public List resiTagList(TokenDto tokenDto, ResiTagListFormDto formDto) { + formDto.setCustomerId(tokenDto.getCustomerId()); + formDto.setUserId(tokenDto.getUserId()); + return govVoiceFeignClient.resiTagList(formDto).getData(); + } +} From 880c67067f5049e2783321f1460be09ca99e30f3 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 3 Jun 2020 09:44:53 +0800 Subject: [PATCH 09/54] =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=E5=85=B3=E7=B3=BB=E8=A1=A8=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=20=E7=BD=91=E6=A0=BC=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/ArticlePublishRangeDTO.java | 8 +- .../com/epmet/dto/DraftPublishRangeDTO.java | 8 +- .../epmet/dto/form/DraftContentFromDTO.java | 20 +---- .../epmet/controller/ArticleController.java | 8 +- .../entity/ArticlePublishRangeEntity.java | 5 ++ .../epmet/entity/DraftPublishRangeEntity.java | 5 ++ .../com/epmet/service/ArticleService.java | 4 +- .../service/impl/ArticleServiceImpl.java | 84 ++++++++----------- .../resources/migration/epmet_gov_voice.sql | 50 ++++++----- .../java/com/epmet/ArticleServiceTest.java | 45 ++++++++++ 10 files changed, 142 insertions(+), 95 deletions(-) create mode 100644 epmet-module/gov-voice/gov-voice-server/src/test/java/com/epmet/ArticleServiceTest.java diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticlePublishRangeDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticlePublishRangeDTO.java index 84a24f947b..02106d920b 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticlePublishRangeDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticlePublishRangeDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -53,6 +54,11 @@ public class ArticlePublishRangeDTO implements Serializable { */ private String gridId; + /** + * 组织-网格名称 + */ + private String agencyGridName; + /** * 下线时间 */ diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftPublishRangeDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftPublishRangeDTO.java index b0c57bb112..8457b400ea 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftPublishRangeDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftPublishRangeDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -53,6 +54,11 @@ public class DraftPublishRangeDTO implements Serializable { */ private String gridId; + /** + * 组织-网格名称 + */ + private String agencyGridName; + /** * 下线时间 */ diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java index 81d39fa698..5d933697d7 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java @@ -35,15 +35,7 @@ public class DraftContentFromDTO implements Serializable { private static final long serialVersionUID = -4206020151361420221L; - /** - * 文章ID 重新编辑时必填 - */ - private String articleId; - /** - * 客户ID - */ - private String customerId; /** * 草稿ID @@ -69,7 +61,7 @@ public class DraftContentFromDTO implements Serializable { /** * 内容Id */ - private String draftId; + private String draftContentId; /** * 内容 */ @@ -80,16 +72,6 @@ public class DraftContentFromDTO implements Serializable { */ private String contentType; - /** - * 审核状态 通过:pass;失败:fail; - */ - private String auditStatus; - - /** - * 审核理由 - */ - private String auditReason; - /** * 内容顺序 从1开始 */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index e72213a34d..48b7096595 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -28,10 +28,8 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.ArticleDTO; -import com.epmet.dto.form.LatestListFormDTO; -import com.epmet.dto.result.ArticleGridResultDTO; -import com.epmet.dto.result.LatestListResultDTO; import com.epmet.dto.form.DraftContentFromDTO; +import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.excel.ArticleExcel; import com.epmet.service.ArticleService; import org.springframework.beans.factory.annotation.Autowired; @@ -114,8 +112,8 @@ public class ArticleController { * @throws Exception */ @GetMapping("savecontent") - public Result savecontent(@RequestBody DraftContentFromDTO fromDTO) throws Exception { - String draftId = articleService.saveOrUpdateContent(fromDTO); + public Result saveOrUpdateContent(@LoginUser TokenDto tokenDto,@RequestBody DraftContentFromDTO fromDTO) throws Exception { + String draftId = articleService.saveOrUpdateContent(tokenDto, fromDTO); return new Result().ok(draftId); } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticlePublishRangeEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticlePublishRangeEntity.java index 9ee3aa1afa..de4911067c 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticlePublishRangeEntity.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticlePublishRangeEntity.java @@ -53,6 +53,11 @@ public class ArticlePublishRangeEntity extends BaseEpmetEntity { */ private String gridId; + /** + * 组织-网格名称 + */ + private String agencyGridName; + /** * 下线时间 */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftPublishRangeEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftPublishRangeEntity.java index 93833228cf..fb3233cbb1 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftPublishRangeEntity.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftPublishRangeEntity.java @@ -53,6 +53,11 @@ public class DraftPublishRangeEntity extends BaseEpmetEntity { */ private String gridId; + /** + * 组织-网格名称 + */ + private String agencyGridName; + /** * 下线时间 */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index 9cae7ed196..dd166a0b51 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -106,8 +106,10 @@ public interface ArticleService extends BaseService { /** * desc:保存或修改文章内容 + * + * @param tokenDto * @param fromDTO * @return */ - String saveOrUpdateContent(DraftContentFromDTO fromDTO); + String saveOrUpdateContent(TokenDto tokenDto, DraftContentFromDTO fromDTO); } \ No newline at end of file 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 3b082d2776..778a08b7b4 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 @@ -16,17 +16,16 @@ */ package com.epmet.service.impl; - import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; @@ -36,8 +35,8 @@ import com.epmet.dao.DraftContentDao; import com.epmet.dao.DraftDao; import com.epmet.dto.ArticleDTO; import com.epmet.dto.feign.GovOrgSelfFeignClient; -import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.dto.form.DraftContentFromDTO; +import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.entity.ArticleEntity; import com.epmet.entity.DraftContentEntity; import com.epmet.entity.DraftEntity; @@ -49,11 +48,9 @@ import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.PathVariable; import org.springframework.util.CollectionUtils; import java.util.*; -import java.util.stream.Collectors; /** * 文章表 @@ -63,14 +60,12 @@ import java.util.stream.Collectors; */ @Service public class ArticleServiceImpl extends BaseServiceImpl implements ArticleService { - + private final Log logger = LogFactory.getLog(getClass()); @Autowired private ArticleRedis articleRedis; @Autowired private GovOrgSelfFeignClient govOrgSelfFeignClient; - private final Log logger = LogFactory.getLog(getClass()); - @Autowired - private ArticleRedis articleRedis; + @Autowired private DraftDao draftDao; @@ -145,25 +140,13 @@ public class ArticleServiceImpl extends BaseServiceImpl articleParamMap = new HashMap<>(); - articleParamMap.put("ARTICLE_ID", fromDTO.getArticleId()); - articleParamMap.put("ARTICLE_ID", fromDTO.getArticleId()); - articleDao.selectByMap(articleParamMap); - } DraftEntity draftEntity = null; List draftContentList = null; if (StringUtils.isNotBlank(fromDTO.getDraftId())) { - //TODO - draftEntity = draftDao.selectById(fromDTO.getDraftId()); if (draftEntity == null) { logger.warn("saveOrUpdateContent draftId is not exist in db"); @@ -176,56 +159,63 @@ public class ArticleServiceImpl extends BaseServiceImpl draftIdMap = new HashMap<>(); + draftIdMap.put("DRAFT_ID", fromDTO.getDraftId()); + draftContentDao.deleteByMap(draftIdMap); //TODO 改为批量插入 draftContentList.forEach(content -> draftContentDao.insert(content)); - String draftId = draftEntity.getId(); - - - return null; + return draftId; } /** * desc:构建 内容对象 * + * + * @param tokenDto * @param fromDTO - * @param havePublished * @return */ - private List buildDraftContent(DraftContentFromDTO fromDTO, boolean havePublished) { + private List buildDraftContent(TokenDto tokenDto, DraftContentFromDTO fromDTO) { //如果已发布 则需要校验内容是否更改过 没有更改则 不对审核状态进行重置 List newContentList = new ArrayList<>(); - Map oldContentMap = null; - Map draftIdMap = new HashMap<>(); - draftIdMap.put("DRAFT_ID", fromDTO.getDraftId()); - if (havePublished) { - List oldContentEntities = draftContentDao.selectByMap(draftIdMap); - oldContentMap = oldContentEntities.stream().collect(Collectors.toMap(DraftContentEntity::getId, content -> content)); - //删掉所有 - draftContentDao.deleteByMap(draftIdMap); - } + List contentList = fromDTO.getContentList(); - Map finalOldContentMap = oldContentMap; Set orderNumSet = new HashSet<>(); contentList.forEach(content -> { - if (finalOldContentMap != null && finalOldContentMap.get(content.getDraftId()) != null) { - DraftContentEntity oldContent = finalOldContentMap.get(content.getDraftId()); - if (oldContent.getContent().equals(content.getContent())) { - content.setAuditReason(oldContent.getAuditReason()); - content.setAuditStatus(oldContent.getAuditStatus()); - } - } DraftContentEntity entity = ConvertUtils.sourceToTarget(content, DraftContentEntity.class); - entity.setId(content.getDraftId()); + entity.setId(content.getDraftContentId()); + entity.setCustomerId(tokenDto.getCustomerId()); + entity.setDraftId(fromDTO.getDraftId()); orderNumSet.add(content.getOrderNum()); newContentList.add(entity); }); diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql index d616dd51e2..3a38eaa980 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql @@ -1,11 +1,4 @@ -/* - Date: 2/06/2020 16:13:38 -*/ - --- SET NAMES utf8mb4; --- #SET FOREIGN_KEY_CHECKS = 0; - -CREATE DATABASE `epmet_gov_access` DEFAULT CHARACTER SET utf8mb4; +DROP TABLE tag_default;/*SkipError*/ CREATE TABLE tag_default( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , TAG_NAME VARCHAR(32) NOT NULL COMMENT '标签名称' , @@ -19,6 +12,7 @@ CREATE TABLE tag_default( ) COMMENT = '默认标签表 默认标签表'; ALTER TABLE tag_default COMMENT '默认标签表'; +DROP TABLE tag_customer;/*SkipError*/ CREATE TABLE tag_customer( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , @@ -35,6 +29,7 @@ CREATE TABLE tag_customer( ALTER TABLE tag_customer ADD INDEX INX_TAG_NAME(TAG_NAME); ALTER TABLE tag_customer COMMENT '客户标签表'; +DROP TABLE tag_grid;/*SkipError*/ CREATE TABLE tag_grid( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , @@ -52,6 +47,7 @@ CREATE TABLE tag_grid( ) COMMENT = '网格标签表 网格标签表'; ALTER TABLE tag_grid COMMENT '网格标签表'; +DROP TABLE article_tags;/*SkipError*/ CREATE TABLE article_tags( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , @@ -69,18 +65,19 @@ CREATE TABLE article_tags( ALTER TABLE article_tags ADD INDEX IDX_ARTICLE_ID(ARTICLE_ID); ALTER TABLE article_tags COMMENT '文章标签表'; +DROP TABLE draft;/*SkipError*/ CREATE TABLE draft( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , TITLE VARCHAR(128) NOT NULL COMMENT '文章标题' , PREVIEW_CONTENT VARCHAR(512) NOT NULL COMMENT '文章内容 精简内容' , - IS_TOP INT NOT NULL COMMENT '是否置顶' , + IS_TOP INT NOT NULL COMMENT '是否置顶 1是;0否;' , PUBLISH_RANGE_DESC VARCHAR(512) NOT NULL COMMENT '发布范围描述 所有发布范围集合' , PUBLISHER_ID VARCHAR(64) NOT NULL COMMENT '发布单位ID' , PUBLISHER_NAME VARCHAR(128) NOT NULL COMMENT '发布单位名称' , PUBLISHER_TYPE VARCHAR(32) NOT NULL COMMENT '发布单位类型 机关:agency;部门:department;网格:grid' , PUBLISH_DATE DATE NOT NULL COMMENT '发布时间' , - STATUS_FLAG VARCHAR(32) NOT NULL COMMENT '发布状态 未发布:unpublish ;已发布:published,审核中:auditing,审核失败:auditfail' , + STATUS_FLAG VARCHAR(32) NOT NULL COMMENT '发布状态 未发布:unpublish ;已发布:published,审核中:auditing;审核失败:auditfail' , TAGS VARCHAR(512) NOT NULL COMMENT '文章标签串 竖杠分割的标签名称' , ORG_ID VARCHAR(64) COMMENT '组织ID' , ORG_ID_PATH VARCHAR(512) COMMENT '组织ID路径 eg:字段为def:abc' , @@ -96,14 +93,15 @@ CREATE TABLE draft( ) COMMENT = '草稿表 草稿表'; ALTER TABLE draft COMMENT '草稿表'; +DROP TABLE draft_content;/*SkipError*/ CREATE TABLE draft_content( ID VARCHAR(64) NOT NULL COMMENT '主键ID 主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , DRAFT_ID VARCHAR(64) NOT NULL COMMENT '草稿ID' , CONTENT VARCHAR(1024) NOT NULL COMMENT '内容' , CONTENT_TYPE VARCHAR(32) NOT NULL COMMENT '内容类型 图片:img;文字:text' , - AUDIT_STATUS VARCHAR(32) NOT NULL COMMENT '审核状态 通过:pass;失败:fail;' , - AUDIT_REASON VARCHAR(128) NOT NULL COMMENT '审核理由' , + AUDIT_STATUS VARCHAR(32) COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing;' , + AUDIT_REASON VARCHAR(128) COMMENT '审核理由' , ORDER_NUM INT NOT NULL COMMENT '内容顺序 从1开始' , DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , REVISION INT NOT NULL COMMENT '乐观锁' , @@ -115,11 +113,13 @@ CREATE TABLE draft_content( ) COMMENT = '草稿内容表 草稿内容表'; ALTER TABLE draft_content COMMENT '草稿内容表'; +DROP TABLE draft_publish_range;/*SkipError*/ CREATE TABLE draft_publish_range( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , DRAFT_ID VARCHAR(64) NOT NULL COMMENT 'ID草稿' , GRID_ID VARCHAR(64) NOT NULL COMMENT '网格ID' , + AGENCY_GRID_NAME VARCHAR(64) NOT NULL COMMENT '组织-网格名称' , OFF_LINE_TIME DATETIME COMMENT '下线时间' , PUBLISH_STATUS VARCHAR(32) NOT NULL COMMENT '发布状态 未发布:unpublish ;已发布:published' , DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , @@ -132,13 +132,14 @@ CREATE TABLE draft_publish_range( ) COMMENT = '草稿发布范围表 草稿发布范围表'; ALTER TABLE draft_publish_range COMMENT '草稿发布范围表'; +DROP TABLE draft_cover;/*SkipError*/ CREATE TABLE draft_cover( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , DRAFT_ID VARCHAR(64) NOT NULL COMMENT '草稿ID' , IMG_URL VARCHAR(512) NOT NULL COMMENT '封面图片地址 url地址' , - AUDIT_STATUS VARCHAR(32) NOT NULL COMMENT '审核状态 通过:pass;失败:fail;' , - AUDIT_REASON VARCHAR(128) NOT NULL COMMENT '审核理由' , + AUDIT_STATUS VARCHAR(32) COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing;' , + AUDIT_REASON VARCHAR(128) COMMENT '审核理由' , DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , REVISION INT NOT NULL COMMENT '乐观锁' , CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , @@ -149,14 +150,15 @@ CREATE TABLE draft_cover( ) COMMENT = '草稿封面表 草稿封面表'; ALTER TABLE draft_cover COMMENT '草稿封面表'; +DROP TABLE article;/*SkipError*/ CREATE TABLE article( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , DRAFT_ID VARCHAR(64) NOT NULL COMMENT '草稿ID' , TITLE VARCHAR(128) NOT NULL COMMENT '文章标题' , PREVIEW_CONTENT VARCHAR(512) NOT NULL COMMENT '文章内容 精简内容' , - IS_TOP INT NOT NULL COMMENT '是否置顶' , - PUBLISH_RANGE_DESC VARCHAR(512) NOT NULL COMMENT '发布范围描述 所有发布范围集合' , + IS_TOP INT NOT NULL COMMENT '是否置顶 1是;0否;' , + PUBLISH_RANGE_DESC VARCHAR(512) NOT NULL COMMENT '发布范围描述 所有发布范围集合,顿号隔开' , PUBLISHER_ID VARCHAR(64) NOT NULL COMMENT '发布单位ID' , PUBLISHER_NAME VARCHAR(128) NOT NULL COMMENT '发布单位名称' , PUBLISHER_TYPE VARCHAR(32) NOT NULL COMMENT '发布单位类型 机关:agency;部门:department;网格:grid' , @@ -178,14 +180,15 @@ CREATE TABLE article( ) COMMENT = '文章表 正式文章表'; ALTER TABLE article COMMENT '文章表'; +DROP TABLE article_content;/*SkipError*/ CREATE TABLE article_content( ID VARCHAR(64) NOT NULL COMMENT '主键ID 主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , CONTENT VARCHAR(1024) NOT NULL COMMENT '内容' , CONTENT_TYPE VARCHAR(32) NOT NULL COMMENT '内容类型 图片:img;文字:text' , - AUDIT_STATUS VARCHAR(32) NOT NULL COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing' , - AUDIT_REASON VARCHAR(128) NOT NULL COMMENT '审核理由' , + AUDIT_STATUS VARCHAR(32) COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing;' , + AUDIT_REASON VARCHAR(128) COMMENT '审核理由' , ORDER_NUM INT NOT NULL COMMENT '内容顺序 从1开始' , DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , REVISION INT NOT NULL COMMENT '乐观锁' , @@ -197,13 +200,14 @@ CREATE TABLE article_content( ) COMMENT = '文章内容表 文章内容表'; ALTER TABLE article_content COMMENT '文章内容表'; +DROP TABLE article_cover;/*SkipError*/ CREATE TABLE article_cover( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , IMG_URL VARCHAR(512) NOT NULL COMMENT '封面图片地址 url地址' , - AUDIT_STATUS VARCHAR(32) NOT NULL COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing' , - AUDIT_REASON VARCHAR(128) NOT NULL COMMENT '审核理由' , + AUDIT_STATUS VARCHAR(32) COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing' , + AUDIT_REASON VARCHAR(128) COMMENT '审核理由' , DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , REVISION INT NOT NULL COMMENT '乐观锁' , CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , @@ -214,13 +218,15 @@ CREATE TABLE article_cover( ) COMMENT = '文章封面表 文章封面表'; ALTER TABLE article_cover COMMENT '文章封面表'; +DROP TABLE article_publish_range;/*SkipError*/ CREATE TABLE article_publish_range( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , GRID_ID VARCHAR(64) NOT NULL COMMENT '网格ID' , + AGENCY_GRID_NAME VARCHAR(64) NOT NULL COMMENT '组织-网格名称' , OFF_LINE_TIME DATETIME COMMENT '下线时间' , - PUBLISH_STATUS VARCHAR(32) NOT NULL COMMENT '发布状态' , + PUBLISH_STATUS VARCHAR(32) NOT NULL COMMENT '发布状态 未发布:unpublish ;已发布:published' , DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , REVISION INT NOT NULL COMMENT '乐观锁' , CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , @@ -232,6 +238,7 @@ CREATE TABLE article_publish_range( ALTER TABLE article_publish_range ADD INDEX IDX_ARTICLE_ID(ARTICLE_ID); ALTER TABLE article_publish_range COMMENT '文章发布范围表'; +DROP TABLE article_operate_record;/*SkipError*/ CREATE TABLE article_operate_record( ID VARCHAR(64) NOT NULL COMMENT '主键ID 主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , @@ -250,6 +257,7 @@ CREATE TABLE article_operate_record( ) COMMENT = '文章操作记录表 文章操作记录表'; ALTER TABLE article_operate_record COMMENT '文章操作记录表'; +DROP TABLE article_visit_record;/*SkipError*/ CREATE TABLE article_visit_record( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , diff --git a/epmet-module/gov-voice/gov-voice-server/src/test/java/com/epmet/ArticleServiceTest.java b/epmet-module/gov-voice/gov-voice-server/src/test/java/com/epmet/ArticleServiceTest.java new file mode 100644 index 0000000000..6d0903be34 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/test/java/com/epmet/ArticleServiceTest.java @@ -0,0 +1,45 @@ +package com.epmet; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.DraftContentFromDTO; +import com.epmet.service.ArticleService; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.ArrayList; +import java.util.List; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class ArticleServiceTest { + + + + @Autowired + private ArticleService articleService; + + @Test + public void genToken() { + TokenDto tokenDto = new TokenDto(); + tokenDto.setCustomerId("1"); + tokenDto.setUserId("1"); + DraftContentFromDTO draftContentFromDTO = new DraftContentFromDTO(); + //draftContentFromDTO.setDraftId("1"); + draftContentFromDTO.setTitle("testTitle"); + List list = new ArrayList<>(); + for (int i = 0; i <2 ; i++) { + DraftContentFromDTO.DraftContentDTO contentDTO = new DraftContentFromDTO.DraftContentDTO(); + contentDTO.setDraftContentId(""); + contentDTO.setContent("内容"+i); + contentDTO.setContentType("text"); + contentDTO.setOrderNum(1+i); + list.add(contentDTO); + } + draftContentFromDTO.setContentList(list); + String s = articleService.saveOrUpdateContent(tokenDto, draftContentFromDTO); + System.out.println(s); + } +} From 5f7215306b160d8654308e25d48777d2fcbf4b58 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 3 Jun 2020 10:08:29 +0800 Subject: [PATCH 10/54] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ArticleServiceImpl.java | 46 +++++++++---------- 1 file changed, 21 insertions(+), 25 deletions(-) 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 778a08b7b4..d8ca414445 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 @@ -16,6 +16,7 @@ */ package com.epmet.service.impl; + import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -61,10 +62,10 @@ import java.util.*; @Service public class ArticleServiceImpl extends BaseServiceImpl implements ArticleService { private final Log logger = LogFactory.getLog(getClass()); - @Autowired - private ArticleRedis articleRedis; - @Autowired - private GovOrgSelfFeignClient govOrgSelfFeignClient; + @Autowired + private ArticleRedis articleRedis; + @Autowired + private GovOrgSelfFeignClient govOrgSelfFeignClient; @Autowired @@ -126,17 +127,17 @@ public class ArticleServiceImpl extends BaseServiceImpl result = govOrgSelfFeignClient.getAgencyGridList(tokenDTO.getUserId()); - return result.getData(); - } + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布范围 + **/ + @Override + public ArticleGridResultDTO agencyGridList(TokenDto tokenDTO) { + Result result = govOrgSelfFeignClient.getAgencyGridList(tokenDTO.getUserId()); + return result.getData(); + } @Override @Transactional(rollbackFor = Exception.class) @@ -181,7 +182,7 @@ public class ArticleServiceImpl extends BaseServiceImpl buildDraftContent(TokenDto tokenDto, DraftContentFromDTO fromDTO) { - //如果已发布 则需要校验内容是否更改过 没有更改则 不对审核状态进行重置 List newContentList = new ArrayList<>(); List contentList = fromDTO.getContentList(); - Set orderNumSet = new HashSet<>(); - contentList.forEach(content -> { + for (int i = 0; i < contentList.size(); i++) { + DraftContentFromDTO.DraftContentDTO content = contentList.get(i); DraftContentEntity entity = ConvertUtils.sourceToTarget(content, DraftContentEntity.class); entity.setId(content.getDraftContentId()); entity.setCustomerId(tokenDto.getCustomerId()); entity.setDraftId(fromDTO.getDraftId()); - orderNumSet.add(content.getOrderNum()); + entity.setOrderNum(i + 1); newContentList.add(entity); - }); - if (orderNumSet.size() != newContentList.size()) { - logger.warn("saveOrUpdateContent contentList orderNum is repeat"); - throw new RenException("参数错误"); } + return newContentList; } From 186572a69f8752a1964ce4a16f45e0b313e78f3e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 3 Jun 2020 10:34:42 +0800 Subject: [PATCH 11/54] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=8D=89=E7=A8=BF?= =?UTF-8?q?=E3=80=81=E6=96=87=E7=AB=A0=E6=93=8D=E4=BD=9C=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E3=80=81=E6=94=BF=E5=BA=9C=E7=AB=AF=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=B7=B2=E4=B8=8B=E7=BA=BF=E3=80=81=E5=B7=B2=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E6=96=87=E7=AB=A0=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/enums/RequirePermissionEnum.java | 4 +- .../dto/form/ArticleOperationFormDTO.java | 25 +++++++ .../epmet/dto/form/DeleteDraftFormDTO.java | 25 +++++++ .../dto/form/GovArticleDetailFormDTO.java | 24 +++++++ .../dto/result/ArticleOperationResultDTO.java | 19 +++++ .../dto/result/GovArticleContentDTO.java | 25 +++++++ .../dto/result/GovArticleDetailResultDTO.java | 69 +++++++++++++++++++ .../com/epmet/constant/DraftConstant.java | 16 +++++ .../epmet/controller/ArticleController.java | 44 +++++++++++- .../com/epmet/controller/DraftController.java | 17 +++++ .../main/java/com/epmet/dao/ArticleDao.java | 38 +++++++--- .../epmet/dao/ArticleOperateRecordDao.java | 11 ++- .../service/ArticleOperateRecordService.java | 11 +++ .../com/epmet/service/ArticleService.java | 11 +++ .../java/com/epmet/service/DraftService.java | 10 +++ .../impl/ArticleOperateRecordServiceImpl.java | 13 +++- .../service/impl/ArticleServiceImpl.java | 26 ++++--- .../epmet/service/impl/DraftServiceImpl.java | 19 ++++- .../src/main/resources/mapper/ArticleDao.xml | 31 +++++++++ .../mapper/ArticleOperateRecordDao.xml | 15 +++- 20 files changed, 422 insertions(+), 31 deletions(-) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleOperationFormDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DeleteDraftFormDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GovArticleDetailFormDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleOperationResultDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleContentDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleDetailResultDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java index 5be4136e4b..61f64d7168 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java @@ -104,8 +104,8 @@ public enum RequirePermissionEnum { WORK_PARTY_VOICE_OFFLINE_LIST("work_party_voice_offline_list", "党建声音:已下线列表", "已下线文章列表"), WORK_PARTY_VOICE_PUBLISH("work_party_voice_publish", "党建声音:创建文章", ""), WORK_PARTY_VOICE_EDIT("work_party_voice_edit", "党建声音:重新编辑", ""), - WORK_PARTY_VOICE_OFFLINE("work_party_voice_offline", "党建声音:下线文章", ""); - + WORK_PARTY_VOICE_OFFLINE("work_party_voice_offline", "党建声音:下线文章", ""), + WORK_PARTY_VOICE_OPERATION_LIST("work_party_voice_operation_list","党建声音:查看文章操作记录",""); private String key; diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleOperationFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleOperationFormDTO.java new file mode 100644 index 0000000000..600a3913ad --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleOperationFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 查询文章操作记录 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/2 16:42 + */ +@Data +public class ArticleOperationFormDTO implements Serializable { + private static final long serialVersionUID = -6659391832410565077L; + + public interface AddUserInternalGroup {} + + /** + * 文章id + */ + @NotBlank(message = "文章id不能为空", groups = {ArticleOperationFormDTO.AddUserInternalGroup.class}) + private String articleId; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DeleteDraftFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DeleteDraftFormDTO.java new file mode 100644 index 0000000000..761b844b0e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DeleteDraftFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 政府端工作人员,删除草稿入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/2 15:25 + */ +@Data +public class DeleteDraftFormDTO implements Serializable { + private static final long serialVersionUID = -2424432724401298206L; + + public interface AddUserInternalGroup {} + + /** + * 草稿id + */ + @NotBlank(message = "草稿id不能为空", groups = {AddUserInternalGroup.class}) + private String draftId; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GovArticleDetailFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GovArticleDetailFormDTO.java new file mode 100644 index 0000000000..a2a629059e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GovArticleDetailFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 政府端:(已发布、已下线)文章详情 入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/2 17:21 + */ +@Data +public class GovArticleDetailFormDTO implements Serializable { + private static final long serialVersionUID = 2149876964249893025L; + public interface AddUserInternalGroup {} + + /** + * 文章id + */ + @NotBlank(message = "文章id不能为空", groups = {GovArticleDetailFormDTO.AddUserInternalGroup.class}) + private String articleId; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleOperationResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleOperationResultDTO.java new file mode 100644 index 0000000000..899c7273ec --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleOperationResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/2 16:44 + */ +@Data +public class ArticleOperationResultDTO implements Serializable { + private static final long serialVersionUID = -436748500797911121L; + private String id; + private String content; + private Long createdTime; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleContentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleContentDTO.java new file mode 100644 index 0000000000..dbb98d9d3d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleContentDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 政府端:(已发布、已下线)文章内容详情 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/3 9:39 + */ +@Data +public class GovArticleContentDTO implements Serializable { + private static final long serialVersionUID = 1519014754254863006L; + /** + * 内容类型,图片:img;文字:text + */ + private String contentType; + + /** + * 内容 + */ + private String content; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleDetailResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleDetailResultDTO.java new file mode 100644 index 0000000000..51ed6bc69b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleDetailResultDTO.java @@ -0,0 +1,69 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 政府端:(已发布、已下线)文章详情 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/3 9:29 + */ +@Data +public class GovArticleDetailResultDTO implements Serializable { + private static final long serialVersionUID = -8328304788721564622L; + /** + * 文章id + */ + private String articleId; + + /** + * 标题 + */ + private String title; + + /** + * 发布单位名称 + */ + private String publisherName; + + /** + * 发布日期 + */ + @JsonFormat(pattern="yyyy-MM-dd") + private Date publishDate; + + /** + * 访问量 + */ + private Integer visitRecordCount; + + /** + * 发布范围字符串 + */ + private String publishRangeDesc; + + /** + * 标签字符串 + */ + private String tags; + + /** + * 发布状态 已发布:published;已下线:offline + */ + private String statusFlag; + + /** + * 草稿Id,重新编辑时使用 + */ + private String draftId; + + /** + * 内容列表 + */ + private List articleContentList; +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java index 915a4eef57..dfab2106a0 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java @@ -10,8 +10,24 @@ package com.epmet.constant; /** * 常量 + * * @author sun * @since 1.0.0 */ public interface DraftConstant { + // 发布状态 + /** + * 未发布:unpublish + */ + String UNPUBLISH = "unpublish"; + + /** + * 已发布:published + */ + String PUBLISHED = "published"; + + /** + * 审核中:auditing + */ + String AUDITING = "auditing"; } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index e72213a34d..1be7ef624d 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -18,6 +18,8 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.RequirePermission; +import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; @@ -28,11 +30,14 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.ArticleDTO; -import com.epmet.dto.form.LatestListFormDTO; -import com.epmet.dto.result.ArticleGridResultDTO; -import com.epmet.dto.result.LatestListResultDTO; +import com.epmet.dto.form.ArticleOperationFormDTO; import com.epmet.dto.form.DraftContentFromDTO; +import com.epmet.dto.form.GovArticleDetailFormDTO; +import com.epmet.dto.result.ArticleGridResultDTO; +import com.epmet.dto.result.ArticleOperationResultDTO; +import com.epmet.dto.result.GovArticleDetailResultDTO; import com.epmet.excel.ArticleExcel; +import com.epmet.service.ArticleOperateRecordService; import com.epmet.service.ArticleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -54,6 +59,8 @@ public class ArticleController { @Autowired private ArticleService articleService; + @Autowired + private ArticleOperateRecordService articleOperateRecordService; @GetMapping("page") public Result> page(@RequestParam Map params){ @@ -119,4 +126,35 @@ public class ArticleController { return new Result().ok(draftId); } + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei@elink-cn.com + * @description 政府端:查询文章操作记录 + * @date 2020/6/2 16:50 + **/ + @PostMapping("oprationlist") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OPERATION_LIST) + public Result> operationList(@RequestBody ArticleOperationFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ArticleOperationFormDTO.AddUserInternalGroup.class); + List list = + articleOperateRecordService.listOfArticleOperation(formDTO.getArticleId()); + return new Result>().ok(list); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei@elink-cn.com + * @description 政府端:(已发布、已下线)文章详情 + * @date 2020/6/3 9:44 + **/ + @PostMapping("articledetail") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DETAIL) + public Result articleDetail(@RequestBody GovArticleDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); + GovArticleDetailResultDTO articleDetail = articleService.queryGovArticleDetail(formDTO.getArticleId()); + return new Result().ok(articleDetail); + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java index 9b69445888..1fc03f1d9c 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java @@ -17,6 +17,8 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.RequirePermission; +import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; @@ -26,6 +28,7 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.DraftDTO; +import com.epmet.dto.form.DeleteDraftFormDTO; import com.epmet.excel.DraftExcel; import com.epmet.service.DraftService; import org.springframework.beans.factory.annotation.Autowired; @@ -91,4 +94,18 @@ public class DraftController { ExcelUtils.exportExcelToTarget(response, null, list, DraftExcel.class); } + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei@elink-cn.com + * @description 政府端:工作人员,删除草稿 + * @date 2020/6/2 16:00 + **/ + @PostMapping("deletedraft") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_DELETE) + public Result deleteDraft(@RequestBody DeleteDraftFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, DeleteDraftFormDTO.AddUserInternalGroup.class); + draftService.deleteDraft(formDTO); + return new Result(); + } } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java index d9c4204004..2f176db48a 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java @@ -1,26 +1,27 @@ /** * Copyright 2018 人人开源 https://www.renren.io *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later + * version. *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along with this program. If not, see + * . */ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.GovArticleContentDTO; +import com.epmet.dto.result.GovArticleDetailResultDTO; import com.epmet.entity.ArticleEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 文章表 * @@ -29,5 +30,20 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ArticleDao extends BaseDao { - + + /** + * 政府端查询文章详情 + * + * @param articleId + * 文章id + */ + GovArticleDetailResultDTO queryGovArticleDetail(String articleId); + + /** + * 政府端查询文章详情-内容 + * + * @param articleId + * 文章id + */ + List queryGovArticleContent(String articleId); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleOperateRecordDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleOperateRecordDao.java index 1b60fdd5d6..f186193252 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleOperateRecordDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleOperateRecordDao.java @@ -18,9 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ArticleOperationResultDTO; import com.epmet.entity.ArticleOperateRecordEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 文章操作记录表 * @@ -29,5 +32,11 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ArticleOperateRecordDao extends BaseDao { - + + /** + * 根据文章id查询操作记录 + * + * @param articleId + */ + List selectListByArticleId(String articleId); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleOperateRecordService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleOperateRecordService.java index c8cd715443..368ecfcef7 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleOperateRecordService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleOperateRecordService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.ArticleOperateRecordDTO; +import com.epmet.dto.result.ArticleOperationResultDTO; import com.epmet.entity.ArticleOperateRecordEntity; import java.util.List; @@ -92,4 +93,14 @@ public interface ArticleOperateRecordService extends BaseService listOfArticleOperation(String articleId); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index 9cae7ed196..93a664e006 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -23,6 +23,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.ArticleDTO; import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.dto.form.DraftContentFromDTO; +import com.epmet.dto.result.GovArticleDetailResultDTO; import com.epmet.entity.ArticleEntity; import java.util.List; @@ -110,4 +111,14 @@ public interface ArticleService extends BaseService { * @return */ String saveOrUpdateContent(DraftContentFromDTO fromDTO); + + /** + * 政府端:(已发布、已下线)文章详情 + * + * @param articleId + * @return com.epmet.dto.result.GovArticleDetailResultDTO + * @author yinzuomei@elink-cn.com + * @date 2020-06-03 + */ + GovArticleDetailResultDTO queryGovArticleDetail(String articleId); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java index 12446f2e2d..36a9fc1b57 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.DraftDTO; +import com.epmet.dto.form.DeleteDraftFormDTO; import com.epmet.entity.DraftEntity; import java.util.List; @@ -92,4 +93,13 @@ public interface DraftService extends BaseService { * @date 2020-06-02 */ void delete(String[] ids); + + /** + * @param formDTO + * @return void + * @author yinzuomei@elink-cn.com + * @description 政府端工作人员,删除草稿 + * @date 2020/6/2 16:09 + **/ + void deleteDraft(DeleteDraftFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleOperateRecordServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleOperateRecordServiceImpl.java index ca6fe17651..a237638d2b 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleOperateRecordServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleOperateRecordServiceImpl.java @@ -20,11 +20,12 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.ArticleOperateRecordDao; import com.epmet.dto.ArticleOperateRecordDTO; +import com.epmet.dto.result.ArticleOperationResultDTO; import com.epmet.entity.ArticleOperateRecordEntity; import com.epmet.redis.ArticleOperateRecordRedis; import com.epmet.service.ArticleOperateRecordService; @@ -33,6 +34,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -101,4 +103,13 @@ public class ArticleOperateRecordServiceImpl extends BaseServiceImpl listOfArticleOperation(String articleId) { + List list = baseDao.selectListByArticleId(articleId); + if (null == list) { + return new ArrayList<>(); + } + return list; + } + } \ No newline at end of file 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 3b082d2776..09c91ad94c 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 @@ -26,7 +26,6 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; @@ -36,8 +35,10 @@ import com.epmet.dao.DraftContentDao; import com.epmet.dao.DraftDao; import com.epmet.dto.ArticleDTO; import com.epmet.dto.feign.GovOrgSelfFeignClient; -import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.dto.form.DraftContentFromDTO; +import com.epmet.dto.result.ArticleGridResultDTO; +import com.epmet.dto.result.GovArticleContentDTO; +import com.epmet.dto.result.GovArticleDetailResultDTO; import com.epmet.entity.ArticleEntity; import com.epmet.entity.DraftContentEntity; import com.epmet.entity.DraftEntity; @@ -49,7 +50,6 @@ import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.PathVariable; import org.springframework.util.CollectionUtils; import java.util.*; @@ -63,21 +63,15 @@ import java.util.stream.Collectors; */ @Service public class ArticleServiceImpl extends BaseServiceImpl implements ArticleService { - + private final Log logger = LogFactory.getLog(getClass()); @Autowired private ArticleRedis articleRedis; @Autowired private GovOrgSelfFeignClient govOrgSelfFeignClient; - private final Log logger = LogFactory.getLog(getClass()); - @Autowired - private ArticleRedis articleRedis; - @Autowired private DraftDao draftDao; @Autowired private DraftContentDao draftContentDao; - @Autowired - private ArticleDao articleDao; @Override public PageData page(Map params) { @@ -156,7 +150,7 @@ public class ArticleServiceImpl extends BaseServiceImpl articleParamMap = new HashMap<>(); articleParamMap.put("ARTICLE_ID", fromDTO.getArticleId()); articleParamMap.put("ARTICLE_ID", fromDTO.getArticleId()); - articleDao.selectByMap(articleParamMap); + baseDao.selectByMap(articleParamMap); } DraftEntity draftEntity = null; @@ -193,6 +187,16 @@ public class ArticleServiceImpl extends BaseServiceImpl articleContentList = baseDao.queryGovArticleContent(articleId); + articleDetail.setArticleContentList(articleContentList); + } + return articleDetail; + } + /** * desc:构建 内容对象 * diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java index 21402cb7a2..000a4d9b83 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java @@ -20,15 +20,20 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.DraftConstant; import com.epmet.dao.DraftDao; import com.epmet.dto.DraftDTO; +import com.epmet.dto.form.DeleteDraftFormDTO; import com.epmet.entity.DraftEntity; import com.epmet.redis.DraftRedis; import com.epmet.service.DraftService; import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -45,7 +50,7 @@ import java.util.Map; */ @Service public class DraftServiceImpl extends BaseServiceImpl implements DraftService { - + private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private DraftRedis draftRedis; @@ -101,4 +106,16 @@ public class DraftServiceImpl extends BaseServiceImpl imp baseDao.deleteBatchIds(Arrays.asList(ids)); } + @Override + public void deleteDraft(DeleteDraftFormDTO formDTO) { + DraftDTO draftDTO = this.get(formDTO.getDraftId()); + // 已发布的草稿不能删除 + if (null == draftDTO || DraftConstant.PUBLISHED.equals(draftDTO.getStatusFlag())) { + logger.error(String.format("删除草稿错误,已发布的草稿不能删除。草稿id%s", formDTO.getDraftId())); + return; + } + draftDTO.setDelFlag(NumConstant.ONE); + this.update(draftDTO); + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml index 488e2fe7cd..5f3473a3b7 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml @@ -2,5 +2,36 @@ + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleOperateRecordDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleOperateRecordDao.xml index 7b47ccdac5..2b80096293 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleOperateRecordDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleOperateRecordDao.xml @@ -3,5 +3,18 @@ - + + \ No newline at end of file From 962c235ba833c6568358e809c0d77ca09c429cbc Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 3 Jun 2020 11:00:58 +0800 Subject: [PATCH 12/54] =?UTF-8?q?=E5=86=B2=E7=AA=81=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/ArticleController.java | 6 +++++- .../src/main/java/com/epmet/service/ArticleService.java | 2 +- .../java/com/epmet/service/impl/ArticleServiceImpl.java | 3 +-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 97923ebebd..91d8def2a4 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -30,11 +30,15 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.ArticleDTO; +import com.epmet.dto.form.ArticleOperationFormDTO; import com.epmet.dto.form.DraftContentFromDTO; +import com.epmet.dto.form.GovArticleDetailFormDTO; import com.epmet.dto.result.ArticleGridResultDTO; +import com.epmet.dto.result.ArticleOperationResultDTO; +import com.epmet.dto.result.GovArticleDetailResultDTO; import com.epmet.excel.ArticleExcel; -import com.epmet.service.ArticleService; import com.epmet.service.ArticleOperateRecordService; +import com.epmet.service.ArticleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index f25628422f..fa4482b97d 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -23,6 +23,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.ArticleDTO; import com.epmet.dto.form.DraftContentFromDTO; import com.epmet.dto.result.ArticleGridResultDTO; +import com.epmet.dto.result.GovArticleDetailResultDTO; import com.epmet.entity.ArticleEntity; import java.util.List; @@ -112,7 +113,6 @@ public interface ArticleService extends BaseService { * @return */ String saveOrUpdateContent(TokenDto tokenDto, DraftContentFromDTO fromDTO); - String saveOrUpdateContent(DraftContentFromDTO fromDTO); /** * 政府端:(已发布、已下线)文章详情 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 b3185e8d76..ae8f83582d 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 @@ -38,7 +38,6 @@ import com.epmet.dto.ArticleDTO; import com.epmet.dto.feign.GovOrgSelfFeignClient; import com.epmet.dto.form.DraftContentFromDTO; import com.epmet.dto.result.ArticleGridResultDTO; -import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.dto.result.GovArticleContentDTO; import com.epmet.dto.result.GovArticleDetailResultDTO; import com.epmet.entity.ArticleEntity; @@ -196,7 +195,7 @@ public class ArticleServiceImpl extends BaseServiceImpl Date: Wed, 3 Jun 2020 11:26:00 +0800 Subject: [PATCH 13/54] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF=E5=B7=B2?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E5=88=97=E8=A1=A8=E9=A1=B5-=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=85=B3=E8=81=94=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/RedisUtils.java | 14 ++++++++ .../dto/form/CorrelationTagListFormDto.java | 23 +++++++++++++ .../epmet/dto/form/ResiTagListFormDto.java | 6 ++++ .../result/CorrelationTagListResultDto.java | 27 ++++++++++++++++ .../com/epmet/controller/TagController.java | 24 +++++++++++++- .../main/java/com/epmet/redis/TagRedis.java | 32 +++++++++++++++++-- .../java/com/epmet/service/TagService.java | 11 +++++++ .../service/impl/ArticleServiceImpl.java | 6 ---- .../epmet/service/impl/TagServiceImpl.java | 18 +++++++++-- .../epmet/dto/form/ResiTagListFormDto.java | 6 +++- .../epmet/controller/ArticleController.java | 2 ++ 11 files changed, 156 insertions(+), 13 deletions(-) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDto.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDto.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java index c51a4458ac..e8cec08991 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java @@ -274,4 +274,18 @@ public class RedisUtils { public Set zRevRange(String key, long start, long end) { return redisTemplate.opsForZSet().reverseRange(key, start, end); } + + /** + * @Description 获取key集合与多个集合的并集 + * @param key + * @param otherKeys + * @author zxc + */ + public Set sUnion(String key, Collection otherKeys) { + return redisTemplate.opsForSet().union(key, otherKeys); + } + + public Set sMembers(String key){ + return redisTemplate.opsForSet().members(key); + } } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDto.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDto.java new file mode 100644 index 0000000000..7e8a638a28 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDto.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/3 9:39 + */ +@Data +public class CorrelationTagListFormDto implements Serializable { + + private static final long serialVersionUID = -1588825995685146967L; + + /** + * 标签id集合 + */ + private List tagIdList; + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java index b63fa61a8f..6c31e69e71 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -13,9 +14,14 @@ import java.io.Serializable; public class ResiTagListFormDto implements Serializable { private static final long serialVersionUID = 4337657473061285656L; + + public interface ResiTagListForm{} + public interface ResiTagListFormWeb extends CustomerClientShowGroup{} + /** * 网格id */ + @NotBlank(message = "网格id不能为空",groups = {ResiTagListForm.class,ResiTagListFormWeb.class}) private String gridId; /** diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDto.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDto.java new file mode 100644 index 0000000000..51307547c7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDto.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/3 9:41 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@Data +public class CorrelationTagListResultDto implements Serializable { + + private static final long serialVersionUID = 5536953304816455733L; + + /** + * 标签id + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java index b7e0a0b73f..d672d4f7d5 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java @@ -3,11 +3,15 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.CorrelationTagListFormDto; import com.epmet.dto.form.ResiTagListFormDto; +import com.epmet.dto.result.CorrelationTagListResultDto; import com.epmet.dto.result.TagInfoResultDto; import com.epmet.service.TagService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -27,12 +31,30 @@ public class TagController { */ @PostMapping("taglist") public Result> tagList(@LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(tokenDto); return new Result>().ok(tagService.tagList(tokenDto)); } + /** + * @Description 已发布列表页的标签——居民端 + * @param formDto + * @author zxc + */ @PostMapping("resitaglist") - public Result> resiTagList(@LoginUser ResiTagListFormDto formDto){ + public Result> resiTagList(@RequestBody ResiTagListFormDto formDto){ + ValidatorUtils.validateEntity(formDto, ResiTagListFormDto.ResiTagListForm.class, ResiTagListFormDto.ResiTagListFormWeb.class); return new Result>().ok(tagService.resiTagList(formDto)); } + /** + * @Description 已发布列表页-获取关联标签——政府端 + * @param tokenDto + * @param formDto + * @author zxc + */ + @PostMapping("correlationtaglist") + public Result> correlationTagList(@LoginUser TokenDto tokenDto, @RequestBody CorrelationTagListFormDto formDto){ + return new Result>().ok(tagService.correlationTagList(tokenDto,formDto)); + } + } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java index 143a86df45..5d16236d83 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java @@ -22,12 +22,15 @@ import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.constant.TagConstant; +import com.epmet.dto.form.CorrelationTagListFormDto; +import com.epmet.dto.result.CorrelationTagListResultDto; import com.epmet.dto.result.TagInfoResultDto; import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import java.util.Set; @@ -44,10 +47,35 @@ public class TagRedis { } - public String get(String id){ - return null; + public List get(String customerId, CorrelationTagListFormDto formDto){ + List tagIdList = formDto.getTagIdList(); + Set objects ; + Collection keys = new ArrayList<>(); + if (tagIdList.size() > 1){ + for (int i = NumConstant.ONE; i < tagIdList.size(); i++) { + String tagId = tagIdList.get(i); + tagId = TagConstant.GOV_RETAG_KEY+customerId+TagConstant.COLON+tagId; + keys.add(tagId); + } + String key = TagConstant.GOV_RETAG_KEY+customerId+TagConstant.COLON+tagIdList.get(0); + objects = redisUtils.sUnion(key, keys); + }else { + String key = TagConstant.GOV_RETAG_KEY+customerId+TagConstant.COLON+tagIdList.get(0); + objects = redisUtils.sMembers(key); + } + List resultList = new ArrayList<>(); + if (objects.size()==NumConstant.ZERO){ + return resultList; + } + ObjectMapper objectMapper = new ObjectMapper(); + for (Object object : objects) { + CorrelationTagListResultDto correlationTag = objectMapper.convertValue(object, CorrelationTagListResultDto.class); + resultList.add(correlationTag); + } + return resultList; } + /** * @Description 获取标签(政府端),按使用次数倒叙 * @param key == customerId diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagService.java index 10f325e9d3..b0c4bcf534 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagService.java @@ -2,8 +2,11 @@ package com.epmet.service; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.CorrelationTagListFormDto; import com.epmet.dto.form.ResiTagListFormDto; +import com.epmet.dto.result.CorrelationTagListResultDto; import com.epmet.dto.result.TagInfoResultDto; +import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @@ -23,4 +26,12 @@ public interface TagService { */ List resiTagList( ResiTagListFormDto formDto); + /** + * @Description 已发布列表页-获取关联标签——政府端 + * @param tokenDto + * @param formDto + * @author zxc + */ + List correlationTagList(TokenDto tokenDto, CorrelationTagListFormDto formDto); + } \ No newline at end of file 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 5673e523c7..ae8f83582d 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 @@ -68,12 +68,6 @@ public class ArticleServiceImpl extends BaseServiceImpl resiTagList(ResiTagListFormDto formDto) { + //校验 在本网格是否发布过文章 Integer articleCounts = articleDao.checkPublishArticle(formDto); if (articleCounts== NumConstant.ZERO){ return new ArrayList<>(); } return tagRedis.zGridRevRange(formDto.getGridId()); } + + /** + * @Description 已发布列表页-获取关联标签——政府端 + * @param tokenDto + * @param formDto + * @author zxc + */ + @Override + public List correlationTagList(TokenDto tokenDto, CorrelationTagListFormDto formDto) { + String customerId = tokenDto.getCustomerId(); + return tagRedis.get(customerId,formDto); + } } \ No newline at end of file diff --git a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java index 1c7de733b7..6a084c31b3 100644 --- a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java +++ b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -13,10 +14,13 @@ import java.io.Serializable; public class ResiTagListFormDto implements Serializable { private static final long serialVersionUID = -794399801200532922L; + public interface ResiTagList{} + public interface ResiTagListWeb extends CustomerClientShowGroup {} + /** * 网格id */ - @NotBlank(message = "网格id不能为空") + @NotBlank(message = "网格id不能为空",groups = {ResiTagList.class,ResiTagListWeb.class}) private String gridId; /** diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 68cd236d45..3fa602cfea 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -3,6 +3,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.ResiTagListFormDto; import com.epmet.dto.result.TagInfoResultDto; import com.epmet.service.ArticleService; @@ -28,6 +29,7 @@ public class ArticleController { */ @PostMapping("taglist") public Result> resiTagList(@LoginUser TokenDto tokenDto, @RequestBody ResiTagListFormDto formDto){ + ValidatorUtils.validateEntity(formDto, ResiTagListFormDto.ResiTagList.class, ResiTagListFormDto.ResiTagListWeb.class); return new Result>().ok(articleService.resiTagList(tokenDto,formDto)); } From 50330344da1039917e94de5d54f88afdd45e72d5 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Wed, 3 Jun 2020 12:57:10 +0800 Subject: [PATCH 14/54] =?UTF-8?q?feign=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java | 3 ++- .../src/main/java/com/epmet/feign/EpmetUserFeignClient.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java index aa60bb70f0..dd71cfc082 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java @@ -17,7 +17,8 @@ import java.util.List; * @CreateTime 2020/6/2 16:05 * , url = "localhost:8105" */ -@FeignClient(name = ServiceConstant.GOV_VOICE_SERVER, fallback = GovVoiceFeignClientFallBack.class, url = "localhost:8105") +//@FeignClient(name = ServiceConstant.GOV_VOICE_SERVER, fallback = GovVoiceFeignClientFallBack.class, url = "localhost:8105") +@FeignClient(name = ServiceConstant.GOV_VOICE_SERVER, fallback = GovVoiceFeignClientFallBack.class) public interface GovVoiceFeignClient { /** diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index d9b27309bc..d2a289864f 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -14,7 +14,8 @@ import org.springframework.web.bind.annotation.RequestBody; * @CreateTime 2020/6/2 14:05 * , url = "localhost:8087" */ -@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallBack.class, url = "localhost:8087") +//@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallBack.class, url = "localhost:8087") +@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallBack.class) public interface EpmetUserFeignClient { /** From ae1b0ee5f27695826db3d73b4adaeddc0c6f730f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 3 Jun 2020 13:55:17 +0800 Subject: [PATCH 15/54] =?UTF-8?q?=E7=BC=96=E8=BE=91=E8=8D=89=E7=A8=BF?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=8D=89=E7=A8=BF=E6=96=87=E7=AB=A0=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E3=80=81=E8=8E=B7=E5=8F=96=E8=8D=89=E7=A8=BF=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/enums/RequirePermissionEnum.java | 1 + .../epmet/dto/form/DraftDetailFormDTO.java | 25 +++++++++++ .../dto/result/DraftContentDetailDTO.java | 45 +++++++++++++++++++ .../dto/result/DraftContentResultDTO.java | 30 +++++++++++++ .../epmet/controller/ArticleController.java | 33 ++++++++++++++ .../src/main/java/com/epmet/dao/DraftDao.java | 20 ++++++++- .../java/com/epmet/service/DraftService.java | 11 +++++ .../epmet/service/impl/DraftServiceImpl.java | 7 +++ .../src/main/resources/mapper/DraftDao.xml | 37 ++++++++++++++- 9 files changed, 207 insertions(+), 2 deletions(-) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftDetailFormDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentDetailDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentResultDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java index 61f64d7168..05b505594b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java @@ -100,6 +100,7 @@ public enum RequirePermissionEnum { WORK_PARTY_VOICE_PUBLISHED_LIST("work_party_voice_published_list", "党建声音:已发布列表", "已发布文章列表查询"), WORK_PARTY_VOICE_DETAIL("work_party_voice_detail", "党建声音:文章详情", "已发布详情、已下线详情"), WORK_PARTY_VOICE_DRAFT_LIST("work_party_voice_draft_list", "党建声音:草稿箱列表", "草稿箱列表"), + WORK_PARTY_VOICE_DRAFT_EDIT("work_party_voice_draft_edit", "党建声音:编辑草稿", "编辑草稿"), WORK_PARTY_VOICE_DRAFT_DELETE("work_party_voice_draft_delete", "党建声音:删除草稿", "删除草稿"), WORK_PARTY_VOICE_OFFLINE_LIST("work_party_voice_offline_list", "党建声音:已下线列表", "已下线文章列表"), WORK_PARTY_VOICE_PUBLISH("work_party_voice_publish", "党建声音:创建文章", ""), diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftDetailFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftDetailFormDTO.java new file mode 100644 index 0000000000..2fed15dcf8 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftDetailFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 编辑草稿-获取草稿内容、属性统一入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/3 12:58 + */ +@Data +public class DraftDetailFormDTO implements Serializable { + private static final long serialVersionUID = 4492335656284426299L; + + public interface AddUserInternalGroup {} + + /** + * 草稿ID + */ + @NotBlank(message = "草稿id不能为空", groups = {DraftDetailFormDTO.AddUserInternalGroup.class}) + private String draftId; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentDetailDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentDetailDTO.java new file mode 100644 index 0000000000..d10f71c8a2 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentDetailDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/3 13:14 + */ +@Data +public class DraftContentDetailDTO implements Serializable { + private static final long serialVersionUID = -415892498226389295L; + /** + *内容Id + */ + private String id; + + /** + * 具体内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 内容序号 + */ + private Integer orderNum; + + /** + * 审核状态 通过:pass;失败:fail + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentResultDTO.java new file mode 100644 index 0000000000..57951c0016 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/3 13:01 + */ +@Data +public class DraftContentResultDTO implements Serializable { + private static final long serialVersionUID = -1310987373261903935L; + /** + * + */ + private String draftId; + /** + * 标题 + */ + private String title; + /** + * 内容 + */ + private List contentList; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 91d8def2a4..1ed4be825c 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -32,13 +32,16 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.ArticleDTO; import com.epmet.dto.form.ArticleOperationFormDTO; import com.epmet.dto.form.DraftContentFromDTO; +import com.epmet.dto.form.DraftDetailFormDTO; import com.epmet.dto.form.GovArticleDetailFormDTO; import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.dto.result.ArticleOperationResultDTO; +import com.epmet.dto.result.DraftContentResultDTO; import com.epmet.dto.result.GovArticleDetailResultDTO; import com.epmet.excel.ArticleExcel; import com.epmet.service.ArticleOperateRecordService; import com.epmet.service.ArticleService; +import com.epmet.service.DraftService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -61,6 +64,8 @@ public class ArticleController { private ArticleService articleService; @Autowired private ArticleOperateRecordService articleOperateRecordService; + @Autowired + private DraftService draftService; @GetMapping("page") public Result> page(@RequestParam Map params){ @@ -157,4 +162,32 @@ public class ArticleController { return new Result().ok(articleDetail); } + /** + * @param formDTO 草稿id + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei@elink-cn.com + * @description 政府端:选中草稿编辑,获取草稿内容 + * @date 2020/6/3 13:18 + **/ + @PostMapping("getcontent") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_EDIT) + public Result getContent(@RequestBody DraftDetailFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); + DraftContentResultDTO draftContent=draftService.queryDraftContent(formDTO.getDraftId()); + return new Result().ok(draftContent); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei@elink-cn.com + * @description 政府端:选中草稿编辑,获取草稿属性 + * @date 2020/6/3 13:51 + **/ + @PostMapping("getattr") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_EDIT) + public Result getAttr(@RequestBody DraftDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); + return new Result(); + } } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java index 53ecc6e594..f2b4309256 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java @@ -18,9 +18,13 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.DraftContentDetailDTO; +import com.epmet.dto.result.DraftContentResultDTO; import com.epmet.entity.DraftEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 草稿表 * @@ -29,5 +33,19 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface DraftDao extends BaseDao { - + /** + * 政府端查询草稿内容详情 + * + * @param draftId + * 草稿id + */ + DraftContentResultDTO selectDraftContent(String draftId); + + /** + * 政府端查询草稿内容详情 + * + * @param draftId + * 草稿id + */ + List selectDraftContentDetail(String draftId); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java index 36a9fc1b57..de1944c3db 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.DraftDTO; import com.epmet.dto.form.DeleteDraftFormDTO; +import com.epmet.dto.result.DraftContentResultDTO; import com.epmet.entity.DraftEntity; import java.util.List; @@ -102,4 +103,14 @@ public interface DraftService extends BaseService { * @date 2020/6/2 16:09 **/ void deleteDraft(DeleteDraftFormDTO formDTO); + + /** + * 政府端:选中草稿编辑,获取草稿内容 + * + * @param draftId + * @return com.epmet.dto.result.DraftContentResultDTO + * @author yinzuomei@elink-cn.com + * @date 2020-06-03 + */ + DraftContentResultDTO queryDraftContent(String draftId); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java index 000a4d9b83..6220d111d9 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java @@ -28,6 +28,7 @@ import com.epmet.constant.DraftConstant; import com.epmet.dao.DraftDao; import com.epmet.dto.DraftDTO; import com.epmet.dto.form.DeleteDraftFormDTO; +import com.epmet.dto.result.DraftContentResultDTO; import com.epmet.entity.DraftEntity; import com.epmet.redis.DraftRedis; import com.epmet.service.DraftService; @@ -118,4 +119,10 @@ public class DraftServiceImpl extends BaseServiceImpl imp this.update(draftDTO); } + @Override + public DraftContentResultDTO queryDraftContent(String draftId) { + DraftContentResultDTO draftContentResultDTO=baseDao.selectDraftContent(draftId); + return draftContentResultDTO; + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml index 1ba9e7524c..46f3b12971 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml @@ -2,6 +2,41 @@ + + + + + + + + - + + \ No newline at end of file From 0080a253a80f9627e7538adfecf9b5faf40830c0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 3 Jun 2020 14:37:34 +0800 Subject: [PATCH 16/54] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF=EF=BC=9A?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E8=8D=89=E7=A8=BF=E7=BC=96=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=8D=89=E7=A8=BF=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/CoverImgDTO.java | 20 ++++++++++++ .../epmet/dto/result/DraftAttrResultDTO.java | 32 +++++++++++++++++++ .../dto/result/DraftContentDetailDTO.java | 2 +- .../dto/result/DraftContentResultDTO.java | 2 +- .../epmet/controller/ArticleController.java | 10 +++--- 5 files changed, 58 insertions(+), 8 deletions(-) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CoverImgDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftAttrResultDTO.java diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CoverImgDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CoverImgDTO.java new file mode 100644 index 0000000000..5ec196e1df --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CoverImgDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 政府端:选中草稿编辑,获取草稿属性-封面图片 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/3 14:26 + */ +@Data +public class CoverImgDTO implements Serializable { + private static final long serialVersionUID = -6735712590479867385L; + private String coverId; + private String url; + private String auditStatus; + private String auditReason; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftAttrResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftAttrResultDTO.java new file mode 100644 index 0000000000..a169bfa09f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftAttrResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 政府端:选中草稿编辑,获取草稿属性 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/3 14:15 + */ +@Data +public class DraftAttrResultDTO implements Serializable { + private static final long serialVersionUID = 6999941497971286747L; + private String draftId; + private CoverImgDTO coverImg; + private List tagNameList; + private Integer isTop; + private List gridIdList; + private String publisher; + private String publisherName; + @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8") + private Date publishDate; + private String title; + private String publishRangeDesc; + private String tags; + private String publisherType; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentDetailDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentDetailDTO.java index d10f71c8a2..d468ffb81a 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentDetailDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentDetailDTO.java @@ -5,7 +5,7 @@ import lombok.Data; import java.io.Serializable; /** - * 描述一下 + * 政府端:选中草稿编辑,获取草稿内容返参明细 * * @author yinzuomei@elink-cn.com * @date 2020/6/3 13:14 diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentResultDTO.java index 57951c0016..0394760301 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentResultDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentResultDTO.java @@ -6,7 +6,7 @@ import java.io.Serializable; import java.util.List; /** - * 描述一下 + * 政府端:选中草稿编辑,获取草稿内容返参 * * @author yinzuomei@elink-cn.com * @date 2020/6/3 13:01 diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 1ed4be825c..9181c44b61 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -34,10 +34,7 @@ import com.epmet.dto.form.ArticleOperationFormDTO; import com.epmet.dto.form.DraftContentFromDTO; import com.epmet.dto.form.DraftDetailFormDTO; import com.epmet.dto.form.GovArticleDetailFormDTO; -import com.epmet.dto.result.ArticleGridResultDTO; -import com.epmet.dto.result.ArticleOperationResultDTO; -import com.epmet.dto.result.DraftContentResultDTO; -import com.epmet.dto.result.GovArticleDetailResultDTO; +import com.epmet.dto.result.*; import com.epmet.excel.ArticleExcel; import com.epmet.service.ArticleOperateRecordService; import com.epmet.service.ArticleService; @@ -186,8 +183,9 @@ public class ArticleController { **/ @PostMapping("getattr") @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_EDIT) - public Result getAttr(@RequestBody DraftDetailFormDTO formDTO) { + public Result getAttr(@RequestBody DraftDetailFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); - return new Result(); + DraftAttrResultDTO draftAttrResultDTO=new DraftAttrResultDTO(); + return new Result().ok(draftAttrResultDTO); } } \ No newline at end of file From 0cfb04b5dcdab43986ebb63e1f43fd857f94de65 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 3 Jun 2020 14:59:20 +0800 Subject: [PATCH 17/54] =?UTF-8?q?=E5=85=9A=E5=BB=BA=E5=A3=B0=E9=9F=B3-?= =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF-=E4=B8=8B=E7=BA=BF=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E6=8E=A5=E5=8F=A3=E9=A6=96=E6=AC=A1=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/feign/GovOrgSelfFeignClient.java | 10 ++ .../GovOrgSelfFeignClientFallBack.java | 6 + .../controller/CustomerAgencyController.java | 11 ++ .../epmet/service/CustomerAgencyService.java | 8 ++ .../impl/CustomerAgencyServiceImpl.java | 17 +++ .../epmet/dto/form/OffLineArticleFormDTO.java | 35 ++++++ .../com/epmet/constant/ArticleConstant.java | 25 ++++ .../epmet/controller/ArticleController.java | 20 ++- .../com/epmet/dao/ArticlePublishRangeDao.java | 12 +- .../com/epmet/service/ArticleService.java | 9 ++ .../service/impl/ArticleServiceImpl.java | 119 +++++++++++++++--- .../mapper/ArticlePublishRangeDao.xml | 11 +- .../epmet/feign/EpmetUserSelfFeignClient.java | 14 ++- .../EpmetUserSelfFeignClientFallBack.java | 6 + .../controller/CustomerStaffController.java | 11 ++ .../java/com/epmet/dao/CustomerStaffDao.java | 8 ++ .../epmet/service/CustomerStaffService.java | 7 ++ .../impl/CustomerStaffServiceImpl.java | 11 ++ .../resources/mapper/CustomerStaffDao.xml | 10 ++ 19 files changed, 329 insertions(+), 21 deletions(-) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/OffLineArticleFormDTO.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java index 7358d0faed..84e77dc8da 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java @@ -2,6 +2,7 @@ package com.epmet.dto.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.feign.fallback.GovOrgSelfFeignClientFallBack; import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.dto.result.PublishAgencyListResultDTO; @@ -34,4 +35,13 @@ public interface GovOrgSelfFeignClient { **/ @PostMapping(value = "gov/org/customeragency/getpublishagencylist/{staffId}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result getPublishAgencyList(@PathVariable("staffId") String staffId); + + /** + * @param staffId + * @return + * @Author sun + * @Description 根据工作人员Id查询对应的组织信息 + **/ + @PostMapping(value = "gov/org/customeragency/getagencybystaffId/{staffId}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result getAgencyByStaffId(@PathVariable("staffId") String staffId); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java index 655e7359f0..c75f6e9257 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java @@ -3,6 +3,7 @@ package com.epmet.dto.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.feign.GovOrgSelfFeignClient; import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.dto.result.PublishAgencyListResultDTO; @@ -24,4 +25,9 @@ public class GovOrgSelfFeignClientFallBack implements GovOrgSelfFeignClient { public Result getPublishAgencyList(String staffId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getPublishAgencyList", staffId); } + + @Override + public Result getAgencyByStaffId(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyByStaffId", staffId); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 0c254f904d..a5d236f972 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -185,4 +185,15 @@ public class CustomerAgencyController { return new Result().ok(customerAgencyService.getPublishAgencyList(staffId)); } + /** + * @param staffId + * @return + * @Author sun + * @Description 根据工作人员Id查询对应的组织信息 + **/ + @PostMapping("getagencybystaffId/{staffId}") + public Result getAgencyByStaffId(@PathVariable("staffId") String staffId) { + return new Result().ok(customerAgencyService.getAgencyByStaffId(staffId)); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index eaf18432ad..f7aeb9367e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -172,4 +172,12 @@ public interface CustomerAgencyService extends BaseService * @Description 党建声音-政府端-可选发布单位接口调用-根据人员角色查询对应的不同发布单位 **/ PublishAgencyListResultDTO getPublishAgencyList(String staffId); + + /** + * @param staffId + * @return + * @Author sun + * @Description 根据工作人员Id查询对应的组织信息 + **/ + CustomerAgencyDTO getAgencyByStaffId(String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 26ff3d0358..7172d74c7d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -806,4 +806,21 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl gridIdList; + + private String customerId; + + private String staffId; +} + diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java index 308585c78b..4142598634 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java @@ -14,4 +14,29 @@ package com.epmet.constant; * @since 1.0.0 */ public interface ArticleConstant { + + /** + * 发布状态-已发布 + */ + String PUBLISHED = "published"; + /** + * 发布状态-已下线 + */ + String OFFLINE = "offline"; + /** + * 文章发布范围内已全部下线,不能再调用此接口 + */ + String RANGE_DATA_EXCEPTION = "发布范围内无可下线文章"; + /** + * 调用epmet-user服务。查询工作人员基本信息失败 + */ + String SELECT_STAFF_EXCEPTION = "获取用户基本信息失败"; + /** + * 调用gov-org服务。查询工作人员组织信息失败 + */ + String SELECT_AGRNCY_EXCEPTION = "获取用户组织信息失败"; + /** + * 下线文章(用于拼接操作表字段值) + */ + String OFF_LINE_ARTICLE = "下线文章"; } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 98e2df4563..237290994b 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -30,10 +30,7 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.ArticleDTO; -import com.epmet.dto.form.ArticleOperationFormDTO; -import com.epmet.dto.form.DraftContentFromDTO; -import com.epmet.dto.form.DraftDetailFormDTO; -import com.epmet.dto.form.GovArticleDetailFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.dto.result.ArticleOperationResultDTO; @@ -204,4 +201,19 @@ public class ArticleController { return new Result().ok(articleService.publishAgencyList(tokenDTO)); } + /** + * @param tokenDTO formDTO + * @return + * @Author sun + * @Description 党建声音-政府端-下线文章 + **/ + @PostMapping("offlinearticle") + public Result offLineArticle(@LoginUser TokenDto tokenDTO, @RequestBody OffLineArticleFormDTO formDTO) { + formDTO.setCustomerId(tokenDTO.getCustomerId()); + formDTO.setStaffId(tokenDTO.getUserId()); + ValidatorUtils.validateEntity(formDTO, OffLineArticleFormDTO.AddUserInternalGroup.class); + articleService.offLineArticle(formDTO); + return new Result(); + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticlePublishRangeDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticlePublishRangeDao.java index d42919cd95..9b3ef332aa 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticlePublishRangeDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticlePublishRangeDao.java @@ -18,9 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.ArticlePublishRangeDTO; import com.epmet.entity.ArticlePublishRangeEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 文章发布范围表 * @@ -29,5 +32,12 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ArticlePublishRangeDao extends BaseDao { - + + /** + * @param rangeEntity + * @return + * @Author sun + * @Description 根据文章Id查询发布范围数据 + **/ + List selectByArticleId(ArticlePublishRangeEntity rangeEntity); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index 96ed6e62ce..795ad80e6a 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.ArticleDTO; import com.epmet.dto.form.DraftContentFromDTO; +import com.epmet.dto.form.OffLineArticleFormDTO; import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.dto.result.GovArticleDetailResultDTO; import com.epmet.dto.result.PublishAgencyListResultDTO; @@ -132,4 +133,12 @@ public interface ArticleService extends BaseService { * @Description 党建声音-政府端-可选发布单位 **/ PublishAgencyListResultDTO publishAgencyList(TokenDto tokenDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 党建声音-政府端-下线文章 + **/ + void offLineArticle(OffLineArticleFormDTO formDTO); } \ No newline at end of file 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 e67c769305..49edce1a78 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 @@ -31,20 +31,26 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.constant.ArticleConstant; import com.epmet.dao.ArticleDao; +import com.epmet.dao.ArticlePublishRangeDao; import com.epmet.dao.DraftContentDao; import com.epmet.dao.DraftDao; import com.epmet.dto.ArticleDTO; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.feign.GovOrgSelfFeignClient; import com.epmet.dto.form.DraftContentFromDTO; +import com.epmet.dto.form.OffLineArticleFormDTO; import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.dto.result.GovArticleContentDTO; import com.epmet.dto.result.GovArticleDetailResultDTO; import com.epmet.dto.result.PublishAgencyListResultDTO; -import com.epmet.entity.ArticleEntity; -import com.epmet.entity.DraftContentEntity; -import com.epmet.entity.DraftEntity; +import com.epmet.entity.*; +import com.epmet.feign.EpmetUserSelfFeignClient; import com.epmet.redis.ArticleRedis; +import com.epmet.service.ArticleOperateRecordService; +import com.epmet.service.ArticlePublishRangeService; import com.epmet.service.ArticleService; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; @@ -55,6 +61,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.*; +import java.util.concurrent.atomic.AtomicBoolean; /** * 文章表 @@ -73,6 +80,14 @@ public class ArticleServiceImpl extends BaseServiceImpl page(Map params) { @@ -137,17 +152,6 @@ public class ArticleServiceImpl extends BaseServiceImpl result = govOrgSelfFeignClient.getAgencyGridList(tokenDTO.getUserId()); return result.getData(); } - /** - * @param tokenDTO - * @return - * @Author sun - * @Description 党建声音-政府端-可选发布范围 - **/ - @Override - public ArticleGridResultDTO agencyGridList(TokenDto tokenDTO) { - Result result = govOrgSelfFeignClient.getAgencyGridList(tokenDTO.getUserId()); - return result.getData(); - } /** * @param tokenDTO @@ -254,4 +258,91 @@ public class ArticleServiceImpl extends BaseServiceImpl rangeEntityList = articlePublishRangeDao.selectByArticleId(rangeEntity); + if (null == rangeEntityList || rangeEntityList.size() < NumConstant.ONE) { + throw new RenException(ArticleConstant.RANGE_DATA_EXCEPTION); + } + + //2:批量更新发布范围数据,将前台勾选的文章网格列表数据置为下线状态 + Date date = new Date(); + //还未下线的发布范围列表 + List publishedList = new ArrayList<>(); + //将要下线的发布范围列表 + List offLineList = new ArrayList<>(); + rangeEntityList.forEach(entity -> { + if (entity.getPublishStatus().equals(ArticleConstant.PUBLISHED)) { + //是否下线(true:是) + AtomicBoolean isOffLine = new AtomicBoolean(false); + formDTO.getGridIdList().forEach(gridId -> { + if (entity.getGridId().equals(gridId)) { + isOffLine.set(true); + entity.setOffLineTime(date); + entity.setPublishStatus(ArticleConstant.OFFLINE); + offLineList.add(entity); + } + }); + if (!isOffLine.get()) { + publishedList.add(entity); + } + } + }); + //2.1:批量更新发布范围表数据 + articlePublishRangeService.updateBatchById(offLineList); + + //3:根据是否全部下线更新文章主表数据 + ArticleEntity entity = new ArticleEntity(); + entity.setId(formDTO.getArticleId()); + StringBuffer publishRangeDesc = new StringBuffer(); + if (null == publishedList || publishedList.size() < NumConstant.ONE) { + entity.setStatusFlag(ArticleConstant.OFFLINE); + entity.setOffLineTime(date); + rangeEntityList.forEach(range -> { + publishRangeDesc.append(publishRangeDesc.length() > NumConstant.ZERO ? "、" : ""); + publishRangeDesc.append(range.getAgencyGridName()); + }); + } else { + publishedList.forEach(pub -> { + publishRangeDesc.append(publishRangeDesc.length() > NumConstant.ZERO ? "、" : ""); + publishRangeDesc.append(pub.getAgencyGridName()); + }); + } + entity.setPublishRangeDesc(publishRangeDesc.toString()); + baseDao.updateById(entity); + + //4:文章操作记录表新增数据 + //4.1:调用epmet-user服务,查询工作人员信息 + Result resultStaff = epmetUserSelfFeignClient.getCustomerStaff(formDTO.getStaffId()); + if (null == resultStaff.getData()) { + throw new RenException(ArticleConstant.SELECT_STAFF_EXCEPTION); + } + CustomerStaffDTO staffDTO = resultStaff.getData(); + //4.2:调用gov-org服务,查询当前人员所属组织机构信息 + Result resultAgency = govOrgSelfFeignClient.getAgencyByStaffId(formDTO.getStaffId()); + if (null == resultAgency.getData()) { + throw new RenException(ArticleConstant.SELECT_AGRNCY_EXCEPTION); + } + CustomerAgencyDTO agencyDTO = resultAgency.getData(); + //4.3:新增操作表数据 + ArticleOperateRecordEntity recordEntity = new ArticleOperateRecordEntity(); + recordEntity.setCustomerId(formDTO.getCustomerId()); + recordEntity.setArticleId(formDTO.getArticleId()); + recordEntity.setOpUser(agencyDTO.getOrganizationName() + "-" + staffDTO.getRealName()); + recordEntity.setContent(recordEntity.getOpUser() + ArticleConstant.OFF_LINE_ARTICLE); + recordEntity.setOpType(ArticleConstant.OFFLINE); + recordEntity.setOpTime(date); + articleOperateRecordService.insert(recordEntity); + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.xml index 595df8b5ea..ee2fa6bf60 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.xml @@ -3,5 +3,14 @@ - + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserSelfFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserSelfFeignClient.java index 1a944da826..d025f8e360 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserSelfFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserSelfFeignClient.java @@ -2,11 +2,14 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.form.CustomerStaffRoleListFormDTO; import com.epmet.dto.result.CustomerStaffRoleListResultDTO; import com.epmet.feign.fallback.EpmetUserSelfFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @@ -24,6 +27,15 @@ public interface EpmetUserSelfFeignClient { * @Description 根据客户Id和staffId查询一个员工在指定客户下的角色列表 **/ @PostMapping("/epmetuser/staffrole/getcustomerstaffrolelist") - Result> getCustomerStaffRoleList(CustomerStaffRoleListFormDTO formDTO); + Result> getCustomerStaffRoleList(@RequestBody CustomerStaffRoleListFormDTO formDTO); + + /** + * @param staffId + * @return + * @Author sun + * @Description 根据staffId查询工作人员基本信息 + **/ + @PostMapping("/epmetuser/customerstaff/getcustomerstaff/{staffId}") + Result getCustomerStaff(@PathVariable("staffId") String staffId); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserSelfFeignClientFallBack.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserSelfFeignClientFallBack.java index 4f14d7eac4..76b00a6be0 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserSelfFeignClientFallBack.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserSelfFeignClientFallBack.java @@ -3,6 +3,7 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.form.CustomerStaffRoleListFormDTO; import com.epmet.dto.result.CustomerStaffRoleListResultDTO; import com.epmet.feign.EpmetUserSelfFeignClient; @@ -21,4 +22,9 @@ public class EpmetUserSelfFeignClientFallBack implements EpmetUserSelfFeignClien public Result> getCustomerStaffRoleList(CustomerStaffRoleListFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffRoleList", formDTO); } + + @Override + public Result getCustomerStaff(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaff", staffId); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index f77e5deb4d..ca315b6c68 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -273,4 +273,15 @@ public class CustomerStaffController { return new Result().ok(customerStaffService.getCustomerStaffList(staffIdList)); } + /** + * @param staffId + * @return + * @Author sun + * @Description 根据staffId查询工作人员基本信息 + **/ + @PostMapping(value = "getcustomerstaff/{staffId}") + public Result getCustomerStaff(@PathVariable("staffId") String staffId){ + return new Result().ok(customerStaffService.getCustomerStaff(staffId)); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index c5dbec183f..4922683935 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -132,4 +132,12 @@ public interface CustomerStaffDao extends BaseDao { * @Description 根据staffId集合查询工作人员基础信息 **/ List selectStaffByIds(@Param("staffIdList") List staffIdList); + + /** + * @param staffId + * @return + * @Author sun + * @Description 根据staffId查询工作人员基本信息 + **/ + CustomerStaffDTO selectByStaffId(@Param("staffId") String staffId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java index 4f4908cf32..c166c3093f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java @@ -225,4 +225,11 @@ public interface CustomerStaffService extends BaseService { **/ CustomerStaffListResultDTO getCustomerStaffList(List staffIdList); + /** + * @param staffId + * @return + * @Author sun + * @Description 根据staffId查询工作人员基本信息 + **/ + CustomerStaffDTO getCustomerStaff(String staffId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index ba47befa3f..be1796082c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -424,4 +424,15 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl + + \ No newline at end of file From c7baee6f298c136263b022c7fddef5054489da76 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 3 Jun 2020 15:18:40 +0800 Subject: [PATCH 18/54] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF=EF=BC=9A?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E8=8D=89=E7=A8=BF=E7=BC=96=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=8D=89=E7=A8=BF=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/CoverImgDTO.java | 15 ++++++ .../epmet/dto/result/DraftAttrResultDTO.java | 53 +++++++++++++++++-- .../epmet/controller/ArticleController.java | 4 +- .../src/main/java/com/epmet/dao/DraftDao.java | 26 +++++++++ .../java/com/epmet/service/DraftService.java | 16 +++++- .../epmet/service/impl/DraftServiceImpl.java | 27 ++++++++-- .../src/main/resources/mapper/DraftDao.xml | 49 ++++++++++++++++- 7 files changed, 178 insertions(+), 12 deletions(-) diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CoverImgDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CoverImgDTO.java index 5ec196e1df..d0e8f0f393 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CoverImgDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CoverImgDTO.java @@ -13,8 +13,23 @@ import java.io.Serializable; @Data public class CoverImgDTO implements Serializable { private static final long serialVersionUID = -6735712590479867385L; + /** + * 封面Id + */ private String coverId; + + /** + * 封面url + */ private String url; + + /** + * 审核状态 + */ private String auditStatus; + + /** + * 审核理由 + */ private String auditReason; } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftAttrResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftAttrResultDTO.java index a169bfa09f..3a4e3ab481 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftAttrResultDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftAttrResultDTO.java @@ -1,6 +1,7 @@ package com.epmet.dto.result; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -16,17 +17,63 @@ import java.util.List; @Data public class DraftAttrResultDTO implements Serializable { private static final long serialVersionUID = 6999941497971286747L; + + /** + * 草稿Id + */ private String draftId; + + /** + * 封面图片 + */ private CoverImgDTO coverImg; - private List tagNameList; + + /** + * 标签名称数组, 竖杠分割的标签名称 + */ + private String[] tagNameList; + + /** + * 是否置顶 1是;0 否 + */ private Integer isTop; + + /** + * 网格Id数组 + */ private List gridIdList; + + /** + * 发布单位Id + */ private String publisher; + + /** + * 发布单位名称 + */ private String publisherName; - @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8") + + /** + * 发布日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date publishDate; + + /** + * 标题 + */ private String title; + + /** + * 发布范围拼接的字符串,顿号隔开 + */ private String publishRangeDesc; - private String tags; + + /** + * 机关:agency;部门:department;网格:grid + */ private String publisherType; + + @JsonIgnore + private String tags; } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 9181c44b61..83c11a43be 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -170,7 +170,7 @@ public class ArticleController { @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_EDIT) public Result getContent(@RequestBody DraftDetailFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); - DraftContentResultDTO draftContent=draftService.queryDraftContent(formDTO.getDraftId()); + DraftContentResultDTO draftContent=draftService.queryDraftContent(formDTO); return new Result().ok(draftContent); } @@ -185,7 +185,7 @@ public class ArticleController { @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_EDIT) public Result getAttr(@RequestBody DraftDetailFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); - DraftAttrResultDTO draftAttrResultDTO=new DraftAttrResultDTO(); + DraftAttrResultDTO draftAttrResultDTO=draftService.getDraftAttr(formDTO); return new Result().ok(draftAttrResultDTO); } } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java index f2b4309256..b076f274e1 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java @@ -18,6 +18,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.CoverImgDTO; +import com.epmet.dto.result.DraftAttrResultDTO; import com.epmet.dto.result.DraftContentDetailDTO; import com.epmet.dto.result.DraftContentResultDTO; import com.epmet.entity.DraftEntity; @@ -48,4 +50,28 @@ public interface DraftDao extends BaseDao { * 草稿id */ List selectDraftContentDetail(String draftId); + + /** + * 政府端:选中草稿编辑,获取草稿属性 + * + * @param draftId + * 草稿id + */ + DraftAttrResultDTO selectDraftAttr(String draftId); + + /** + * 政府端:选中草稿编辑,获取草稿属性-封面信息 + * + * @param draftId + * 草稿id + */ + CoverImgDTO selectDraftCoverImg(String draftId); + + /** + * 政府端:选中草稿编辑,获取草稿属性-已选择发布网格 + * + * @param draftId + * 草稿id + */ + List selectDraftGrids(String draftId); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java index de1944c3db..704d532cc8 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java @@ -21,6 +21,8 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.DraftDTO; import com.epmet.dto.form.DeleteDraftFormDTO; +import com.epmet.dto.form.DraftDetailFormDTO; +import com.epmet.dto.result.DraftAttrResultDTO; import com.epmet.dto.result.DraftContentResultDTO; import com.epmet.entity.DraftEntity; @@ -107,10 +109,20 @@ public interface DraftService extends BaseService { /** * 政府端:选中草稿编辑,获取草稿内容 * - * @param draftId + * @param formDTO + * @return com.epmet.dto.result.DraftContentResultDTO + * @author yinzuomei@elink-cn.com + * @date 2020-06-03 + */ + DraftContentResultDTO queryDraftContent(DraftDetailFormDTO formDTO); + + /** + * 政府端:选中草稿编辑,获取草稿属性 + * + * @param formDTO * @return com.epmet.dto.result.DraftContentResultDTO * @author yinzuomei@elink-cn.com * @date 2020-06-03 */ - DraftContentResultDTO queryDraftContent(String draftId); + DraftAttrResultDTO getDraftAttr(DraftDetailFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java index 6220d111d9..80b8e4fa21 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java @@ -20,14 +20,17 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.constant.DraftConstant; import com.epmet.dao.DraftDao; import com.epmet.dto.DraftDTO; import com.epmet.dto.form.DeleteDraftFormDTO; +import com.epmet.dto.form.DraftDetailFormDTO; +import com.epmet.dto.result.CoverImgDTO; +import com.epmet.dto.result.DraftAttrResultDTO; import com.epmet.dto.result.DraftContentResultDTO; import com.epmet.entity.DraftEntity; import com.epmet.redis.DraftRedis; @@ -120,9 +123,27 @@ public class DraftServiceImpl extends BaseServiceImpl imp } @Override - public DraftContentResultDTO queryDraftContent(String draftId) { - DraftContentResultDTO draftContentResultDTO=baseDao.selectDraftContent(draftId); + public DraftContentResultDTO queryDraftContent(DraftDetailFormDTO formDTO) { + DraftContentResultDTO draftContentResultDTO = baseDao.selectDraftContent(formDTO.getDraftId()); return draftContentResultDTO; } + @Override + public DraftAttrResultDTO getDraftAttr(DraftDetailFormDTO formDTO) { + DraftAttrResultDTO draftAttrResultDTO = baseDao.selectDraftAttr(formDTO.getDraftId()); + if (null != draftAttrResultDTO) { + CoverImgDTO coverImgDTO = baseDao.selectDraftCoverImg(formDTO.getDraftId()); + List gridIdList = baseDao.selectDraftGrids(formDTO.getDraftId()); + draftAttrResultDTO.setCoverImg(coverImgDTO); + draftAttrResultDTO.setGridIdList(gridIdList); + if (StringUtils.isNoneBlank(draftAttrResultDTO.getTags())) { + String[] tagNames = draftAttrResultDTO.getTags().split("\\|"); + draftAttrResultDTO.setTagNameList(tagNames); + } + } else { + logger.error(String.format("查询草稿属性失败,草稿id=%s", formDTO.getDraftId())); + } + return draftAttrResultDTO; + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml index 46f3b12971..e992fe31b1 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml @@ -12,7 +12,7 @@ SELECT - dc.id, + dc.ID, dc.CONTENT, dc.CONTENT_TYPE, dc.ORDER_NUM, @@ -39,4 +39,49 @@ ORDER BY dc.ORDER_NUM ASC + + + + + + + + + \ No newline at end of file From 46b5d35ea8cf74ccc86028641b8619bd05911180 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 3 Jun 2020 15:46:05 +0800 Subject: [PATCH 19/54] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E8=8D=89=E7=A8=BF?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E6=8E=A5=E5=8F=A3=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/DraftAttrFromDTO.java | 76 ++++++++ .../epmet/controller/ArticleController.java | 13 +- .../com/epmet/service/ArticleService.java | 9 + .../service/impl/ArticleServiceImpl.java | 180 +++++++++++++++--- .../resources/migration/epmet_gov_voice.sql | 26 +-- .../java/com/epmet/ArticleServiceTest.java | 24 ++- 6 files changed, 287 insertions(+), 41 deletions(-) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java new file mode 100644 index 0000000000..a2640f520c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 文章属性form + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class DraftAttrFromDTO implements Serializable { + + + private static final long serialVersionUID = 6463906402283515172L; + /** + * 草稿ID + */ + private String draftId; + + /** + * 封面图片地址 + */ + private String coverImg; + + /** + * 标签名称数组 + */ + private List tagNameList; + + /** + * 是否置顶 + */ + private Integer isTop; + + /** + * 网格Id数组 + */ + private List gridIdList; + + /** + * 发布单位Id 类型不同 id含义不同 + */ + private String publisher; + + /** + * 发布日期 + */ + private String publishDate; + + /** + * 发布者类型 机关:agency;发布类型 部门:department;网格:grid + */ + private String publisherType; +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 881c065acd..98d1a0411c 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -120,7 +120,7 @@ public class ArticleController { } /** - * desc:保存或修改文章内容 + * desc:保存或修改草稿内容 * @param fromDTO * @throws Exception */ @@ -216,4 +216,15 @@ public class ArticleController { return new Result(); } + /** + * desc:保存草稿属性 + * @param fromDTO + * @throws Exception + */ + @GetMapping("saveattr") + public Result saveOrUpdateAttr(@LoginUser TokenDto tokenDto,@RequestBody DraftAttrFromDTO fromDTO) throws Exception { + Boolean isSuccess = articleService.saveOrUpdateAttr(tokenDto, fromDTO); + return new Result().ok(isSuccess); + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index 795ad80e6a..e4c6ea9451 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.ArticleDTO; +import com.epmet.dto.form.DraftAttrFromDTO; import com.epmet.dto.form.DraftContentFromDTO; import com.epmet.dto.form.OffLineArticleFormDTO; import com.epmet.dto.result.ArticleGridResultDTO; @@ -141,4 +142,12 @@ public interface ArticleService extends BaseService { * @Description 党建声音-政府端-下线文章 **/ void offLineArticle(OffLineArticleFormDTO formDTO); + + /** + * desc:保存或修改文章属性 + * @param tokenDto + * @param fromDTO + * @return + */ + Boolean saveOrUpdateAttr(TokenDto tokenDto, DraftAttrFromDTO fromDTO); } \ No newline at end of file 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 49edce1a78..0fd775e6e0 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 @@ -27,34 +27,30 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.constant.ArticleConstant; -import com.epmet.dao.ArticleDao; -import com.epmet.dao.ArticlePublishRangeDao; -import com.epmet.dao.DraftContentDao; -import com.epmet.dao.DraftDao; +import com.epmet.constant.DraftConstant; +import com.epmet.dao.*; import com.epmet.dto.ArticleDTO; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.feign.GovOrgSelfFeignClient; +import com.epmet.dto.form.DraftAttrFromDTO; import com.epmet.dto.form.DraftContentFromDTO; import com.epmet.dto.form.OffLineArticleFormDTO; -import com.epmet.dto.result.ArticleGridResultDTO; -import com.epmet.dto.result.GovArticleContentDTO; -import com.epmet.dto.result.GovArticleDetailResultDTO; -import com.epmet.dto.result.PublishAgencyListResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.*; import com.epmet.feign.EpmetUserSelfFeignClient; import com.epmet.redis.ArticleRedis; import com.epmet.service.ArticleOperateRecordService; import com.epmet.service.ArticlePublishRangeService; import com.epmet.service.ArticleService; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -62,6 +58,7 @@ import org.springframework.util.CollectionUtils; import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.stream.Collectors; /** * 文章表 @@ -69,9 +66,9 @@ import java.util.concurrent.atomic.AtomicBoolean; * @author generator generator@elink-cn.com * @since v1.0.0 2020-06-02 */ +@Slf4j @Service public class ArticleServiceImpl extends BaseServiceImpl implements ArticleService { - private final Log logger = LogFactory.getLog(getClass()); @Autowired private ArticleRedis articleRedis; @Autowired @@ -88,6 +85,10 @@ public class ArticleServiceImpl extends BaseServiceImpl page(Map params) { @@ -168,7 +169,7 @@ public class ArticleServiceImpl extends BaseServiceImpl articleContentList = baseDao.queryGovArticleContent(articleId); - articleDetail.setArticleContentList(articleContentList); - } - return articleDetail; - } + public GovArticleDetailResultDTO queryGovArticleDetail(String articleId) { + GovArticleDetailResultDTO articleDetail = baseDao.queryGovArticleDetail(articleId); + if (null != articleDetail) { + List articleContentList = baseDao.queryGovArticleContent(articleId); + articleDetail.setArticleContentList(articleContentList); + } + return articleDetail; + } + + @Override + public Boolean saveOrUpdateAttr(TokenDto tokenDto, DraftAttrFromDTO fromDTO) { + DraftEntity draftEntity = draftDao.selectById(fromDTO.getDraftId()); + if (draftEntity == null) { + log.warn("saveOrUpdateAttr draftId is not exist in db"); + throw new RenException("参数错误"); + } + + //构建标签 + if (!CollectionUtils.isEmpty(fromDTO.getTagNameList())) { + List tagNameList = fromDTO.getTagNameList(); + tagNameList = tagNameList.stream().distinct().collect(Collectors.toList()); + String tagNamesStr = StringUtils.join(tagNameList, "、"); + draftEntity.setTags(tagNamesStr); + } + draftEntity.setIsTop(fromDTO.getIsTop()); + + + + //发布单位 + String publisher = fromDTO.getPublisher(); + String publisherType = fromDTO.getPublisherType(); + //TODO 根据分布类型 获取对应的名称 + + + draftEntity.setPublishDate(DateUtils.stringToDate(fromDTO.getPublishDate(),DateUtils.DATE_PATTERN)); + + //封面 + DraftCoverEntity coverEntity = buildCoverEntity(tokenDto, fromDTO); + //发布范围 + List publishRangeEntityList = buildDraftPublishRange(draftEntity,tokenDto, fromDTO); + + + executeSaveDraftAttr(draftEntity, coverEntity, publishRangeEntityList); + return true; + } + + @Transactional(rollbackFor = Exception.class) + public void executeSaveDraftAttr(DraftEntity draftEntity, DraftCoverEntity coverEntity, List publishRangeEntityList) { + Map draftIdMap = new HashMap<>(); + draftIdMap.put("DRAFT_ID", draftEntity.getId()); + draftCoverDao.deleteByMap(draftIdMap); + draftCoverDao.insert(coverEntity); + + draftPublishRangeDao.deleteByMap(draftIdMap); + if (CollectionUtils.isEmpty(publishRangeEntityList)){ + log.warn("saveOrUpdateAttr publishRangeEntityList is empty"); + throw new RenException("参数错误"); + } + publishRangeEntityList.forEach(publishRange->draftPublishRangeDao.insert(publishRange)); + draftDao.updateById(draftEntity); + } + + private List buildDraftPublishRange(DraftEntity draftEntity, TokenDto tokenDto, DraftAttrFromDTO fromDTO) { + List publishRangeEntityList = new ArrayList<>(); + List agencyGridNameList = new ArrayList<>(); + + ArticleGridResultDTO articleGridResultDTO = agencyGridList(tokenDto); + if (articleGridResultDTO == null) { + log.warn("saveOrUpdateAttr userId:{} have not right access publishRange", tokenDto.getUserId()); + throw new RenException("参数错误"); + } + buildName(tokenDto,agencyGridNameList,publishRangeEntityList, fromDTO, articleGridResultDTO); + buildAgencyGridNames(tokenDto,agencyGridNameList,publishRangeEntityList, fromDTO, articleGridResultDTO); + draftEntity.setPublishRangeDesc(StringUtils.join(agencyGridNameList,"|")); + return publishRangeEntityList; + } + + private DraftCoverEntity buildCoverEntity(TokenDto tokenDto, DraftAttrFromDTO fromDTO) { + String coverImg = fromDTO.getCoverImg(); + DraftCoverEntity coverEntity = new DraftCoverEntity(); + coverEntity.setCustomerId(tokenDto.getCustomerId()); + coverEntity.setDraftId(fromDTO.getDraftId()); + coverEntity.setImgUrl(coverImg); + coverEntity.setAuditStatus(""); + coverEntity.setAuditReason(""); + coverEntity.setRevision(0); + coverEntity.setDelFlag(NumConstant.ZERO_STR); + return coverEntity; + } + + private void buildAgencyGridNames(TokenDto tokenDto, List agencyGridNameList, List publishRangeEntityList, DraftAttrFromDTO fromDTO, ArticleGridResultDTO articleGridResultDTO) { + articleGridResultDTO.getSubAgencyGridList().forEach(subAgencyGrid -> { + buildName(tokenDto,agencyGridNameList, publishRangeEntityList,fromDTO, subAgencyGrid); + }); + if (!CollectionUtils.isEmpty(articleGridResultDTO.getSubAgencyGridList())) { + articleGridResultDTO.getSubAgencyGridList().forEach(subAgencyGrid -> { + buildAgencyGridNames(tokenDto, agencyGridNameList, publishRangeEntityList, fromDTO, subAgencyGrid); + }); + } + } + + public static void main(String[] args) { + String str = "{\"agencyId\":\"1041fe5e8499dbd8add314291d2f6da4\",\"agencyName\":\"省委宣传部\",\"gridList\":[{\"gridId\":\"1\",\"gridName\":\"第一\"},{\"gridId\":\"2\",\"gridName\":\"第二\"}],\"subAgencyGridList\":[{\"agencyId\":\"8f9d9990f9502be0f5158b59fbcba7f9\",\"agencyName\":\"枣庄市\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4\"},{\"agencyId\":\"a03b85699795bf9bd192a1b08ee579b7\",\"agencyName\":\"淄博市\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4\"},{\"agencyId\":\"ae2b16245d52e79bffc81da18882bd52\",\"agencyName\":\"青岛市市委宣传办\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"355c9b2ca286dfc4a12e8ceb0e701cd2\",\"agencyName\":\"莱西市委\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:ae2b16245d52e79bffc81da18882bd52\"},{\"agencyId\":\"f3bc7390a1ce4770ab315e35bf486d26\",\"agencyName\":\"李沧区委\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"3a7a375ebce1ec29a1f4c09598ae4a93\",\"agencyName\":\"大大大街道\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"af65cfe91297f7128553d65be08604b8\",\"agencyName\":\"小小小社区\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:ae2b16245d52e79bffc81da18882bd52:f3bc7390a1ce4770ab315e35bf486d26:3a7a375ebce1ec29a1f4c09598ae4a93\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:ae2b16245d52e79bffc81da18882bd52:f3bc7390a1ce4770ab315e35bf486d26\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:ae2b16245d52e79bffc81da18882bd52\"},{\"agencyId\":\"9a072413f6de9ab2468132716e3c4023\",\"agencyName\":\"平度区委\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:ae2b16245d52e79bffc81da18882bd52\"},{\"agencyId\":\"81ea088d5415b39d87488a45c294881e\",\"agencyName\":\"jiaozhoushiwe胶州市委\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:ae2b16245d52e79bffc81da18882bd52\"},{\"agencyId\":\"f89f1ed4b6b178fe6b1af5acbca751c4\",\"agencyName\":\"崂山区委\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:ae2b16245d52e79bffc81da18882bd52\"},{\"agencyId\":\"c27644b0d4e0b03821df55efae7e8f0e\",\"agencyName\":\"市北市委\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:ae2b16245d52e79bffc81da18882bd52\"},{\"agencyId\":\"1432bbed56c9ba1c8a7ceea04ecd0695\",\"agencyName\":\"市南市委\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:ae2b16245d52e79bffc81da18882bd52\"},{\"agencyId\":\"e07464abe1d2b86c6bd55ac0f8ed8b96\",\"agencyName\":\"黄岛区委\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:ae2b16245d52e79bffc81da18882bd52\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4\"},{\"agencyId\":\"8644222c22ee9e989eff748104785083\",\"agencyName\":\"济南市市委宣传办\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"6980c7edd43f3ebed4770d28c9acd7f5\",\"agencyName\":\"飞飞飞\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083\"},{\"agencyId\":\"03c965e0e5c89e5bf275b53d2a149bf9\",\"agencyName\":\"哈哈哈\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"e6bb0092805119fca932f126b58fcb4a\",\"agencyName\":\"1111\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083:03c965e0e5c89e5bf275b53d2a149bf9\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083\"},{\"agencyId\":\"e2b0cc9f9f30cfeaab6645dcdb75992f\",\"agencyName\":\"快快快\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"4ba9eb65a791932cdaae3ff1fb45a7e3\",\"agencyName\":\"三四十\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083:e2b0cc9f9f30cfeaab6645dcdb75992f\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083\"},{\"agencyId\":\"afb5790c997478df4086bccbb6a1583f\",\"agencyName\":\"市中市委\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"b9e295f8c1906a0d1c5e0b313afcda3f\",\"agencyName\":\"啦啦啦啦\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"3a376fd514af0219c3023905faaac5ac\",\"agencyName\":\"lo咯啦啦啦\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083:afb5790c997478df4086bccbb6a1583f:b9e295f8c1906a0d1c5e0b313afcda3f\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083:afb5790c997478df4086bccbb6a1583f\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083\"},{\"agencyId\":\"f6336c5a9f34b793c1a9aec083261a43\",\"agencyName\":\"济阳市市委\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"3930282aa029a4446f8a3ca25274ed2a\",\"agencyName\":\"啦啦啦啦\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083:f6336c5a9f34b793c1a9aec083261a43\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083\"},{\"agencyId\":\"043d2ecc5ae1766014fdf59743836ce8\",\"agencyName\":\"商河县县委\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083\"},{\"agencyId\":\"8b7d82b8be943adaf82816f4336b87c8\",\"agencyName\":\"平阴区区委\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083\"},{\"agencyId\":\"580701ffcc58e7f867b89727a422adce\",\"agencyName\":\"长青区委\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083\"},{\"agencyId\":\"9a1fefeff0d891209a583c2c62be237c\",\"agencyName\":\"天桥区区委\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"4d562a1dc673e1ea2aa0d76d2799b133\",\"agencyName\":\"泺口街道党委\",\"gridList\":[{\"gridId\":\"9cf7b9ad21c488a4884effb2b342c23d\",\"gridName\":\"第二网格\"},{\"gridId\":\"d5e746de405cb38479fccea3228b0fa4\",\"gridName\":\"黄河公园第一网格\"}],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083:9a1fefeff0d891209a583c2c62be237c\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083\"},{\"agencyId\":\"5a40658e540b0701eb04666930db9f73\",\"agencyName\":\"槐荫区区委\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"c2e4d28be976e6f66828e213daa0f965\",\"agencyName\":\"省立医院西院党委\",\"gridList\":[{\"gridId\":\"b3f5c5464ad3634982116c174b22ee35\",\"gridName\":\"省立西院第一网格\"}],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083:5a40658e540b0701eb04666930db9f73\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4\"}],\"pids\":\"\"}"; + ArticleGridResultDTO articleGridResultDTOS = JSON.parseObject(str, ArticleGridResultDTO.class); + System.out.println(JSON.toJSONString(articleGridResultDTOS)); + List gridIdList = Arrays.asList("1","2","d5e746de405cb38479fccea3228b0fa4"); + List agencyGridNameList = new ArrayList<>(); + List publishRangeEntityList = new ArrayList<>(); + TokenDto tokenDto = new TokenDto(); + tokenDto.setCustomerId("1"); + + DraftAttrFromDTO fromDTO = new DraftAttrFromDTO(); + fromDTO.setGridIdList(gridIdList); + //buildName(tokenDto,agencyGridNameList, publishRangeEntityList,fromDTO, articleGridResultDTOS); + //buildAgencyGridNames(tokenDto,agencyGridNameList,publishRangeEntityList,fromDTO,articleGridResultDTOS); + System.out.println("组织-网格名称:"+JSON.toJSONString(agencyGridNameList)); + System.out.println("publishRangeEntityList:"+JSON.toJSONString(publishRangeEntityList)); + + } + + private void buildName(TokenDto tokenDto, List agencyGridNameList, List publishRangeEntityList, DraftAttrFromDTO fromDTO, ArticleGridResultDTO articleGridResultDTO) { + List gridIdList = fromDTO.getGridIdList(); + List gridList = articleGridResultDTO.getGridList(); + if (!CollectionUtils.isEmpty(gridList)&&!CollectionUtils.isEmpty(gridIdList)) { + gridList.forEach(grid -> { + if (gridIdList.contains(grid.getGridId())) { + String agencyGridName = articleGridResultDTO.getAgencyName().concat("_").concat(grid.getGridName()); + agencyGridNameList.add(agencyGridName); + DraftPublishRangeEntity draftPublishRangeEntity = new DraftPublishRangeEntity(); + draftPublishRangeEntity.setCustomerId(tokenDto.getCustomerId()); + draftPublishRangeEntity.setDraftId(fromDTO.getDraftId()); + draftPublishRangeEntity.setGridId(grid.getGridId()); + draftPublishRangeEntity.setAgencyGridName(agencyGridName); + draftPublishRangeEntity.setOffLineTime(null); + draftPublishRangeEntity.setPublishStatus(DraftConstant.UNPUBLISH); + draftPublishRangeEntity.setRevision(0); + draftPublishRangeEntity.setDelFlag(NumConstant.ZERO_STR); + + publishRangeEntityList.add(draftPublishRangeEntity); + } + }); + } + } /** * desc:构建 内容对象 diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql index 3a38eaa980..a648a84f99 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql @@ -1,4 +1,11 @@ -DROP TABLE tag_default;/*SkipError*/ +/* + Date: 2/06/2020 16:13:38 +*/ + +-- SET NAMES utf8mb4; +-- #SET FOREIGN_KEY_CHECKS = 0; + +CREATE DATABASE `epmet_gov_access` DEFAULT CHARACTER SET utf8mb4; CREATE TABLE tag_default( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , TAG_NAME VARCHAR(32) NOT NULL COMMENT '标签名称' , @@ -12,7 +19,6 @@ CREATE TABLE tag_default( ) COMMENT = '默认标签表 默认标签表'; ALTER TABLE tag_default COMMENT '默认标签表'; -DROP TABLE tag_customer;/*SkipError*/ CREATE TABLE tag_customer( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , @@ -29,7 +35,6 @@ CREATE TABLE tag_customer( ALTER TABLE tag_customer ADD INDEX INX_TAG_NAME(TAG_NAME); ALTER TABLE tag_customer COMMENT '客户标签表'; -DROP TABLE tag_grid;/*SkipError*/ CREATE TABLE tag_grid( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , @@ -47,7 +52,6 @@ CREATE TABLE tag_grid( ) COMMENT = '网格标签表 网格标签表'; ALTER TABLE tag_grid COMMENT '网格标签表'; -DROP TABLE article_tags;/*SkipError*/ CREATE TABLE article_tags( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , @@ -65,14 +69,13 @@ CREATE TABLE article_tags( ALTER TABLE article_tags ADD INDEX IDX_ARTICLE_ID(ARTICLE_ID); ALTER TABLE article_tags COMMENT '文章标签表'; -DROP TABLE draft;/*SkipError*/ CREATE TABLE draft( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , TITLE VARCHAR(128) NOT NULL COMMENT '文章标题' , PREVIEW_CONTENT VARCHAR(512) NOT NULL COMMENT '文章内容 精简内容' , IS_TOP INT NOT NULL COMMENT '是否置顶 1是;0否;' , - PUBLISH_RANGE_DESC VARCHAR(512) NOT NULL COMMENT '发布范围描述 所有发布范围集合' , + PUBLISH_RANGE_DESC VARCHAR(512) NOT NULL COMMENT '发布范围描述 所有发布范围集合,顿号隔开' , PUBLISHER_ID VARCHAR(64) NOT NULL COMMENT '发布单位ID' , PUBLISHER_NAME VARCHAR(128) NOT NULL COMMENT '发布单位名称' , PUBLISHER_TYPE VARCHAR(32) NOT NULL COMMENT '发布单位类型 机关:agency;部门:department;网格:grid' , @@ -93,7 +96,6 @@ CREATE TABLE draft( ) COMMENT = '草稿表 草稿表'; ALTER TABLE draft COMMENT '草稿表'; -DROP TABLE draft_content;/*SkipError*/ CREATE TABLE draft_content( ID VARCHAR(64) NOT NULL COMMENT '主键ID 主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , @@ -113,7 +115,6 @@ CREATE TABLE draft_content( ) COMMENT = '草稿内容表 草稿内容表'; ALTER TABLE draft_content COMMENT '草稿内容表'; -DROP TABLE draft_publish_range;/*SkipError*/ CREATE TABLE draft_publish_range( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , @@ -132,7 +133,6 @@ CREATE TABLE draft_publish_range( ) COMMENT = '草稿发布范围表 草稿发布范围表'; ALTER TABLE draft_publish_range COMMENT '草稿发布范围表'; -DROP TABLE draft_cover;/*SkipError*/ CREATE TABLE draft_cover( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , @@ -150,7 +150,6 @@ CREATE TABLE draft_cover( ) COMMENT = '草稿封面表 草稿封面表'; ALTER TABLE draft_cover COMMENT '草稿封面表'; -DROP TABLE article;/*SkipError*/ CREATE TABLE article( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , @@ -180,7 +179,6 @@ CREATE TABLE article( ) COMMENT = '文章表 正式文章表'; ALTER TABLE article COMMENT '文章表'; -DROP TABLE article_content;/*SkipError*/ CREATE TABLE article_content( ID VARCHAR(64) NOT NULL COMMENT '主键ID 主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , @@ -200,7 +198,6 @@ CREATE TABLE article_content( ) COMMENT = '文章内容表 文章内容表'; ALTER TABLE article_content COMMENT '文章内容表'; -DROP TABLE article_cover;/*SkipError*/ CREATE TABLE article_cover( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , @@ -218,7 +215,6 @@ CREATE TABLE article_cover( ) COMMENT = '文章封面表 文章封面表'; ALTER TABLE article_cover COMMENT '文章封面表'; -DROP TABLE article_publish_range;/*SkipError*/ CREATE TABLE article_publish_range( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , @@ -226,7 +222,7 @@ CREATE TABLE article_publish_range( GRID_ID VARCHAR(64) NOT NULL COMMENT '网格ID' , AGENCY_GRID_NAME VARCHAR(64) NOT NULL COMMENT '组织-网格名称' , OFF_LINE_TIME DATETIME COMMENT '下线时间' , - PUBLISH_STATUS VARCHAR(32) NOT NULL COMMENT '发布状态 未发布:unpublish ;已发布:published' , + PUBLISH_STATUS VARCHAR(32) NOT NULL COMMENT '发布状态 已发布:published;已下线:offline' , DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , REVISION INT NOT NULL COMMENT '乐观锁' , CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , @@ -238,7 +234,6 @@ CREATE TABLE article_publish_range( ALTER TABLE article_publish_range ADD INDEX IDX_ARTICLE_ID(ARTICLE_ID); ALTER TABLE article_publish_range COMMENT '文章发布范围表'; -DROP TABLE article_operate_record;/*SkipError*/ CREATE TABLE article_operate_record( ID VARCHAR(64) NOT NULL COMMENT '主键ID 主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , @@ -257,7 +252,6 @@ CREATE TABLE article_operate_record( ) COMMENT = '文章操作记录表 文章操作记录表'; ALTER TABLE article_operate_record COMMENT '文章操作记录表'; -DROP TABLE article_visit_record;/*SkipError*/ CREATE TABLE article_visit_record( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , diff --git a/epmet-module/gov-voice/gov-voice-server/src/test/java/com/epmet/ArticleServiceTest.java b/epmet-module/gov-voice/gov-voice-server/src/test/java/com/epmet/ArticleServiceTest.java index 6d0903be34..63cdd2b905 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/test/java/com/epmet/ArticleServiceTest.java +++ b/epmet-module/gov-voice/gov-voice-server/src/test/java/com/epmet/ArticleServiceTest.java @@ -1,6 +1,6 @@ package com.epmet; - import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.DraftAttrFromDTO; import com.epmet.dto.form.DraftContentFromDTO; import com.epmet.service.ArticleService; import org.junit.Test; @@ -10,6 +10,7 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; @RunWith(SpringRunner.class) @@ -22,7 +23,7 @@ public class ArticleServiceTest { private ArticleService articleService; @Test - public void genToken() { + public void saveOrUpdateContent() { TokenDto tokenDto = new TokenDto(); tokenDto.setCustomerId("1"); tokenDto.setUserId("1"); @@ -42,4 +43,23 @@ public class ArticleServiceTest { String s = articleService.saveOrUpdateContent(tokenDto, draftContentFromDTO); System.out.println(s); } + + @Test + public void saveOrUpdateAttr() { + TokenDto tokenDto = new TokenDto(); + tokenDto.setCustomerId("1"); + tokenDto.setUserId("1"); + DraftAttrFromDTO draftAttrFromDTO = new DraftAttrFromDTO(); + draftAttrFromDTO.setDraftId("f93b9fa4e78eadc97164fb5203aa580a"); + draftAttrFromDTO.setCoverImg("http://www.baidu.com"); + draftAttrFromDTO.setTagNameList(Arrays.asList("标签1","标签2")); + draftAttrFromDTO.setIsTop(0); + draftAttrFromDTO.setGridIdList(Arrays.asList("b3f5c5464ad3634982116c174b22ee35")); + draftAttrFromDTO.setPublisher("1"); + draftAttrFromDTO.setPublishDate("2020-06-03"); + draftAttrFromDTO.setPublisherType("agency"); + + Boolean aBoolean = articleService.saveOrUpdateAttr(tokenDto, draftAttrFromDTO); + System.out.println(aBoolean); + } } From 96c95c8f33aec65f1df6afdae544506f6447976e Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 3 Jun 2020 16:11:59 +0800 Subject: [PATCH 20/54] =?UTF-8?q?=E6=96=87=E7=AB=A0=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E6=97=B6=E4=BF=9D=E5=AD=98=E8=8D=89=E7=A8=BF=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/DraftAttrFromDTO.java | 5 ++ .../epmet/controller/ArticleController.java | 18 +++++-- .../com/epmet/service/ArticleService.java | 12 ++++- .../service/impl/ArticleServiceImpl.java | 47 +++++++++++++++---- .../java/com/epmet/ArticleServiceTest.java | 2 +- 5 files changed, 70 insertions(+), 14 deletions(-) diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java index a2640f520c..42d31c7475 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java @@ -19,6 +19,8 @@ package com.epmet.dto.form; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.List; @@ -37,6 +39,7 @@ public class DraftAttrFromDTO implements Serializable { /** * 草稿ID */ + @NotBlank(message = "草稿ID不能为空") private String draftId; /** @@ -52,6 +55,7 @@ public class DraftAttrFromDTO implements Serializable { /** * 是否置顶 */ + @NotNull(message = "是否置顶不能为空") private Integer isTop; /** @@ -67,6 +71,7 @@ public class DraftAttrFromDTO implements Serializable { /** * 发布日期 */ + @NotBlank(message = "发布时间不能为空") private String publishDate; /** diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 98d1a0411c..3a95514f39 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -35,7 +35,6 @@ import com.epmet.dto.result.*; import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.dto.result.ArticleOperationResultDTO; import com.epmet.dto.result.GovArticleDetailResultDTO; -import com.epmet.dto.result.LatestListResultDTO; import com.epmet.dto.result.PublishAgencyListResultDTO; import com.epmet.excel.ArticleExcel; import com.epmet.service.ArticleOperateRecordService; @@ -222,8 +221,21 @@ public class ArticleController { * @throws Exception */ @GetMapping("saveattr") - public Result saveOrUpdateAttr(@LoginUser TokenDto tokenDto,@RequestBody DraftAttrFromDTO fromDTO) throws Exception { - Boolean isSuccess = articleService.saveOrUpdateAttr(tokenDto, fromDTO); + public Result saveDraftAttr(@LoginUser TokenDto tokenDto,@RequestBody DraftAttrFromDTO fromDTO) throws Exception { + ValidatorUtils.validateEntity(fromDTO, DefaultGroup.class); + Boolean isSuccess = articleService.saveDraftAttr(tokenDto, fromDTO); + return new Result().ok(isSuccess); + } + + /** + * desc:预览保存草稿属性 + * @param fromDTO + * @throws Exception + */ + @GetMapping("previewsaveattr") + public Result previewSaveDraftAttr(@LoginUser TokenDto tokenDto,@RequestBody DraftAttrFromDTO fromDTO) throws Exception { + ValidatorUtils.validateEntity(fromDTO, DefaultGroup.class); + Boolean isSuccess = articleService.previewSaveDraftAttr(tokenDto, fromDTO); return new Result().ok(isSuccess); } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index e4c6ea9451..8494824e7f 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -144,10 +144,18 @@ public interface ArticleService extends BaseService { void offLineArticle(OffLineArticleFormDTO formDTO); /** - * desc:保存或修改文章属性 + * desc:点击保存草稿时,保存文章属性 * @param tokenDto * @param fromDTO * @return */ - Boolean saveOrUpdateAttr(TokenDto tokenDto, DraftAttrFromDTO fromDTO); + Boolean saveDraftAttr(TokenDto tokenDto, DraftAttrFromDTO fromDTO); + + /** + * desc:预览时修改文章属性 + * @param tokenDto + * @param fromDTO + * @return + */ + Boolean previewSaveDraftAttr(TokenDto tokenDto, DraftAttrFromDTO fromDTO); } \ No newline at end of file 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 0fd775e6e0..37527b02e4 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 @@ -235,10 +235,11 @@ public class ArticleServiceImpl extends BaseServiceImpl publishRangeEntityList) { Map draftIdMap = new HashMap<>(); draftIdMap.put("DRAFT_ID", draftEntity.getId()); draftCoverDao.deleteByMap(draftIdMap); - draftCoverDao.insert(coverEntity); + if (coverEntity != null){ + draftCoverDao.insert(coverEntity); + } draftPublishRangeDao.deleteByMap(draftIdMap); if (CollectionUtils.isEmpty(publishRangeEntityList)){ log.warn("saveOrUpdateAttr publishRangeEntityList is empty"); throw new RenException("参数错误"); } - publishRangeEntityList.forEach(publishRange->draftPublishRangeDao.insert(publishRange)); + if (!CollectionUtils.isEmpty(publishRangeEntityList)){ + publishRangeEntityList.forEach(publishRange->draftPublishRangeDao.insert(publishRange)); + } draftDao.updateById(draftEntity); } private List buildDraftPublishRange(DraftEntity draftEntity, TokenDto tokenDto, DraftAttrFromDTO fromDTO) { + if (CollectionUtils.isEmpty(fromDTO.getGridIdList())){ + return null; + } List publishRangeEntityList = new ArrayList<>(); List agencyGridNameList = new ArrayList<>(); ArticleGridResultDTO articleGridResultDTO = agencyGridList(tokenDto); if (articleGridResultDTO == null) { - log.warn("saveOrUpdateAttr userId:{} have not right access publishRange", tokenDto.getUserId()); + log.warn("saveDraftAttr userId:{} have not right access publishRange", tokenDto.getUserId()); throw new RenException("参数错误"); } buildName(tokenDto,agencyGridNameList,publishRangeEntityList, fromDTO, articleGridResultDTO); @@ -304,6 +332,9 @@ public class ArticleServiceImpl extends BaseServiceImpl Date: Wed, 3 Jun 2020 16:31:23 +0800 Subject: [PATCH 21/54] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF=E5=85=9A?= =?UTF-8?q?=E5=BB=BA=E5=A3=B0=E9=9F=B3=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/OssController.java | 21 +++++++ .../com/epmet/feign/GovOrgFeignClient.java | 34 +++++++++++ .../fallback/GovOrgFeignClientFallBack.java | 27 +++++++++ .../com/epmet/feign/OperCrmFeignClient.java | 1 - .../fallback/OperCrmFeignClientFallBack.java | 1 - .../impl/CustomerStaffAgencyServiceImpl.java | 1 - .../epmet/service/impl/StaffServiceImpl.java | 1 - .../com/epmet/dto/form/DraftListFormDTO.java | 23 ++++++++ .../epmet/dto/form/OfflineListFormDTO.java | 23 ++++++++ .../epmet/dto/form/PublishedListFormDTO.java | 30 ++++++++++ .../epmet/dto/result/DraftListResultDTO.java | 34 +++++++++++ .../dto/result/OfflineListResultDTO.java | 38 ++++++++++++ .../dto/result/PublishedListResultDTO.java | 42 +++++++++++++ .../gov-voice/gov-voice-server/pom.xml | 6 ++ .../com/epmet/aspect/RequestLogAspect.java | 40 +++++++++++++ .../epmet/controller/ArticleController.java | 31 ++++++++++ .../com/epmet/controller/DraftController.java | 10 ++++ .../main/java/com/epmet/dao/ArticleDao.java | 36 ++++++++++- .../src/main/java/com/epmet/dao/DraftDao.java | 15 +++-- .../com/epmet/service/ArticleService.java | 24 +++++++- .../java/com/epmet/service/DraftService.java | 12 ++++ .../service/impl/ArticleServiceImpl.java | 59 ++++++++++++++++++- .../epmet/service/impl/DraftServiceImpl.java | 13 ++++ .../src/main/resources/mapper/ArticleDao.xml | 52 ++++++++++++++++ .../src/main/resources/mapper/DraftDao.xml | 14 ++++- .../com/epmet/aspect/RequestLogAspect.java | 40 +++++++++++++ epmet-user/epmet-user-client/pom.xml | 6 ++ .../com/epmet/feign/EpmetUserFeignClient.java | 14 +++++ .../EpmetUserFeignClientFallBack.java | 8 +++ .../epmet/controller/StaffRoleController.java | 17 ++++++ .../main/java/com/epmet/dao/StaffRoleDao.java | 9 +++ .../com/epmet/feign/OperCrmFeignClient.java | 1 - .../fallback/OperCrmFeignClientFallBack.java | 1 - .../com/epmet/service/StaffRoleService.java | 10 ++++ .../impl/RegisterRelationServiceImpl.java | 1 - .../impl/StaffAgencyVisitedServiceImpl.java | 1 - .../service/impl/StaffRoleServiceImpl.java | 6 ++ .../main/resources/mapper/StaffRoleDao.xml | 14 +++++ 38 files changed, 695 insertions(+), 21 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgFeignClient.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftListFormDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/OfflineListFormDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishedListFormDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/OfflineListResultDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/PublishedListResultDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/aspect/RequestLogAspect.java create mode 100644 epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/aspect/RequestLogAspect.java diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index efe52eda9e..2826dc9932 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -55,6 +55,7 @@ public class OssController { private ParamsRemoteService paramsRemoteService; private final static String KEY = ModuleConstant.CLOUD_STORAGE_CONFIG_KEY; + public static final String IMAGE_JPG_VALUE = "image/jpg"; @GetMapping("page") @ApiOperation(value = "分页") @@ -186,4 +187,24 @@ public class OssController { return ossService.uploadImg(file); } + @PostMapping("article/upload") + public Result uploadArticleImg(@RequestParam("file") MultipartFile file) { + + // 校验文件类型 + if (!MediaType.IMAGE_PNG_VALUE.equals(file.getContentType()) && !IMAGE_JPG_VALUE.equals(file.getContentType())) { + throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getCode() + , EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg()); + } + + // 校验文件体积,不超过2m + long maxSize = 2 * 1024 * 1024; + long size = file.getSize(); + if (size > maxSize) { + throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() + , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); + } + + return ossService.uploadImg(file); + } + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgFeignClient.java new file mode 100644 index 0000000000..1b23a85ec8 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -0,0 +1,34 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.form.LatestGridFormDTO; +import com.epmet.dto.form.StaffInfoFromDTO; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.LatestCustomerResultDTO; +import com.epmet.dto.result.MineResultDTO; +import com.epmet.feign.fallback.GovOrgFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +/** + * @Description url = "localhost:8092" + * @Author sun + */ +@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class) +public interface GovOrgFeignClient { + + /** + * 根据staffId查询所属的组织机构 + * @param staffId + * @return + */ + @PostMapping("/gov/org/agency/agencybystaff/{staffId}") + Result getAgencyByStaff(@PathVariable("staffId") String staffId); +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java new file mode 100644 index 0000000000..8b0cb47059 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java @@ -0,0 +1,27 @@ +package com.epmet.feign.fallback; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.form.LatestGridFormDTO; +import com.epmet.dto.form.StaffInfoFromDTO; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.LatestCustomerResultDTO; +import com.epmet.dto.result.MineResultDTO; +import com.epmet.feign.GovOrgFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Description + * @Author sun + */ +@Component +public class GovOrgFeignClientFallBack implements GovOrgFeignClient { + @Override + public Result getAgencyByStaff(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyByStaff", staffId); + } +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java index fe0bf224ab..deb9673714 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java @@ -4,7 +4,6 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerDTO; import com.epmet.dto.form.CustomerFormDTO; -import com.epmet.feign.fallback.OperCrmFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java index 9f405caca4..c27aa3a585 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java @@ -5,7 +5,6 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerDTO; import com.epmet.dto.form.CustomerFormDTO; -import com.epmet.feign.OperCrmFeignClient; import org.springframework.stereotype.Component; import java.util.List; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java index e8a38d2af6..c13a634b39 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java @@ -35,7 +35,6 @@ import com.epmet.dto.result.CommonStaffInfoResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.entity.CustomerStaffAgencyEntity; import com.epmet.feign.EpmetUserFeignClient; -import com.epmet.feign.OperCrmFeignClient; import com.epmet.redis.CustomerStaffAgencyRedis; import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerDepartmentService; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index 32ec8df9ab..355765d9a6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -12,7 +12,6 @@ import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerStaffAgencyEntity; import com.epmet.feign.EpmetUserFeignClient; -import com.epmet.feign.OperCrmFeignClient; import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerStaffAgencyService; import com.epmet.service.StaffService; diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftListFormDTO.java new file mode 100644 index 0000000000..02dd80d4df --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftListFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/3 14:43 + */ +@Data +public class DraftListFormDTO implements Serializable { + private static final long serialVersionUID = 7957826609741967502L; + /** + * 页码 + */ + private Integer pageNo; + /** + * 每页显示数量 + */ + private Integer pageSize; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/OfflineListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/OfflineListFormDTO.java new file mode 100644 index 0000000000..fe005409d4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/OfflineListFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/3 14:47 + */ +@Data +public class OfflineListFormDTO implements Serializable { + private static final long serialVersionUID = -5928134434874117068L; + /** + * 页码 + */ + private Integer pageNo; + /** + * 每页显示数量 + */ + private Integer pageSize; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishedListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishedListFormDTO.java new file mode 100644 index 0000000000..a4a514c06f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishedListFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/2 14:09 + */ +@Data +public class PublishedListFormDTO implements Serializable { + + private static final long serialVersionUID = -8377558773628524229L; + /** + * 页码 + */ + private Integer pageNo; + /** + * 每页显示数量 + */ + private Integer pageSize; + /** + * 标签 + */ + private List tagIdList; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java new file mode 100644 index 0000000000..4f41ee517c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/3 14:44 + */ +@NoArgsConstructor +@Data +public class DraftListResultDTO implements Serializable { + + private static final long serialVersionUID = -3596277149943610099L; + /** + * 文章ID + */ + private String draftId; + /** + * 文章标题 + */ + private String title; + /** + * 文章内容 + */ + private String content; + /** + * 创建时间 + */ + private Long createdTime; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/OfflineListResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/OfflineListResultDTO.java new file mode 100644 index 0000000000..e277f6cd7a --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/OfflineListResultDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/3 14:48 + */ +@NoArgsConstructor +@Data +public class OfflineListResultDTO implements Serializable { + + private static final long serialVersionUID = -5817451219557672084L; + /** + * 文章ID + */ + private String articleId; + /** + * 文章标题 + */ + private String title; + /** + * 发布单位 + */ + private String publisherName; + /** + * 发布时间 + */ + private String publishDate; + /** + * 概要内容 + */ + private String previewContent; +} 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 new file mode 100644 index 0000000000..4241ebac0c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/PublishedListResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/2 14:12 + */ +@NoArgsConstructor +@Data +public class PublishedListResultDTO implements Serializable { + + private static final long serialVersionUID = -8525181219822398750L; + /** + * 文章ID + */ + private String articleId; + /** + * 文章标题 + */ + private String title; + /** + * 发布单位 + */ + private String publisherName; + /** + * 发布时间 + */ + private String publishDate; + /** + * 文章标签串 + */ + private String tags; + /** + * 概要内容 + */ + private String previewContent; +} diff --git a/epmet-module/gov-voice/gov-voice-server/pom.xml b/epmet-module/gov-voice/gov-voice-server/pom.xml index 1ae17d3e45..3213128ee2 100644 --- a/epmet-module/gov-voice/gov-voice-server/pom.xml +++ b/epmet-module/gov-voice/gov-voice-server/pom.xml @@ -71,6 +71,12 @@ 2.0.0 compile + + com.epmet + epmet-user-client + 2.0.0 + compile + diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/aspect/RequestLogAspect.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..49581cf63c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/aspect/RequestLogAspect.java @@ -0,0 +1,40 @@ +package com.epmet.aspect; + +import com.epmet.commons.tools.aspect.BaseRequestLogAspect; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * 日志/异常处理切面实现,调用父类方法完成日志记录和异常处理。 + */ +@Aspect +@Component +@Order(0) +public class RequestLogAspect extends BaseRequestLogAspect { + + @Override + @Around(value = "execution(* com.epmet.controller.*Controller*.*(..)) ") + public Object proceed(ProceedingJoinPoint point) throws Throwable { + return super.proceed(point, getRequest()); + } + + /** + * 获取Request对象 + * + * @return + */ + private HttpServletRequest getRequest() { + RequestAttributes ra = RequestContextHolder.getRequestAttributes(); + ServletRequestAttributes sra = (ServletRequestAttributes) ra; + return sra.getRequest(); + } + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 3a95514f39..75e9aea484 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -239,4 +239,35 @@ public class ArticleController { return new Result().ok(isSuccess); } + + /** + * 已发布文章列表 + * @author zhaoqifeng + * @date 2020/6/3 16:19 + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("publishedarticlelist") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISHED_LIST) + public Result publishedArticleList(@LoginUser TokenDto tokenDto, @RequestBody PublishedListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(articleService.publishedArticleList(tokenDto, formDTO)); + } + + + /** + * 已下线文章列表 + * @author zhaoqifeng + * @date 2020/6/3 16:19 + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("offlinearticlelist") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OFFLINE_LIST) + public Result offLineList(@LoginUser TokenDto tokenDto, @RequestBody OfflineListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(articleService.offlineList(tokenDto, formDTO)); + } } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java index 1fc03f1d9c..bdbf8fd8d5 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java @@ -17,9 +17,11 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.RequirePermission; import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -29,6 +31,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.DraftDTO; import com.epmet.dto.form.DeleteDraftFormDTO; +import com.epmet.dto.form.DraftListFormDTO; import com.epmet.excel.DraftExcel; import com.epmet.service.DraftService; import org.springframework.beans.factory.annotation.Autowired; @@ -108,4 +111,11 @@ public class DraftController { draftService.deleteDraft(formDTO); return new Result(); } + + @PostMapping("draftlist") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_LIST) + public Result draftList(@LoginUser TokenDto tokenDto, DraftListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(draftService.draftList(tokenDto, formDTO)); + } } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java index 49e50f9fac..7475add5f5 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java @@ -14,12 +14,13 @@ package com.epmet.dao; +import com.epmet.commons.mybatis.annotation.DataFilter; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.result.GovArticleContentDTO; -import com.epmet.dto.result.GovArticleDetailResultDTO; +import com.epmet.dto.result.*; import com.epmet.dto.form.ResiTagListFormDto; import com.epmet.entity.ArticleEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -55,4 +56,35 @@ public interface ArticleDao extends BaseDao { */ Integer checkPublishArticle(ResiTagListFormDto formDto); + /** + * 已发布列表---组织工作人员 + * @author zhaoqifeng + * @date 2020/6/2 16:59 + * @param customerId + * @return java.util.List + */ + @DataFilter(tableAliases = "a") + List selectArticleListForAgency(@Param("customerId") String customerId); + + /** + * 已发布列表---网格工作人员 + * @author zhaoqifeng + * @date 2020/6/2 16:59 + * @param customerId + * @param gridList + * @return java.util.List + */ + @DataFilter(tableAliases = {"a", "apr"}, gridIdArgName = "gridList") + List selectArticleListForGrid(@Param("customerId") String customerId, @Param("gridList") List gridList); + + /** + * 已下线文章列表 + * @author zhaoqifeng + * @date 2020/6/3 15:16 + * @param gridList + * @return java.util.List + */ + @DataFilter(tableAliases = "a", gridIdArgName = "gridList") + List selectOfflineList(@Param("gridList") List gridList); + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java index b076f274e1..4daa493ba0 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java @@ -18,12 +18,10 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.result.CoverImgDTO; -import com.epmet.dto.result.DraftAttrResultDTO; -import com.epmet.dto.result.DraftContentDetailDTO; -import com.epmet.dto.result.DraftContentResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.DraftEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -74,4 +72,13 @@ public interface DraftDao extends BaseDao { * 草稿id */ List selectDraftGrids(String draftId); + + /** + * 草稿列表 + * @author zhaoqifeng + * @date 2020/6/3 14:54 + * @param userId + * @return java.util.List + */ + List selectDraftList(@Param("userId") String userId); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index 8494824e7f..a8b8a82c71 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -21,9 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.ArticleDTO; -import com.epmet.dto.form.DraftAttrFromDTO; -import com.epmet.dto.form.DraftContentFromDTO; -import com.epmet.dto.form.OffLineArticleFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.dto.result.GovArticleDetailResultDTO; import com.epmet.dto.result.PublishAgencyListResultDTO; @@ -158,4 +156,24 @@ public interface ArticleService extends BaseService { * @return */ Boolean previewSaveDraftAttr(TokenDto tokenDto, DraftAttrFromDTO fromDTO); + + /** + * 已发布文章列表 + * @author zhaoqifeng + * @date 2020/6/2 14:38 + * @param tokenDto token + * @param formDTO 参数 + * @return java.util.List + */ + PageData publishedArticleList(TokenDto tokenDto, PublishedListFormDTO formDTO); + + /** + * 已下线列表 + * @author zhaoqifeng + * @date 2020/6/3 14:51 + * @param tokenDto token + * @param formDTO 参数 + * @return java.util.List + */ + PageData offlineList(TokenDto tokenDto, OfflineListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java index 704d532cc8..ad56f053a9 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java @@ -19,9 +19,11 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.DraftDTO; import com.epmet.dto.form.DeleteDraftFormDTO; import com.epmet.dto.form.DraftDetailFormDTO; +import com.epmet.dto.form.DraftListFormDTO; import com.epmet.dto.result.DraftAttrResultDTO; import com.epmet.dto.result.DraftContentResultDTO; import com.epmet.entity.DraftEntity; @@ -125,4 +127,14 @@ public interface DraftService extends BaseService { * @date 2020-06-03 */ DraftAttrResultDTO getDraftAttr(DraftDetailFormDTO formDTO); + + /** + * 草稿列表 + * @author zhaoqifeng + * @date 2020/6/3 14:51 + * @param tokenDto token + * @param formDTO 参数 + * @return java.util.List + */ + PageData draftList(TokenDto tokenDto, DraftListFormDTO formDTO); } \ No newline at end of file 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 37527b02e4..c5c6bad5ea 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 @@ -34,21 +34,24 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.constant.ArticleConstant; import com.epmet.constant.DraftConstant; +import com.epmet.constant.RoleKeyConstants; import com.epmet.dao.*; import com.epmet.dto.ArticleDTO; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.feign.GovOrgSelfFeignClient; -import com.epmet.dto.form.DraftAttrFromDTO; -import com.epmet.dto.form.DraftContentFromDTO; -import com.epmet.dto.form.OffLineArticleFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.*; +import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.EpmetUserSelfFeignClient; +import com.epmet.feign.GovOrgFeignClient; import com.epmet.redis.ArticleRedis; import com.epmet.service.ArticleOperateRecordService; import com.epmet.service.ArticlePublishRangeService; import com.epmet.service.ArticleService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -89,6 +92,13 @@ public class ArticleServiceImpl extends BaseServiceImpl page(Map params) { @@ -512,4 +522,47 @@ public class ArticleServiceImpl extends BaseServiceImpl resultList; + Result customerAgencyResult = govOrgFeignClient.getAgencyByStaff(tokenDto.getUserId()); + if (!customerAgencyResult.success()) { + throw new RenException(customerAgencyResult.getCode(), customerAgencyResult.getMsg()); + } + List roles = epmetUserFeignClient.getStaffRoles(tokenDto.getUserId()).getData(); + String staffLevel = ""; + for (CustomerStaffRoleResultDTO role : roles) { + //党建负责人 + if (RoleKeyConstants.ROLE_KEY_PARTY_PRINCIPALS.equals(role.getRoleKey()) || + RoleKeyConstants.ROLE_KEY_AGENCY_LEADER.equals(role.getRoleKey()) || + RoleKeyConstants.ROLE_KEY_MANAGER.equals(role.getRoleKey()) || + RoleKeyConstants.ROLE_KEY_STAFF.equals(role.getRoleKey()) || + RoleKeyConstants.ROLE_KEY_DEPT_LEADER.equals(role.getRoleKey())) { + staffLevel = AGENCY; + break; + } else { + staffLevel = GRID; + } + } + if (AGENCY.equals(staffLevel)) { + resultList = baseDao.selectArticleListForAgency(tokenDto.getCustomerId()); + } else { + //TODO + List gridList = new ArrayList<>(); + resultList = baseDao.selectArticleListForGrid(tokenDto.getCustomerId(), gridList); + } + PageInfo pageInfo = new PageInfo<>(resultList); + return new PageData<>(resultList, pageInfo.getTotal()); + } + + @Override + public PageData offlineList(TokenDto tokenDto, OfflineListFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(),formDTO.getPageSize()); + List gridList = new ArrayList<>(); + List resultList = baseDao.selectOfflineList(gridList); + PageInfo pageInfo = new PageInfo<>(resultList); + return new PageData<>(resultList, pageInfo.getTotal()); + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java index 80b8e4fa21..709da69d32 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java @@ -23,18 +23,23 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DraftConstant; import com.epmet.dao.DraftDao; import com.epmet.dto.DraftDTO; import com.epmet.dto.form.DeleteDraftFormDTO; import com.epmet.dto.form.DraftDetailFormDTO; +import com.epmet.dto.form.DraftListFormDTO; import com.epmet.dto.result.CoverImgDTO; import com.epmet.dto.result.DraftAttrResultDTO; import com.epmet.dto.result.DraftContentResultDTO; +import com.epmet.dto.result.DraftListResultDTO; import com.epmet.entity.DraftEntity; import com.epmet.redis.DraftRedis; import com.epmet.service.DraftService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -146,4 +151,12 @@ public class DraftServiceImpl extends BaseServiceImpl imp return draftAttrResultDTO; } + @Override + public PageData draftList(TokenDto tokenDto, DraftListFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(),formDTO.getPageSize()); + List resultList = baseDao.selectDraftList(tokenDto.getUserId()); + PageInfo pageInfo = new PageInfo<>(resultList); + return new PageData<>(resultList, pageInfo.getTotal()); + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml index 8a0a3a5ccb..c41efbb8dd 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml @@ -46,4 +46,56 @@ AND created_by = #{userId} + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml index e992fe31b1..a74713fd55 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml @@ -74,7 +74,7 @@ - SELECT GRID_ID FROM @@ -84,4 +84,16 @@ AND dpr.PUBLISH_STATUS != 'published' AND dpr.DRAFT_ID = #{draftId} + + \ No newline at end of file diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/aspect/RequestLogAspect.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..49581cf63c --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/aspect/RequestLogAspect.java @@ -0,0 +1,40 @@ +package com.epmet.aspect; + +import com.epmet.commons.tools.aspect.BaseRequestLogAspect; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * 日志/异常处理切面实现,调用父类方法完成日志记录和异常处理。 + */ +@Aspect +@Component +@Order(0) +public class RequestLogAspect extends BaseRequestLogAspect { + + @Override + @Around(value = "execution(* com.epmet.controller.*Controller*.*(..)) ") + public Object proceed(ProceedingJoinPoint point) throws Throwable { + return super.proceed(point, getRequest()); + } + + /** + * 获取Request对象 + * + * @return + */ + private HttpServletRequest getRequest() { + RequestAttributes ra = RequestContextHolder.getRequestAttributes(); + ServletRequestAttributes sra = (ServletRequestAttributes) ra; + return sra.getRequest(); + } + +} diff --git a/epmet-user/epmet-user-client/pom.xml b/epmet-user/epmet-user-client/pom.xml index da75b38ba7..7b15551338 100644 --- a/epmet-user/epmet-user-client/pom.xml +++ b/epmet-user/epmet-user-client/pom.xml @@ -26,6 +26,12 @@ io.springfox springfox-swagger-ui + + com.epmet + gov-org-client + 2.0.0 + compile + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index d2a289864f..b06cfefc18 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -3,12 +3,16 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.TagCustomerFormDTO; +import com.epmet.dto.result.CustomerStaffRoleResultDTO; import com.epmet.dto.result.TagCustomerResultDTO; import com.epmet.feign.fallback.EpmetUserFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import java.util.List; + /** * @Author zxc * @CreateTime 2020/6/2 14:05 @@ -26,4 +30,14 @@ public interface EpmetUserFeignClient { @PostMapping("/epmetuser/user/getcustomeridbyuserid") Result getCustomerIdByUserId(@RequestBody TagCustomerFormDTO formDTO); + /** + * 根据staffId查询人员拥有的所有角色信息 + * @author zhaoqifeng + * @date 2020/6/2 16:11 + * @param staffId + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("/epmetuser/staffrole/staffroles/{staffId}") + Result> getStaffRoles(@PathVariable String staffId); + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java index 38a0fc01bd..cb1cc2e572 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java @@ -4,10 +4,13 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.TagCustomerFormDTO; +import com.epmet.dto.result.CustomerStaffRoleResultDTO; import com.epmet.dto.result.TagCustomerResultDTO; import com.epmet.feign.EpmetUserFeignClient; import org.springframework.stereotype.Component; +import java.util.List; + /** * @Description 居民端-陌生人导览 调用gov-org服务 * @Author sun @@ -20,4 +23,9 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { public Result getCustomerIdByUserId(TagCustomerFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerIdByUserId", formDTO); } + + @Override + public Result> getStaffRoles(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffRoles", staffId); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java index 5e86a9a74c..2eada17f01 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java @@ -5,6 +5,11 @@ import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.GovStaffRoleDTO; +import com.epmet.dto.form.CommonUserFormDTO; +import com.epmet.dto.form.CustomerRoleFormDTO; +import com.epmet.dto.form.RolesUsersListFormDTO; +import com.epmet.dto.form.StaffRoleFormDTO; +import com.epmet.dto.result.CustomerStaffRoleResultDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.CustomerStaffRoleListResultDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; @@ -150,4 +155,16 @@ public class StaffRoleController { ValidatorUtils.validateEntity(formDTO); return new Result>().ok(staffRoleService.getCustomerStaffRoleList(formDTO)); } + + /** + * 根据staffId查询人员拥有的所有角色信息 + * @author zhaoqifeng + * @date 2020/6/2 16:11 + * @param staffId + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("staffroles/{staffId}") + public Result> getStaffRoles(@PathVariable String staffId) { + return new Result>().ok(staffRoleService.getStaffRoles(staffId)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java index c376850ac1..5cf2cd03b7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java @@ -89,4 +89,13 @@ public interface StaffRoleDao extends BaseDao { * @Author sun **/ List selectCustomerStaffRoleList(CustomerStaffRoleListFormDTO formDTO); + + /** + * 根据staffId查询人员拥有的所有角色信息 + * @author zhaoqifeng + * @date 2020/6/2 15:54 + * @param staffId + * @return java.util.List + */ + List selectStaffRoles(@Param("staffId") String staffId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java index a1fd14d99e..c815a5b5b4 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java @@ -3,7 +3,6 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerDTO; -import com.epmet.feign.fallback.OperCrmFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java index c6c0d6542c..43d23c76ec 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java @@ -4,7 +4,6 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerDTO; -import com.epmet.feign.OperCrmFeignClient; import org.springframework.stereotype.Component; /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java index d8de0777d0..f3913d588b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java @@ -25,6 +25,7 @@ import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.CustomerStaffRoleListFormDTO; import com.epmet.dto.form.RolesUsersListFormDTO; +import com.epmet.dto.result.CustomerStaffRoleResultDTO; import com.epmet.dto.result.CustomerStaffRoleListResultDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.dto.result.StaffRolesResultDTO; @@ -138,4 +139,13 @@ public interface StaffRoleService extends BaseService { * @Author sun **/ List getCustomerStaffRoleList(CustomerStaffRoleListFormDTO formDTO); + + /** + * 根据staffId查询人员拥有的所有角色信息 + * @author zhaoqifeng + * @date 2020/6/2 15:54 + * @param staffId + * @return java.util.List + */ + List getStaffRoles(String staffId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java index 279232667f..583e4356ba 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java @@ -36,7 +36,6 @@ import com.epmet.entity.RegisterRelationEntity; import com.epmet.entity.UserCustomerEntity; import com.epmet.entity.UserWechatEntity; import com.epmet.feign.GovOrgFeignClient; -import com.epmet.feign.OperCrmFeignClient; import com.epmet.redis.RegisterRelationRedis; import com.epmet.service.GridVisitedService; import com.epmet.service.RegisterRelationService; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java index 11fb4702ca..355297f58f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java @@ -29,7 +29,6 @@ import com.epmet.dto.StaffAgencyVisitedDTO; import com.epmet.dto.form.StaffLoginAgencyRecordFormDTO; import com.epmet.dto.result.StaffLatestAgencyResultDTO; import com.epmet.entity.StaffAgencyVisitedEntity; -import com.epmet.feign.OperCrmFeignClient; import com.epmet.service.CustomerStaffService; import com.epmet.service.StaffAgencyVisitedService; import org.apache.commons.lang3.StringUtils; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java index 07181e174e..38a4924eef 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java @@ -33,6 +33,7 @@ import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.CustomerStaffRoleListFormDTO; import com.epmet.dto.form.RolesUsersListFormDTO; +import com.epmet.dto.result.CustomerStaffRoleResultDTO; import com.epmet.dto.result.CustomerStaffRoleListResultDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.dto.result.GovStaffRoleTemplateDTO; @@ -174,4 +175,9 @@ public class StaffRoleServiceImpl extends BaseServiceImpl getStaffRoles(String staffId) { + return baseDao.selectStaffRoles(staffId); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml index a90bdc4938..94ae4b700d 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml @@ -142,4 +142,18 @@ AND staff.user_id = #{staffId} + + \ No newline at end of file From f1bb90ed9af1f56723a193556fd3b89dfaf222f8 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 3 Jun 2020 17:07:25 +0800 Subject: [PATCH 22/54] =?UTF-8?q?=E8=8D=89=E7=A8=BF=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/ArticleController.java | 22 +++++++++--- .../com/epmet/service/ArticleService.java | 9 +++++ .../service/impl/ArticleServiceImpl.java | 36 ++++++++++++++++--- 3 files changed, 58 insertions(+), 9 deletions(-) diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 75e9aea484..081ecba72e 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -32,10 +32,6 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.ArticleDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.dto.result.ArticleGridResultDTO; -import com.epmet.dto.result.ArticleOperationResultDTO; -import com.epmet.dto.result.GovArticleDetailResultDTO; -import com.epmet.dto.result.PublishAgencyListResultDTO; import com.epmet.excel.ArticleExcel; import com.epmet.service.ArticleOperateRecordService; import com.epmet.service.ArticleService; @@ -124,6 +120,7 @@ public class ArticleController { * @throws Exception */ @GetMapping("savecontent") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) public Result saveOrUpdateContent(@LoginUser TokenDto tokenDto,@RequestBody DraftContentFromDTO fromDTO) throws Exception { String draftId = articleService.saveOrUpdateContent(tokenDto, fromDTO); return new Result().ok(draftId); @@ -221,9 +218,13 @@ public class ArticleController { * @throws Exception */ @GetMapping("saveattr") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) public Result saveDraftAttr(@LoginUser TokenDto tokenDto,@RequestBody DraftAttrFromDTO fromDTO) throws Exception { ValidatorUtils.validateEntity(fromDTO, DefaultGroup.class); Boolean isSuccess = articleService.saveDraftAttr(tokenDto, fromDTO); + if (isSuccess){ + //TODO 异步校验内容 + } return new Result().ok(isSuccess); } @@ -233,12 +234,25 @@ public class ArticleController { * @throws Exception */ @GetMapping("previewsaveattr") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) public Result previewSaveDraftAttr(@LoginUser TokenDto tokenDto,@RequestBody DraftAttrFromDTO fromDTO) throws Exception { ValidatorUtils.validateEntity(fromDTO, DefaultGroup.class); Boolean isSuccess = articleService.previewSaveDraftAttr(tokenDto, fromDTO); return new Result().ok(isSuccess); } + /** + * desc:发布文章 + * @param draftId + * @throws Exception + */ + @GetMapping("publish") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) + public Result publishArticle(@LoginUser TokenDto tokenDto, String draftId) throws Exception { + Boolean isSuccess = articleService.publish(tokenDto, draftId); + return new Result().ok(isSuccess); + } + /** * 已发布文章列表 diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index a8b8a82c71..c043203b9e 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -176,4 +176,13 @@ public interface ArticleService extends BaseService { * @return java.util.List */ PageData offlineList(TokenDto tokenDto, OfflineListFormDTO formDTO); + + /** + * desc: 发布文章 + * @param:draftId + * @return: Boolean + * date: 2020/6/3 16:34 + * @author: jianjun liu + */ + Boolean publish(TokenDto tokenDto, String draftId); } \ No newline at end of file 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 c5c6bad5ea..62d066fe4a 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 @@ -247,11 +247,8 @@ public class ArticleServiceImpl extends BaseServiceImpl publishRangeEntityList) { Map draftIdMap = new HashMap<>(); From f6a861c2e82ffad620e5a1eecd5deafd132f4ecb Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 3 Jun 2020 17:25:11 +0800 Subject: [PATCH 23/54] =?UTF-8?q?=E5=BC=95=E7=94=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/feign/OperCrmFeignClient.java | 1 + .../com/epmet/feign/fallback/OperCrmFeignClientFallBack.java | 1 + .../java/com/epmet/service/impl/RegisterRelationServiceImpl.java | 1 + .../com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java | 1 + 4 files changed, 4 insertions(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java index c815a5b5b4..a1fd14d99e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java @@ -3,6 +3,7 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerDTO; +import com.epmet.feign.fallback.OperCrmFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java index 43d23c76ec..c6c0d6542c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerDTO; +import com.epmet.feign.OperCrmFeignClient; import org.springframework.stereotype.Component; /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java index 583e4356ba..279232667f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java @@ -36,6 +36,7 @@ import com.epmet.entity.RegisterRelationEntity; import com.epmet.entity.UserCustomerEntity; import com.epmet.entity.UserWechatEntity; import com.epmet.feign.GovOrgFeignClient; +import com.epmet.feign.OperCrmFeignClient; import com.epmet.redis.RegisterRelationRedis; import com.epmet.service.GridVisitedService; import com.epmet.service.RegisterRelationService; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java index 355297f58f..11fb4702ca 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java @@ -29,6 +29,7 @@ import com.epmet.dto.StaffAgencyVisitedDTO; import com.epmet.dto.form.StaffLoginAgencyRecordFormDTO; import com.epmet.dto.result.StaffLatestAgencyResultDTO; import com.epmet.entity.StaffAgencyVisitedEntity; +import com.epmet.feign.OperCrmFeignClient; import com.epmet.service.CustomerStaffService; import com.epmet.service.StaffAgencyVisitedService; import org.apache.commons.lang3.StringUtils; From fe912534cbfd5641b4457cf79622bcc22d1a1f37 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 3 Jun 2020 18:07:23 +0800 Subject: [PATCH 24/54] =?UTF-8?q?=E5=86=B2=E7=AA=81=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/feign/OperCrmFeignClient.java | 1 + .../com/epmet/feign/fallback/OperCrmFeignClientFallBack.java | 1 + .../epmet/service/impl/CustomerStaffAgencyServiceImpl.java | 5 +++-- .../main/java/com/epmet/service/impl/StaffServiceImpl.java | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java index deb9673714..fe0bf224ab 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerDTO; import com.epmet.dto.form.CustomerFormDTO; +import com.epmet.feign.fallback.OperCrmFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java index c27aa3a585..9f405caca4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerDTO; import com.epmet.dto.form.CustomerFormDTO; +import com.epmet.feign.OperCrmFeignClient; import org.springframework.stereotype.Component; import java.util.List; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java index c13a634b39..17f9f75731 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java @@ -20,21 +20,22 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.CustomerStaffAgencyDao; import com.epmet.dto.*; import com.epmet.dto.form.CommonDepartmentFormDTO; +import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.CommonUserIdListFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; -import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.result.CommonStaffInfoResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.entity.CustomerStaffAgencyEntity; import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.OperCrmFeignClient; import com.epmet.redis.CustomerStaffAgencyRedis; import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerDepartmentService; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index 355765d9a6..32ec8df9ab 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -12,6 +12,7 @@ import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerStaffAgencyEntity; import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.OperCrmFeignClient; import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerStaffAgencyService; import com.epmet.service.StaffService; From 5abc15e47e73e2bf3d7a7c7cc7ff3e6914b3b3e5 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Wed, 3 Jun 2020 18:15:23 +0800 Subject: [PATCH 25/54] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E7=BA=A7=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/feign/GovVoiceFeignClient.java | 19 ++++-- .../fallback/GovVoiceFeignClientFallBack.java | 12 +++- .../dto/form/CorrelationTagListFormDTO.java | 21 ++++++ .../epmet/dto/form/ResiTagListFormDto.java | 5 +- .../epmet/dto/form/TagCascadeListFormDTO.java | 37 ++++++++++ .../result/CorrelationTagListResultDTO.java | 27 ++++++++ .../epmet/dto/result/TagInfoResultDTO.java | 27 ++++++++ .../java/com/epmet/constant/TagConstant.java | 5 ++ .../com/epmet/controller/TagController.java | 39 +++++++---- .../main/java/com/epmet/dao/ArticleDao.java | 6 +- .../main/java/com/epmet/redis/TagRedis.java | 67 +++++++++++++++---- .../java/com/epmet/service/TagService.java | 24 ++++--- .../epmet/service/impl/TagServiceImpl.java | 30 ++++++--- .../src/main/resources/mapper/ArticleDao.xml | 2 +- .../epmet/dto/form/ResiTagListFormDto.java | 35 ---------- .../epmet/controller/ArticleController.java | 26 +++++-- .../com/epmet/service/ArticleService.java | 14 +++- .../service/impl/ArticleServiceImpl.java | 21 ++++-- .../com/epmet/feign/EpmetUserFeignClient.java | 43 ------------ .../EpmetUserFeignClientFallBack.java | 31 --------- 20 files changed, 311 insertions(+), 180 deletions(-) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TagCascadeListFormDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDTO.java delete mode 100644 epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java delete mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java delete mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java index dd71cfc082..189c43de65 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java @@ -3,12 +3,12 @@ package com.epmet.dto.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.feign.fallback.GovVoiceFeignClientFallBack; -import com.epmet.dto.form.ResiTagListFormDto; -import com.epmet.dto.result.TagInfoResultDto; +import com.epmet.dto.form.ResiTagListFormDTO; +import com.epmet.dto.form.TagCascadeListFormDTO; +import com.epmet.dto.result.TagInfoResultDTO; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.ResponseBody; import java.util.List; @@ -17,7 +17,7 @@ import java.util.List; * @CreateTime 2020/6/2 16:05 * , url = "localhost:8105" */ -//@FeignClient(name = ServiceConstant.GOV_VOICE_SERVER, fallback = GovVoiceFeignClientFallBack.class, url = "localhost:8105") +//@FeignClient(name = ServiceConstant.GOV_VOICE_SERVER, fallback = GovVoiceFeignClientFallBack.class,url = "localhost:8105") @FeignClient(name = ServiceConstant.GOV_VOICE_SERVER, fallback = GovVoiceFeignClientFallBack.class) public interface GovVoiceFeignClient { @@ -27,6 +27,15 @@ public interface GovVoiceFeignClient { * @author zxc */ @PostMapping("/gov/voice/tag/resitaglist") - Result> resiTagList(@RequestBody ResiTagListFormDto formDto); + Result> resiTagList(@RequestBody ResiTagListFormDTO formDto); + + /** + * @Description 标签级联查询——居民端 + * @param formDto + * @author zxc + */ + @PostMapping("/gov/voice/tag/tagcascadelist") + Result> tagCascadeList(@RequestBody TagCascadeListFormDTO formDto); + } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/fallback/GovVoiceFeignClientFallBack.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/fallback/GovVoiceFeignClientFallBack.java index a8ad4e7af3..25cafda2ba 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/fallback/GovVoiceFeignClientFallBack.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/fallback/GovVoiceFeignClientFallBack.java @@ -4,8 +4,9 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.feign.GovVoiceFeignClient; -import com.epmet.dto.form.ResiTagListFormDto; -import com.epmet.dto.result.TagInfoResultDto; +import com.epmet.dto.form.ResiTagListFormDTO; +import com.epmet.dto.form.TagCascadeListFormDTO; +import com.epmet.dto.result.TagInfoResultDTO; import org.springframework.stereotype.Component; import java.util.List; @@ -17,7 +18,12 @@ import java.util.List; @Component public class GovVoiceFeignClientFallBack implements GovVoiceFeignClient { @Override - public Result> resiTagList(ResiTagListFormDto formDto) { + public Result> resiTagList(ResiTagListFormDTO formDto) { return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "resiTagList", formDto); } + + @Override + public Result> tagCascadeList(TagCascadeListFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "tagCascadeList", formDto); + } } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDTO.java new file mode 100644 index 0000000000..29a698f504 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form; + +import lombok.Data; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/3 9:39 + */ +@Data +public class CorrelationTagListFormDTO implements Serializable { + + private static final long serialVersionUID = -1588825995685146967L; + + /** + * 标签id集合 + */ + private List tagIdList; + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java index 6c31e69e71..f91cb8f355 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java @@ -11,7 +11,7 @@ import java.io.Serializable; * @CreateTime 2020/6/2 15:50 */ @Data -public class ResiTagListFormDto implements Serializable { +public class ResiTagListFormDTO implements Serializable { private static final long serialVersionUID = 4337657473061285656L; @@ -21,12 +21,13 @@ public class ResiTagListFormDto implements Serializable { /** * 网格id */ - @NotBlank(message = "网格id不能为空",groups = {ResiTagListForm.class,ResiTagListFormWeb.class}) + @NotBlank(message = "网格id不能为空",groups = {ResiTagListForm.class}) private String gridId; /** * 用户id */ + @NotBlank(message = "客户id不能为空",groups = {ResiTagListForm.class}) private String customerId; /** diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TagCascadeListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TagCascadeListFormDTO.java new file mode 100644 index 0000000000..2c914dd6aa --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TagCascadeListFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/3 13:16 + */ +@Data +public class TagCascadeListFormDTO implements Serializable { + + private static final long serialVersionUID = -727325750715567406L; + + public interface TagCascadeList{} + public interface TagCascadeListWeb extends CustomerClientShowGroup {} + + /** + * 网格id + */ + @NotBlank(message = "网格id不能为空",groups = {TagCascadeList.class}) + private String gridId; + + /** + * 标签id集合 + */ + private List tagIdList; + + /** + * 客户id + */ + private String customerId; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDTO.java new file mode 100644 index 0000000000..c614999e66 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/3 9:41 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@Data +public class CorrelationTagListResultDTO implements Serializable { + + private static final long serialVersionUID = 5536953304816455733L; + + /** + * 标签id + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDTO.java new file mode 100644 index 0000000000..a547af8767 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/2 9:47 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@Data +public class TagInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 4366515668545958124L; + + /** + * 标签id + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java index 30697d832c..15c6267b3a 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java @@ -30,6 +30,11 @@ public interface TagConstant { */ String GRID_TAG_KEY = "epmet:grid:articletag:"; + /** + * 政府——关联标签 key的前缀 【set】 + */ + String GRID_RETAG_KEY ="epmet:grid:article:retag:"; + /** * 冒号 */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java index d672d4f7d5..5dbec6fa20 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java @@ -1,13 +1,16 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.RequirePermission; +import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.form.CorrelationTagListFormDto; -import com.epmet.dto.form.ResiTagListFormDto; -import com.epmet.dto.result.CorrelationTagListResultDto; -import com.epmet.dto.result.TagInfoResultDto; +import com.epmet.dto.form.CorrelationTagListFormDTO; +import com.epmet.dto.form.ResiTagListFormDTO; +import com.epmet.dto.form.TagCascadeListFormDTO; +import com.epmet.dto.result.CorrelationTagListResultDTO; +import com.epmet.dto.result.TagInfoResultDTO; import com.epmet.service.TagService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -30,9 +33,9 @@ public class TagController { * @author zxc */ @PostMapping("taglist") - public Result> tagList(@LoginUser TokenDto tokenDto){ - ValidatorUtils.validateEntity(tokenDto); - return new Result>().ok(tagService.tagList(tokenDto)); +// @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISHED_LIST) + public Result> tagList(@LoginUser TokenDto tokenDto){ + return new Result>().ok(tagService.tagList(tokenDto)); } /** @@ -41,9 +44,9 @@ public class TagController { * @author zxc */ @PostMapping("resitaglist") - public Result> resiTagList(@RequestBody ResiTagListFormDto formDto){ - ValidatorUtils.validateEntity(formDto, ResiTagListFormDto.ResiTagListForm.class, ResiTagListFormDto.ResiTagListFormWeb.class); - return new Result>().ok(tagService.resiTagList(formDto)); + public Result> resiTagList(@RequestBody ResiTagListFormDTO formDto){ + ValidatorUtils.validateEntity(formDto, ResiTagListFormDTO.ResiTagListForm.class); + return new Result>().ok(tagService.resiTagList(formDto)); } /** @@ -53,8 +56,20 @@ public class TagController { * @author zxc */ @PostMapping("correlationtaglist") - public Result> correlationTagList(@LoginUser TokenDto tokenDto, @RequestBody CorrelationTagListFormDto formDto){ - return new Result>().ok(tagService.correlationTagList(tokenDto,formDto)); +// @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISHED_LIST) + public Result> correlationTagList(@LoginUser TokenDto tokenDto, @RequestBody CorrelationTagListFormDTO formDto){ + ValidatorUtils.validateEntity(formDto); + return new Result>().ok(tagService.correlationTagList(tokenDto,formDto)); + } + + /** + * @Description 标签级联查询——居民端 + * @param formDto + * @author zxc + */ + @PostMapping("tagcascadelist") + public Result> tagCascadeList(@RequestBody TagCascadeListFormDTO formDto){ + return new Result>().ok(tagService.tagCascadeList(formDto)); } } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java index 0c1e7f1a41..f65c49f289 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java @@ -17,7 +17,9 @@ package com.epmet.dao; import com.epmet.commons.mybatis.annotation.DataFilter; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.result.*; -import com.epmet.dto.form.ResiTagListFormDto; +import com.epmet.dto.form.ResiTagListFormDTO; +import com.epmet.dto.result.GovArticleContentDTO; +import com.epmet.dto.result.GovArticleDetailResultDTO; import com.epmet.entity.ArticleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -55,7 +57,7 @@ public interface ArticleDao extends BaseDao { * @param formDto * @author zxc */ - Integer checkPublishArticle(ResiTagListFormDto formDto); + Integer checkPublishArticle(ResiTagListFormDTO formDto); /** * 已发布列表---组织工作人员 diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java index 5d16236d83..9de49830ba 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java @@ -17,14 +17,13 @@ package com.epmet.redis; -import com.alibaba.druid.sql.visitor.functions.Concat; -import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.constant.TagConstant; -import com.epmet.dto.form.CorrelationTagListFormDto; -import com.epmet.dto.result.CorrelationTagListResultDto; -import com.epmet.dto.result.TagInfoResultDto; +import com.epmet.dto.form.CorrelationTagListFormDTO; +import com.epmet.dto.form.TagCascadeListFormDTO; +import com.epmet.dto.result.CorrelationTagListResultDTO; +import com.epmet.dto.result.TagInfoResultDTO; import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -47,7 +46,13 @@ public class TagRedis { } - public List get(String customerId, CorrelationTagListFormDto formDto){ + /** + * @Description 已发布列表页-获取关联标签——政府端 + * @param customerId + * @param formDto + * @author zxc + */ + public List get(String customerId, CorrelationTagListFormDTO formDto){ List tagIdList = formDto.getTagIdList(); Set objects ; Collection keys = new ArrayList<>(); @@ -63,13 +68,13 @@ public class TagRedis { String key = TagConstant.GOV_RETAG_KEY+customerId+TagConstant.COLON+tagIdList.get(0); objects = redisUtils.sMembers(key); } - List resultList = new ArrayList<>(); + List resultList = new ArrayList<>(); if (objects.size()==NumConstant.ZERO){ return resultList; } ObjectMapper objectMapper = new ObjectMapper(); for (Object object : objects) { - CorrelationTagListResultDto correlationTag = objectMapper.convertValue(object, CorrelationTagListResultDto.class); + CorrelationTagListResultDTO correlationTag = objectMapper.convertValue(object, CorrelationTagListResultDTO.class); resultList.add(correlationTag); } return resultList; @@ -81,7 +86,7 @@ public class TagRedis { * @param key == customerId * @author zxc */ - public List zRevRange(String key){ + public List zRevRange(String key){ long start = 0; long end = -1; String tagKey = TagConstant.GOV_TAG_KEY+key; @@ -89,10 +94,10 @@ public class TagRedis { if (objects.size()== NumConstant.ZERO){ return new ArrayList<>(); } - List result = new ArrayList(); + List result = new ArrayList(); ObjectMapper objectMapper = new ObjectMapper(); for (Object object : objects) { - TagInfoResultDto tagInfoResultDto = objectMapper.convertValue(object, TagInfoResultDto.class); + TagInfoResultDTO tagInfoResultDto = objectMapper.convertValue(object, TagInfoResultDTO.class); result.add(tagInfoResultDto); } return result; @@ -103,7 +108,7 @@ public class TagRedis { * @param key == gridId * @author zxc */ - public List zGridRevRange(String key){ + public List zGridRevRange(String key){ long start = 0; long end = -1; String tagKey = TagConstant.GRID_TAG_KEY+key; @@ -111,13 +116,47 @@ public class TagRedis { if (objects.size()== NumConstant.ZERO){ return new ArrayList<>(); } - List result = new ArrayList(); + List result = new ArrayList(); ObjectMapper objectMapper = new ObjectMapper(); for (Object object : objects) { - TagInfoResultDto tagInfoResultDto = objectMapper.convertValue(object, TagInfoResultDto.class); + TagInfoResultDTO tagInfoResultDto = objectMapper.convertValue(object, TagInfoResultDTO.class); result.add(tagInfoResultDto); } return result; } + /** + * @Description + * @param formDto + * @author zxc + */ + public List getResiTag(TagCascadeListFormDTO formDto){ + List tagIdList = formDto.getTagIdList(); + String gridId = formDto.getGridId(); + Set objects ; + Collection keys = new ArrayList<>(); + if (tagIdList.size() > 1){ + for (int i = NumConstant.ONE; i < tagIdList.size(); i++) { + String tagId = tagIdList.get(i); + tagId = TagConstant.GRID_RETAG_KEY+gridId+TagConstant.COLON+tagId; + keys.add(tagId); + } + String key = TagConstant.GRID_RETAG_KEY+gridId+TagConstant.COLON+tagIdList.get(0); + objects = redisUtils.sUnion(key, keys); + }else { + String key = TagConstant.GRID_RETAG_KEY+gridId+TagConstant.COLON+tagIdList.get(0); + objects = redisUtils.sMembers(key); + } + List resultList = new ArrayList<>(); + if (objects.size()==NumConstant.ZERO){ + return resultList; + } + ObjectMapper objectMapper = new ObjectMapper(); + for (Object object : objects) { + TagInfoResultDTO tagInfo = objectMapper.convertValue(object, TagInfoResultDTO.class); + resultList.add(tagInfo); + } + return resultList; + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagService.java index b0c4bcf534..b78a9f837a 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagService.java @@ -1,12 +1,11 @@ package com.epmet.service; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.dto.form.CorrelationTagListFormDto; -import com.epmet.dto.form.ResiTagListFormDto; -import com.epmet.dto.result.CorrelationTagListResultDto; -import com.epmet.dto.result.TagInfoResultDto; -import org.springframework.web.bind.annotation.RequestBody; +import com.epmet.dto.form.CorrelationTagListFormDTO; +import com.epmet.dto.form.ResiTagListFormDTO; +import com.epmet.dto.form.TagCascadeListFormDTO; +import com.epmet.dto.result.CorrelationTagListResultDTO; +import com.epmet.dto.result.TagInfoResultDTO; import java.util.List; @@ -17,14 +16,14 @@ public interface TagService { * @param tokenDto * @author zxc */ - List tagList(TokenDto tokenDto); + List tagList(TokenDto tokenDto); /** * @Description 已发布列表页的标签——居民端 * @param formDto * @author zxc */ - List resiTagList( ResiTagListFormDto formDto); + List resiTagList( ResiTagListFormDTO formDto); /** * @Description 已发布列表页-获取关联标签——政府端 @@ -32,6 +31,13 @@ public interface TagService { * @param formDto * @author zxc */ - List correlationTagList(TokenDto tokenDto, CorrelationTagListFormDto formDto); + List correlationTagList(TokenDto tokenDto, CorrelationTagListFormDTO formDto); + + /** + * @Description 标签级联查询——居民端 + * @param formDto + * @author zxc + */ + List tagCascadeList(TagCascadeListFormDTO formDto); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagServiceImpl.java index 83d66cd9cb..340516bfb6 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagServiceImpl.java @@ -3,11 +3,11 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dao.ArticleDao; -import com.epmet.dto.form.CorrelationTagListFormDto; -import com.epmet.dto.form.ResiTagListFormDto; -import com.epmet.dto.result.CorrelationTagListResultDto; -import com.epmet.dto.result.TagInfoResultDto; -import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.dto.form.CorrelationTagListFormDTO; +import com.epmet.dto.form.ResiTagListFormDTO; +import com.epmet.dto.form.TagCascadeListFormDTO; +import com.epmet.dto.result.CorrelationTagListResultDTO; +import com.epmet.dto.result.TagInfoResultDTO; import com.epmet.redis.TagRedis; import com.epmet.service.TagService; import org.springframework.beans.factory.annotation.Autowired; @@ -22,8 +22,6 @@ public class TagServiceImpl implements TagService { @Autowired private TagRedis tagRedis; @Autowired - private EpmetUserFeignClient epmetUserFeignClient; - @Autowired private ArticleDao articleDao; /** @@ -32,9 +30,9 @@ public class TagServiceImpl implements TagService { * @author zxc */ @Override - public List tagList(TokenDto tokenDto) { + public List tagList(TokenDto tokenDto) { String customerId = tokenDto.getCustomerId(); - List resultDtos = tagRedis.zRevRange(customerId); + List resultDtos = tagRedis.zRevRange(customerId); return resultDtos; } @@ -44,7 +42,7 @@ public class TagServiceImpl implements TagService { * @author zxc */ @Override - public List resiTagList(ResiTagListFormDto formDto) { + public List resiTagList(ResiTagListFormDTO formDto) { //校验 在本网格是否发布过文章 Integer articleCounts = articleDao.checkPublishArticle(formDto); if (articleCounts== NumConstant.ZERO){ @@ -60,8 +58,18 @@ public class TagServiceImpl implements TagService { * @author zxc */ @Override - public List correlationTagList(TokenDto tokenDto, CorrelationTagListFormDto formDto) { + public List correlationTagList(TokenDto tokenDto, CorrelationTagListFormDTO formDto) { String customerId = tokenDto.getCustomerId(); return tagRedis.get(customerId,formDto); } + + /** + * @Description 标签级联查询——居民端 + * @param formDto + * @author zxc + */ + @Override + public List tagCascadeList(TagCascadeListFormDTO formDto) { + return tagRedis.getResiTag(formDto); + } } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml index c41efbb8dd..6ec32143db 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml @@ -34,7 +34,7 @@ ORDER BY ac.ORDER_NUM ASC - SELECT COUNT(*) AS articleCounts FROM diff --git a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java deleted file mode 100644 index 6a084c31b3..0000000000 --- a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.epmet.dto.form; - -import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import java.io.Serializable; - -/** - * @Author zxc - * @CreateTime 2020/6/2 15:50 - */ -@Data -public class ResiTagListFormDto implements Serializable { - private static final long serialVersionUID = -794399801200532922L; - - public interface ResiTagList{} - public interface ResiTagListWeb extends CustomerClientShowGroup {} - - /** - * 网格id - */ - @NotBlank(message = "网格id不能为空",groups = {ResiTagList.class,ResiTagListWeb.class}) - private String gridId; - - /** - * 客户id - */ - private String customerId; - - /** - * 用户id - */ - private String userId; -} diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 3fa602cfea..acccfad232 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -1,11 +1,14 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.RequirePermission; +import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.form.ResiTagListFormDto; -import com.epmet.dto.result.TagInfoResultDto; +import com.epmet.dto.form.ResiTagListFormDTO; +import com.epmet.dto.form.TagCascadeListFormDTO; +import com.epmet.dto.result.TagInfoResultDTO; import com.epmet.service.ArticleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -28,9 +31,22 @@ public class ArticleController { * @author zxc */ @PostMapping("taglist") - public Result> resiTagList(@LoginUser TokenDto tokenDto, @RequestBody ResiTagListFormDto formDto){ - ValidatorUtils.validateEntity(formDto, ResiTagListFormDto.ResiTagList.class, ResiTagListFormDto.ResiTagListWeb.class); - return new Result>().ok(articleService.resiTagList(tokenDto,formDto)); +// @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISHED_LIST) + public Result> resiTagList(@LoginUser TokenDto tokenDto, @RequestBody ResiTagListFormDTO formDto){ + ValidatorUtils.validateEntity(formDto, ResiTagListFormDTO.ResiTagListForm.class); + return new Result>().ok(articleService.resiTagList(tokenDto,formDto)); + } + + /** + * @Description 标签级联查询——居民端 + * @param formDto + * @author zxc + */ + @PostMapping("tagcascadelist") +// @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISHED_LIST) + public Result> tagCascadeList(@LoginUser TokenDto tokenDto, @RequestBody TagCascadeListFormDTO formDto){ + ValidatorUtils.validateEntity(formDto, TagCascadeListFormDTO.TagCascadeList.class); + return new Result>().ok(articleService.tagCascadeList(tokenDto,formDto)); } } diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/ArticleService.java index 5d58c7f4cd..853e0a3579 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -1,8 +1,9 @@ package com.epmet.service; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.dto.form.ResiTagListFormDto; -import com.epmet.dto.result.TagInfoResultDto; +import com.epmet.dto.form.ResiTagListFormDTO; +import com.epmet.dto.form.TagCascadeListFormDTO; +import com.epmet.dto.result.TagInfoResultDTO; import java.util.List; @@ -17,5 +18,12 @@ public interface ArticleService { * @param formDto * @author zxc */ - List resiTagList(TokenDto tokenDto, ResiTagListFormDto formDto); + List resiTagList(TokenDto tokenDto, ResiTagListFormDTO formDto); + + /** + * @Description 标签级联查询——居民端 + * @param formDto + * @author zxc + */ + List tagCascadeList(TokenDto tokenDto, TagCascadeListFormDTO formDto); } diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index 96f8addfd4..7fb0e57bdb 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -2,14 +2,16 @@ package com.epmet.service.impl; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.feign.GovVoiceFeignClient; -import com.epmet.dto.form.ResiTagListFormDto; -import com.epmet.dto.result.TagInfoResultDto; +import com.epmet.dto.form.ResiTagListFormDTO; +import com.epmet.dto.form.TagCascadeListFormDTO; +import com.epmet.dto.result.TagInfoResultDTO; import com.epmet.service.ArticleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; + /** * @Author zxc * @CreateTime 2020/6/2 16:00 @@ -26,9 +28,20 @@ public class ArticleServiceImpl implements ArticleService { * @author zxc */ @Override - public List resiTagList(TokenDto tokenDto, ResiTagListFormDto formDto) { - formDto.setCustomerId(tokenDto.getCustomerId()); + public List resiTagList(TokenDto tokenDto, ResiTagListFormDTO formDto) { +// formDto.setCustomerId(tokenDto.getCustomerId()); formDto.setUserId(tokenDto.getUserId()); return govVoiceFeignClient.resiTagList(formDto).getData(); } + + /** + * @Description 标签级联查询——居民端 + * @param formDto + * @author zxc + */ + @Override + public List tagCascadeList(TokenDto tokenDto, TagCascadeListFormDTO formDto) { +// formDto.setCustomerId(tokenDto.getCustomerId()); + return govVoiceFeignClient.tagCascadeList(formDto).getData(); + } } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java deleted file mode 100644 index b06cfefc18..0000000000 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.epmet.feign; - -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.TagCustomerFormDTO; -import com.epmet.dto.result.CustomerStaffRoleResultDTO; -import com.epmet.dto.result.TagCustomerResultDTO; -import com.epmet.feign.fallback.EpmetUserFeignClientFallBack; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; - -import java.util.List; - -/** - * @Author zxc - * @CreateTime 2020/6/2 14:05 - * , url = "localhost:8087" - */ -//@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallBack.class, url = "localhost:8087") -@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallBack.class) -public interface EpmetUserFeignClient { - - /** - * @Description 根据userId获取customerId - * @param formDTO - * @author zxc - */ - @PostMapping("/epmetuser/user/getcustomeridbyuserid") - Result getCustomerIdByUserId(@RequestBody TagCustomerFormDTO formDTO); - - /** - * 根据staffId查询人员拥有的所有角色信息 - * @author zhaoqifeng - * @date 2020/6/2 16:11 - * @param staffId - * @return com.epmet.commons.tools.utils.Result> - */ - @PostMapping("/epmetuser/staffrole/staffroles/{staffId}") - Result> getStaffRoles(@PathVariable String staffId); - -} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java deleted file mode 100644 index cb1cc2e572..0000000000 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.epmet.feign.fallback; - -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.ModuleUtils; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.TagCustomerFormDTO; -import com.epmet.dto.result.CustomerStaffRoleResultDTO; -import com.epmet.dto.result.TagCustomerResultDTO; -import com.epmet.feign.EpmetUserFeignClient; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * @Description 居民端-陌生人导览 调用gov-org服务 - * @Author sun - * @Date 2020/3/16 - */ -@Component -public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { - - @Override - public Result getCustomerIdByUserId(TagCustomerFormDTO formDTO) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerIdByUserId", formDTO); - } - - @Override - public Result> getStaffRoles(String staffId) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffRoles", staffId); - } -} From 4042677aeccc085590443e931110035d8cc8dcbf Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Wed, 3 Jun 2020 18:23:55 +0800 Subject: [PATCH 26/54] =?UTF-8?q?DTO=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/form/CorrelationTagListFormDTO.java | 2 ++ .../main/java/com/epmet/dto/form/CorrelationTagListFormDto.java | 2 +- .../java/com/epmet/dto/result/CorrelationTagListResultDto.java | 2 +- .../src/main/java/com/epmet/dto/result/TagInfoResultDto.java | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDTO.java index 29a698f504..3756659ee4 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDTO.java @@ -1,6 +1,8 @@ package com.epmet.dto.form; import lombok.Data; + +import javax.validation.constraints.NotBlank; import java.io.Serializable; import java.util.List; diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDto.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDto.java index 7e8a638a28..3756659ee4 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDto.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDto.java @@ -11,7 +11,7 @@ import java.util.List; * @CreateTime 2020/6/3 9:39 */ @Data -public class CorrelationTagListFormDto implements Serializable { +public class CorrelationTagListFormDTO implements Serializable { private static final long serialVersionUID = -1588825995685146967L; diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDto.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDto.java index 51307547c7..c614999e66 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDto.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDto.java @@ -11,7 +11,7 @@ import java.io.Serializable; */ @JsonIgnoreProperties(ignoreUnknown = true) @Data -public class CorrelationTagListResultDto implements Serializable { +public class CorrelationTagListResultDTO implements Serializable { private static final long serialVersionUID = 5536953304816455733L; diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDto.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDto.java index f0470751e7..a547af8767 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDto.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDto.java @@ -11,7 +11,7 @@ import java.io.Serializable; */ @JsonIgnoreProperties(ignoreUnknown = true) @Data -public class TagInfoResultDto implements Serializable { +public class TagInfoResultDTO implements Serializable { private static final long serialVersionUID = 4366515668545958124L; From 05836da6690bcaf3f0d6a17b57d53dd2c92e493f Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Wed, 3 Jun 2020 18:30:13 +0800 Subject: [PATCH 27/54] dto --- .../dto/form/CorrelationTagListFormDto.java | 2 +- .../epmet/dto/form/ResiTagListFormDto.java | 37 ------------------- .../result/CorrelationTagListResultDto.java | 27 -------------- .../epmet/dto/result/TagInfoResultDto.java | 27 -------------- 4 files changed, 1 insertion(+), 92 deletions(-) delete mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java delete mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDto.java delete mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDto.java diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDto.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDto.java index 7e8a638a28..3756659ee4 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDto.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDto.java @@ -11,7 +11,7 @@ import java.util.List; * @CreateTime 2020/6/3 9:39 */ @Data -public class CorrelationTagListFormDto implements Serializable { +public class CorrelationTagListFormDTO implements Serializable { private static final long serialVersionUID = -1588825995685146967L; diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java deleted file mode 100644 index f91cb8f355..0000000000 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDto.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.epmet.dto.form; - -import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import java.io.Serializable; - -/** - * @Author zxc - * @CreateTime 2020/6/2 15:50 - */ -@Data -public class ResiTagListFormDTO implements Serializable { - - private static final long serialVersionUID = 4337657473061285656L; - - public interface ResiTagListForm{} - public interface ResiTagListFormWeb extends CustomerClientShowGroup{} - - /** - * 网格id - */ - @NotBlank(message = "网格id不能为空",groups = {ResiTagListForm.class}) - private String gridId; - - /** - * 用户id - */ - @NotBlank(message = "客户id不能为空",groups = {ResiTagListForm.class}) - private String customerId; - - /** - * 用户id - */ - private String userId; -} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDto.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDto.java deleted file mode 100644 index 51307547c7..0000000000 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDto.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.epmet.dto.result; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import lombok.Data; - -import java.io.Serializable; - -/** - * @Author zxc - * @CreateTime 2020/6/3 9:41 - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@Data -public class CorrelationTagListResultDto implements Serializable { - - private static final long serialVersionUID = 5536953304816455733L; - - /** - * 标签id - */ - private String tagId; - - /** - * 标签名称 - */ - private String tagName; -} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDto.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDto.java deleted file mode 100644 index f0470751e7..0000000000 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDto.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.epmet.dto.result; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import lombok.Data; - -import java.io.Serializable; - -/** - * @Author zxc - * @CreateTime 2020/6/2 9:47 - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@Data -public class TagInfoResultDto implements Serializable { - - private static final long serialVersionUID = 4366515668545958124L; - - /** - * 标签id - */ - private String tagId; - - /** - * 标签名称 - */ - private String tagName; -} From 1df1c4726a73b3ad918de67c7bf0d284ec9f1ffe Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Wed, 3 Jun 2020 18:33:08 +0800 Subject: [PATCH 28/54] dto --- .../result/CorrelationTagListResultDTO.java | 27 ------------------- .../epmet/dto/result/TagInfoResultDTO.java | 27 ------------------- 2 files changed, 54 deletions(-) delete mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDTO.java delete mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDTO.java diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDTO.java deleted file mode 100644 index c614999e66..0000000000 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDTO.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.epmet.dto.result; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import lombok.Data; - -import java.io.Serializable; - -/** - * @Author zxc - * @CreateTime 2020/6/3 9:41 - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@Data -public class CorrelationTagListResultDTO implements Serializable { - - private static final long serialVersionUID = 5536953304816455733L; - - /** - * 标签id - */ - private String tagId; - - /** - * 标签名称 - */ - private String tagName; -} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDTO.java deleted file mode 100644 index a547af8767..0000000000 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDTO.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.epmet.dto.result; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import lombok.Data; - -import java.io.Serializable; - -/** - * @Author zxc - * @CreateTime 2020/6/2 9:47 - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@Data -public class TagInfoResultDTO implements Serializable { - - private static final long serialVersionUID = 4366515668545958124L; - - /** - * 标签id - */ - private String tagId; - - /** - * 标签名称 - */ - private String tagName; -} From 49b0f51c383903f55ead52b557c67d0d4161ea3f Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Wed, 3 Jun 2020 18:34:48 +0800 Subject: [PATCH 29/54] dto --- .../epmet/dto/form/ResiTagListFormDTO.java | 37 +++++++++++++++++++ .../epmet/dto/result/TagInfoResultDto.java | 27 -------------- 2 files changed, 37 insertions(+), 27 deletions(-) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDTO.java delete mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDto.java diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDTO.java new file mode 100644 index 0000000000..f91cb8f355 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/2 15:50 + */ +@Data +public class ResiTagListFormDTO implements Serializable { + + private static final long serialVersionUID = 4337657473061285656L; + + public interface ResiTagListForm{} + public interface ResiTagListFormWeb extends CustomerClientShowGroup{} + + /** + * 网格id + */ + @NotBlank(message = "网格id不能为空",groups = {ResiTagListForm.class}) + private String gridId; + + /** + * 用户id + */ + @NotBlank(message = "客户id不能为空",groups = {ResiTagListForm.class}) + private String customerId; + + /** + * 用户id + */ + private String userId; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDto.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDto.java deleted file mode 100644 index a547af8767..0000000000 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDto.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.epmet.dto.result; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import lombok.Data; - -import java.io.Serializable; - -/** - * @Author zxc - * @CreateTime 2020/6/2 9:47 - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@Data -public class TagInfoResultDTO implements Serializable { - - private static final long serialVersionUID = 4366515668545958124L; - - /** - * 标签id - */ - private String tagId; - - /** - * 标签名称 - */ - private String tagName; -} From f991c6a18e4d0433479a12d71d72897fc18206b4 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Wed, 3 Jun 2020 18:35:58 +0800 Subject: [PATCH 30/54] dto --- .../epmet/dto/result/TagInfoResultDTO.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDTO.java diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDTO.java new file mode 100644 index 0000000000..a547af8767 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/2 9:47 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@Data +public class TagInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 4366515668545958124L; + + /** + * 标签id + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; +} From a2dec75f209e6433454a0cadfff3b0da5430918c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 3 Jun 2020 18:43:24 +0800 Subject: [PATCH 31/54] =?UTF-8?q?=E5=86=B2=E7=AA=81=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/CorrelationTagListFormDTO.java | 1 - .../dto/form/CorrelationTagListFormDto.java | 23 ------------------- ....java => CorrelationTagListResultDTO.java} | 0 3 files changed, 24 deletions(-) delete mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDto.java rename epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/{CorrelationTagListResultDto.java => CorrelationTagListResultDTO.java} (100%) diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDTO.java index 3756659ee4..335c18afdd 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDTO.java @@ -2,7 +2,6 @@ package com.epmet.dto.form; import lombok.Data; -import javax.validation.constraints.NotBlank; import java.io.Serializable; import java.util.List; diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDto.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDto.java deleted file mode 100644 index 3756659ee4..0000000000 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDto.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.epmet.dto.form; - -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import java.io.Serializable; -import java.util.List; - -/** - * @Author zxc - * @CreateTime 2020/6/3 9:39 - */ -@Data -public class CorrelationTagListFormDTO implements Serializable { - - private static final long serialVersionUID = -1588825995685146967L; - - /** - * 标签id集合 - */ - private List tagIdList; - -} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDto.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDTO.java similarity index 100% rename from epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDto.java rename to epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDTO.java From 1aa5fd6beea5f4770fc41c42b6432d34e349762f Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 3 Jun 2020 19:01:38 +0800 Subject: [PATCH 32/54] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=85=9A=E5=BB=BA=E5=A3=B0=E9=9F=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/constant/NumConstant.java | 1 + .../epmet/dto/form/ArticlePageFormDTO.java | 43 +++++ .../dto/form/CommonArticleListFormDTO.java | 34 ++++ .../dto/result/ArticleBannerResultDTO.java | 31 ++++ .../dto/result/ArticleContentResultDTO.java | 26 +++ .../dto/result/ArticleDetailResultDTO.java | 52 ++++++ .../dto/result/ArticleLatestResultDTO.java | 41 +++++ .../dto/result/ArticleListResultDTO.java | 46 +++++ .../epmet/controller/ArticleController.java | 43 +++++ .../main/java/com/epmet/dao/ArticleDao.java | 47 +++++ .../com/epmet/service/ArticleService.java | 33 ++++ .../service/impl/ArticleServiceImpl.java | 52 ++++++ .../src/main/resources/mapper/ArticleDao.xml | 169 ++++++++++++++++++ 13 files changed, 618 insertions(+) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticlePageFormDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleBannerResultDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleDetailResultDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleLatestResultDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleListResultDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java index 2e67bb3098..00c957c680 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java @@ -16,6 +16,7 @@ public interface NumConstant { int TWO = 2; int THREE = 3; int FOUR = 4; + int FIVE = 5; int SIX = 6; int SEVEN = 7; int EIGHT = 8; diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticlePageFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticlePageFormDTO.java new file mode 100644 index 0000000000..938349fbcc --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticlePageFormDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @ClassName ArticlePageFormDTO + * @Auth wangc + * @Date 2020-06-03 14:21 + */ + +@Data +public class ArticlePageFormDTO implements Serializable { + private static final long serialVersionUID = -6201259689082896334L; + + public interface ArticlePageInternalGroup{} + + /** + * 网格Id + * */ + @NotBlank(message = "网格Id不能为空" , groups = {ArticlePageInternalGroup.class}) + private String gridId; + + /** + * 标签Id集合 + * */ + private List tagIdList; + + /** + * 页码 + * */ + private Integer pageNo = 1; + + /** + * 每页显示量 + * */ + private Integer pageSize = 10; + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java new file mode 100644 index 0000000000..5602cabf48 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 居民端首页轮播查询接口DTO + * @ClassName ArticleBannerFormDTO + * @Auth wangc + * @Date 2020-06-02 11:20 + */ +@Data +public class CommonArticleListFormDTO implements Serializable { + private static final long serialVersionUID = 5996259506950697451L; + + /** + * 内部错误分组 + * */ + public interface ArticleBannerInternalGroup{} + + /** + * 网格Id + * */ + @NotBlank(message = "网格Id不能为空" , groups = {ArticleBannerInternalGroup.class}) + private String gridId; + + /** + * 客户定制化条数(高级配置里的参数) + * */ + private Integer num; + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleBannerResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleBannerResultDTO.java new file mode 100644 index 0000000000..c88dc10f22 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleBannerResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName ArticleBannerResultDTO + * @Auth wangc + * @Date 2020-06-02 13:55 + */ +@Data +public class ArticleBannerResultDTO implements Serializable { + private static final long serialVersionUID = 7764443348626371305L; + + /** + * 文章Id + * */ + private String articleId; + + /** + * 封面图url + * */ + private String coverImg; + + /** + * 标题 + * */ + private String title; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java new file mode 100644 index 0000000000..9b12f89213 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName ArticleContentResultDTO + * @Auth wangc + * @Date 2020-06-03 16:41 + */ +@Data +public class ArticleContentResultDTO implements Serializable { + private static final long serialVersionUID = 2853197212163051558L; + + /** + * 内容类型(图片:img;文字:text) + * */ + private String contentType; + + /** + * 内容 + * */ + private String content; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleDetailResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleDetailResultDTO.java new file mode 100644 index 0000000000..059772e738 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleDetailResultDTO.java @@ -0,0 +1,52 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @ClassName ArticleDetailResultDTO + * @Auth wangc + * @Date 2020-06-03 16:36 + */ +@Data +public class ArticleDetailResultDTO implements Serializable { + private static final long serialVersionUID = 4659147595194692686L; + + /** + * 文章Id + * */ + private String articleId; + + /** + * 文章标题 + * */ + private String articleTitle; + + /** + * 文章发布单位名称 + * */ + private String publishUnitDesc; + + /** + * 发布时间 + * */ + private String publishDate; + + /** + * 文章当前网格阅读量(article_visit_record统计数) + * */ + private Integer visitRecordCount; + + /** + * 标签名称集合(竖线分隔) + * */ + private String tags; + + /** + * 文章内容 + * */ + private List articleContentList; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleLatestResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleLatestResultDTO.java new file mode 100644 index 0000000000..ce5420f22e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleLatestResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName ArticleLatestResultDTO + * @Auth wangc + * @Date 2020-06-02 17:11 + */ +@Data +public class ArticleLatestResultDTO implements Serializable { + private static final long serialVersionUID = 6953266228209247094L; + + /** + * 文章Id + * */ + private String articleId; + + /** + * 文章封面图片url + * */ + private String articleCoverImg; + + /** + * 文章标题 + * */ + private String articleTitle; + + /** + * 发布单位名称 + * */ + private String publishName; + + /** + * 发布时间(天级别) 时间戳 + * */ + private String publishDate; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleListResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleListResultDTO.java new file mode 100644 index 0000000000..04d4f14a27 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleListResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName ArticleListResultDTO + * @Auth wangc + * @Date 2020-06-03 10:59 + */ +@Data +public class ArticleListResultDTO implements Serializable { + private static final long serialVersionUID = 293527138997974861L; + /** + * 文章Id + * */ + private String articleId; + + /** + * 文章标题 + * */ + private String articleTitle; + + /** + * 发布单位名称 + * */ + private String publishName; + + /** + * 发布时间(天级别) + * */ + private String publishDate; + + /** + * 文章发布内容(只截取前50字) + * */ + private String articleContent; + + /** + * 标签名称集合(竖线分隔) + * */ + private String tagName; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 081ecba72e..60cc6cb411 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -32,6 +32,11 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.ArticleDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.dto.form.ArticlePageFormDTO; +import com.epmet.dto.form.CommonArticleListFormDTO; +import com.epmet.dto.result.ArticleBannerResultDTO; +import com.epmet.dto.result.ArticleLatestResultDTO; +import com.epmet.dto.result.ArticleListResultDTO; import com.epmet.excel.ArticleExcel; import com.epmet.service.ArticleOperateRecordService; import com.epmet.service.ArticleService; @@ -284,4 +289,42 @@ public class ArticleController { ValidatorUtils.validateEntity(formDTO); return new Result().ok(articleService.offlineList(tokenDto, formDTO)); } + /** + * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.02 16:13 + **/ + @PostMapping("toparticlelist") + public Result> topArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO){ + ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); + return new Result>().ok(articleService.getTopArticleList(commonArticleListFormDTO)); + } + + /** + * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端首页最新文章列表 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.03 09:53 + **/ + @PostMapping("latestarticlemsg") + public Result> latestArticleMsg(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO){ + ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); + return new Result>().ok(articleService.getLatestArticleMsg(commonArticleListFormDTO)); + } + + /** + * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 + * @param articlePageFormDTO + * @return List + * @author wangc + * @date 2020.06.03 14:19 + **/ + @PostMapping("articlelist") + public Result> articleList(@RequestBody ArticlePageFormDTO articlePageFormDTO){ + ValidatorUtils.validateEntity(articlePageFormDTO,ArticlePageFormDTO.ArticlePageInternalGroup.class); + return new Result>().ok(articleService.getArticleList(articlePageFormDTO)); + } } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java index f65c49f289..fbb71c63ce 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java @@ -20,12 +20,19 @@ import com.epmet.dto.result.*; import com.epmet.dto.form.ResiTagListFormDTO; import com.epmet.dto.result.GovArticleContentDTO; import com.epmet.dto.result.GovArticleDetailResultDTO; +import com.epmet.dto.result.ArticleBannerResultDTO; +import com.epmet.dto.result.ArticleDetailResultDTO; +import com.epmet.dto.result.ArticleLatestResultDTO; +import com.epmet.dto.result.ArticleListResultDTO; import com.epmet.entity.ArticleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Set; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 文章表 @@ -90,4 +97,44 @@ public interface ArticleDao extends BaseDao { @DataFilter(tableAliases = "a", gridIdArgName = "gridList") List selectOfflineList(Set gridList); + + /** + * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 + * @param gridId + * @param num + * @return List + * @author wangc + * @date 2020.06.02 16:04 + **/ + List selectTopArticleMsg (@Param("gridId")String gridId,@Param("num")Integer num); + + /** + * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端最新文章列表 + * @param gridId + * @param num + * @return List + * @author wangc + * @date 2020.06.02 16:04 + **/ + List selectLatestArticleMsg(@Param("gridId")String gridId,@Param("num")Integer num); + + /** + * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 + * @param gridId + * @param tagIdList + * @return List + * @author wangc + * @date 2020.06.03 14:19 + **/ + List selectArticleList(@Param("gridId") String gridId,@Param("tagIdList")List tagIdList); + + /** + * @Description 查询文章详情 + * @param gridId + * @param articleId + * @return ArticleDetailResultDTO + * @author wangc + * @date 2020.06.03 18:28 + **/ + ArticleDetailResultDTO selectArticleDetail(@Param("gridId")String gridId,@Param("articleId")String articleId); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index c043203b9e..e925a7607c 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -25,8 +25,14 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.dto.result.GovArticleDetailResultDTO; import com.epmet.dto.result.PublishAgencyListResultDTO; +import com.epmet.dto.form.ArticlePageFormDTO; +import com.epmet.dto.form.CommonArticleListFormDTO; +import com.epmet.dto.result.ArticleBannerResultDTO; +import com.epmet.dto.result.ArticleLatestResultDTO; +import com.epmet.dto.result.ArticleListResultDTO; import com.epmet.entity.ArticleEntity; + import java.util.List; import java.util.Map; @@ -185,4 +191,31 @@ public interface ArticleService extends BaseService { * @author: jianjun liu */ Boolean publish(TokenDto tokenDto, String draftId); + + /** + * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.02 16:13 + **/ + List getTopArticleList(CommonArticleListFormDTO commonArticleListFormDTO); + + /** + * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端首页最新文章列表 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.03 09:53 + **/ + List getLatestArticleMsg(CommonArticleListFormDTO commonArticleListFormDTO); + + /** + * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 + * @param articlePageFormDTO + * @return List + * @author wangc + * @date 2020.06.03 14:19 + **/ + List getArticleList(ArticlePageFormDTO articlePageFormDTO); } \ No newline at end of file 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 4f36f362ee..dcdcf9daa5 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 @@ -44,6 +44,12 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.*; import com.epmet.feign.EpmetUserSelfFeignClient; +import com.epmet.dto.form.ArticlePageFormDTO; +import com.epmet.dto.form.CommonArticleListFormDTO; +import com.epmet.dto.result.ArticleBannerResultDTO; +import com.epmet.dto.result.ArticleLatestResultDTO; +import com.epmet.dto.result.ArticleListResultDTO; +import com.epmet.entity.ArticleEntity; import com.epmet.redis.ArticleRedis; import com.epmet.service.ArticleOperateRecordService; import com.epmet.service.ArticlePublishRangeService; @@ -51,6 +57,7 @@ import com.epmet.service.ArticleService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; +import com.epmet.service.ArticleVisitRecordService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -94,6 +101,10 @@ public class ArticleServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -589,4 +600,45 @@ public class ArticleServiceImpl extends BaseServiceImpl(resultList, pageInfo.getTotal()); } + /** + * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.02 16:13 + **/ + @Override + public List getTopArticleList(CommonArticleListFormDTO commonArticleListFormDTO) { + return baseDao.selectTopArticleMsg(commonArticleListFormDTO.getGridId(), + null == commonArticleListFormDTO.getNum() || commonArticleListFormDTO.getNum() <= NumConstant.ZERO ? + NumConstant.THREE : commonArticleListFormDTO.getNum()); + } + + /** + * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端首页最新文章列表 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.03 09:53 + **/ + @Override + public List getLatestArticleMsg(CommonArticleListFormDTO commonArticleListFormDTO) { + return baseDao.selectLatestArticleMsg(commonArticleListFormDTO.getGridId(), + null == commonArticleListFormDTO.getNum() || commonArticleListFormDTO.getNum() <= NumConstant.ZERO ? + NumConstant.FIVE : commonArticleListFormDTO.getNum()); + } + + /** + * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 + * @param articlePageFormDTO + * @return List + * @author wangc + * @date 2020.06.03 14:19 + **/ + @Override + public List getArticleList(ArticlePageFormDTO articlePageFormDTO) { + PageHelper.startPage(articlePageFormDTO.getPageNo(),articlePageFormDTO.getPageSize()); + return baseDao.selectArticleList(articlePageFormDTO.getGridId(),articlePageFormDTO.getTagIdList()); + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml index 6ec32143db..033ff015c9 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml @@ -98,4 +98,173 @@ AND a.STATUS_FLAG = 'offline' + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 7fc0f9fb2cd5cc318e31099d744f24f28020b6be Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 4 Jun 2020 09:48:42 +0800 Subject: [PATCH 33/54] =?UTF-8?q?=E5=85=9A=E5=BB=BA=E5=A3=B0=E9=9F=B3-?= =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF-=E4=B8=8B=E7=BA=BF=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-org/gov-org-client/pom.xml | 6 ++++ .../dto/feign/GovOrgSelfFeignClient.java | 11 ++---- .../GovOrgSelfFeignClientFallBack.java | 6 +--- .../dto/result/ArticleGridResultDTO.java | 12 +++++-- .../controller/CustomerAgencyController.java | 19 ++-------- .../epmet/service/CustomerAgencyService.java | 13 +------ .../impl/CustomerAgencyServiceImpl.java | 16 --------- .../resources/mapper/CustomerAgencyDao.xml | 4 ++- .../src/main/java/com/epmet/dto/form/.gitkeep | 0 .../epmet/dto/form/OffLineArticleFormDTO.java | 2 -- .../dto/form/PublishGridListFormDTO.java | 25 +++++++++++++ .../com/epmet/constant/ArticleConstant.java | 4 +-- .../epmet/controller/ArticleController.java | 14 +++++++- .../com/epmet/service/ArticleService.java | 8 +++++ .../service/impl/ArticleServiceImpl.java | 35 ++++++++++++++----- .../mapper/ArticlePublishRangeDao.xml | 7 +++- 16 files changed, 105 insertions(+), 77 deletions(-) delete mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/.gitkeep create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishGridListFormDTO.java diff --git a/epmet-module/gov-org/gov-org-client/pom.xml b/epmet-module/gov-org/gov-org-client/pom.xml index f97bdc99ad..124e7ca4a5 100644 --- a/epmet-module/gov-org/gov-org-client/pom.xml +++ b/epmet-module/gov-org/gov-org-client/pom.xml @@ -32,6 +32,12 @@ 2.0.0 compile + + com.epmet + gov-voice-client + 2.0.0 + compile + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java index 84e77dc8da..9cba1d736e 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java @@ -2,14 +2,15 @@ package com.epmet.dto.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.feign.fallback.GovOrgSelfFeignClientFallBack; +import com.epmet.dto.form.PublishGridListFormDTO; import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.dto.result.PublishAgencyListResultDTO; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; /** * @Description gov-org服务 @@ -36,12 +37,4 @@ public interface GovOrgSelfFeignClient { @PostMapping(value = "gov/org/customeragency/getpublishagencylist/{staffId}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result getPublishAgencyList(@PathVariable("staffId") String staffId); - /** - * @param staffId - * @return - * @Author sun - * @Description 根据工作人员Id查询对应的组织信息 - **/ - @PostMapping(value = "gov/org/customeragency/getagencybystaffId/{staffId}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) - Result getAgencyByStaffId(@PathVariable("staffId") String staffId); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java index c75f6e9257..b7c8924ea9 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java @@ -3,8 +3,8 @@ package com.epmet.dto.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.feign.GovOrgSelfFeignClient; +import com.epmet.dto.form.PublishGridListFormDTO; import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.dto.result.PublishAgencyListResultDTO; import org.springframework.stereotype.Component; @@ -26,8 +26,4 @@ public class GovOrgSelfFeignClientFallBack implements GovOrgSelfFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getPublishAgencyList", staffId); } - @Override - public Result getAgencyByStaffId(String staffId) { - return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyByStaffId", staffId); - } } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ArticleGridResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ArticleGridResultDTO.java index 2e83e432c3..8ab4f95bec 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ArticleGridResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ArticleGridResultDTO.java @@ -24,7 +24,7 @@ import java.util.List; /** - * 党建声音-可选发布范围-接口返参 + * 党建声音-可选发布范围、可下线网格列表-接口返参 * * @author sun */ @@ -50,8 +50,16 @@ public class ArticleGridResultDTO implements Serializable { */ private List subAgencyGridList; /** - * 所有上级机关Ids + * 上级组织机构ID + */ + private String pid = ""; + /** + * 所有上级组织机构ID(以英文:隔开) */ private String pids = ""; + /** + * 所有上级名称,以-连接 + */ + private String allParentName = ""; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index a5d236f972..6177a24ce6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -26,10 +26,7 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerAgencyDTO; -import com.epmet.dto.form.AgencyDeptGridFormDTO; -import com.epmet.dto.form.CanTickStaffListFormDTO; -import com.epmet.dto.form.StaffOrgFormDTO; -import com.epmet.dto.form.TransferOptionalStaffListFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.excel.CustomerAgencyExcel; import com.epmet.service.CustomerAgencyService; @@ -178,22 +175,10 @@ public class CustomerAgencyController { * @param staffId * @return * @Author sun - * @Description 党建声音-政府端-可选发布范围接口调用-根据人员角色查询对应的不同发布范围 + * @Description 党建声音-政府端-可选发布单位接口调用-根据人员角色查询对应的不同发布单位 **/ @PostMapping("getpublishagencylist/{staffId}") public Result getPublishAgencyList(@PathVariable("staffId") String staffId) { return new Result().ok(customerAgencyService.getPublishAgencyList(staffId)); } - - /** - * @param staffId - * @return - * @Author sun - * @Description 根据工作人员Id查询对应的组织信息 - **/ - @PostMapping("getagencybystaffId/{staffId}") - public Result getAgencyByStaffId(@PathVariable("staffId") String staffId) { - return new Result().ok(customerAgencyService.getAgencyByStaffId(staffId)); - } - } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index f7aeb9367e..66586aeec4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -21,10 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerAgencyDTO; -import com.epmet.dto.form.AgencyDeptGridFormDTO; -import com.epmet.dto.form.CanTickStaffListFormDTO; -import com.epmet.dto.form.StaffOrgFormDTO; -import com.epmet.dto.form.TransferOptionalStaffListFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; @@ -172,12 +169,4 @@ public interface CustomerAgencyService extends BaseService * @Description 党建声音-政府端-可选发布单位接口调用-根据人员角色查询对应的不同发布单位 **/ PublishAgencyListResultDTO getPublishAgencyList(String staffId); - - /** - * @param staffId - * @return - * @Author sun - * @Description 根据工作人员Id查询对应的组织信息 - **/ - CustomerAgencyDTO getAgencyByStaffId(String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 7172d74c7d..bebb36025d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -806,21 +806,5 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl gridIdList; - private String customerId; - private String staffId; } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishGridListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishGridListFormDTO.java new file mode 100644 index 0000000000..4d16716083 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishGridListFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 党建声音-可下线网格列表-接口入参 + * + * @author sun + */ +@Data +public class PublishGridListFormDTO implements Serializable { + private static final long serialVersionUID = -6659391832410565077L; + + public interface AddUserInternalGroup {} + + /** + * 文章Id + */ + @NotBlank(message = "文章id不能为空", groups = {PublishGridListFormDTO.AddUserInternalGroup.class}) + private String articleId; +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java index 4142598634..d2e2edecfb 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java @@ -36,7 +36,7 @@ public interface ArticleConstant { */ String SELECT_AGRNCY_EXCEPTION = "获取用户组织信息失败"; /** - * 下线文章(用于拼接操作表字段值) + * 下线文章操作记录表文案 */ - String OFF_LINE_ARTICLE = "下线文章"; + String OFF_LINE_ARTICLE_MSG = "%s-%s下线文章【%s】"; } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 60cc6cb411..859c696487 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -210,7 +210,6 @@ public class ArticleController { **/ @PostMapping("offlinearticle") public Result offLineArticle(@LoginUser TokenDto tokenDTO, @RequestBody OffLineArticleFormDTO formDTO) { - formDTO.setCustomerId(tokenDTO.getCustomerId()); formDTO.setStaffId(tokenDTO.getUserId()); ValidatorUtils.validateEntity(formDTO, OffLineArticleFormDTO.AddUserInternalGroup.class); articleService.offLineArticle(formDTO); @@ -327,4 +326,17 @@ public class ArticleController { ValidatorUtils.validateEntity(articlePageFormDTO,ArticlePageFormDTO.ArticlePageInternalGroup.class); return new Result>().ok(articleService.getArticleList(articlePageFormDTO)); } + + /** + * @param tokenDTO formDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可下线网格列表 + **/ + @PostMapping("publishgridlist") + public Result publishGridList(@LoginUser TokenDto tokenDTO, @RequestBody PublishGridListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PublishGridListFormDTO.AddUserInternalGroup.class); + return new Result().ok(articleService.publishGridList(formDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index e925a7607c..3e85e28dba 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -218,4 +218,12 @@ public interface ArticleService extends BaseService { * @date 2020.06.03 14:19 **/ List getArticleList(ArticlePageFormDTO articlePageFormDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可下线网格列表 + **/ + ArticleGridResultDTO publishGridList(PublishGridListFormDTO formDTO); } \ No newline at end of file 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 dcdcf9daa5..254b85d828 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 @@ -536,18 +536,14 @@ public class ArticleServiceImpl extends BaseServiceImpl resultAgency = govOrgSelfFeignClient.getAgencyByStaffId(formDTO.getStaffId()); - if (null == resultAgency.getData()) { - throw new RenException(ArticleConstant.SELECT_AGRNCY_EXCEPTION); - } - CustomerAgencyDTO agencyDTO = resultAgency.getData(); + //4.2:查询文章表数据 + ArticleEntity articleEntity = baseDao.selectById(formDTO.getArticleId()); //4.3:新增操作表数据 ArticleOperateRecordEntity recordEntity = new ArticleOperateRecordEntity(); - recordEntity.setCustomerId(formDTO.getCustomerId()); + recordEntity.setCustomerId(articleEntity.getCustomerId()); recordEntity.setArticleId(formDTO.getArticleId()); - recordEntity.setOpUser(agencyDTO.getOrganizationName() + "-" + staffDTO.getRealName()); - recordEntity.setContent(recordEntity.getOpUser() + ArticleConstant.OFF_LINE_ARTICLE); + recordEntity.setOpUser(articleEntity.getPublisherName() + "-" + staffDTO.getRealName()); + recordEntity.setContent(String.format(ArticleConstant.OFF_LINE_ARTICLE_MSG, articleEntity.getPublisherName(), staffDTO.getRealName(), articleEntity.getTitle())); recordEntity.setOpType(ArticleConstant.OFFLINE); recordEntity.setOpTime(date); articleOperateRecordService.insert(recordEntity); @@ -641,4 +637,25 @@ public class ArticleServiceImpl extends BaseServiceImpl rangeEntityList = articlePublishRangeDao.selectByArticleId(rangeEntity); + if(null==rangeEntityList||rangeEntityList.size() gridIdList = rangeEntityList.stream().map(ArticlePublishRangeEntity::getGridId).collect(Collectors.toList()); + formDTO.setGridIdList(gridIdList);*/ + + return null; + } } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.xml index ee2fa6bf60..0052c7414a 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.xml @@ -10,7 +10,12 @@ article_publish_range WHERE del_flag = '0' - AND article_id = #{articleId} + + AND article_id = #{articleId} + + + AND publish_status = #{publishStatus} + ORDER BY created_time ASC \ No newline at end of file From 4e0e6088fd94eb887a0c878009a57d82393124ed Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 4 Jun 2020 10:11:39 +0800 Subject: [PATCH 34/54] =?UTF-8?q?=E5=8F=91=E5=B8=83=E8=8C=83=E5=9B=B4?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E6=89=80=E6=9C=89=E4=B8=8A=E7=BA=A7?= =?UTF-8?q?=E7=BB=84=E7=BB=87=20id=E5=8F=8A=E5=90=8D=E7=A7=B0=20=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E5=BD=93=E5=89=8D=E7=BD=91=E6=A0=BC=E6=89=80=E5=9C=A8?= =?UTF-8?q?=E7=9A=84=E7=BB=84=E7=BB=87Id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/ArticlePublishRangeDTO.java | 15 +++++++++++++++ .../com/epmet/dto/DraftPublishRangeDTO.java | 15 +++++++++++++++ .../com/epmet/constant/DraftConstant.java | 11 +++++++++++ .../entity/ArticlePublishRangeEntity.java | 15 +++++++++++++++ .../epmet/entity/DraftPublishRangeEntity.java | 15 +++++++++++++++ .../resources/migration/epmet_gov_voice.sql | 19 +++++++++++++------ 6 files changed, 84 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticlePublishRangeDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticlePublishRangeDTO.java index 02106d920b..ace8e48edd 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticlePublishRangeDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticlePublishRangeDTO.java @@ -59,6 +59,21 @@ public class ArticlePublishRangeDTO implements Serializable { */ private String agencyGridName; + /** + * 组织ID + */ + private String agencyId; + + /** + * 所有上级组织机构ID 以英文:隔开 + */ + private String pids; + + /** + * 所有上级名称 以横杠隔开 + */ + private String allParentName; + /** * 下线时间 */ diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftPublishRangeDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftPublishRangeDTO.java index 8457b400ea..5bd39c480b 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftPublishRangeDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftPublishRangeDTO.java @@ -59,6 +59,21 @@ public class DraftPublishRangeDTO implements Serializable { */ private String agencyGridName; + /** + * 组织ID + */ + private String agencyId; + + /** + * 所有上级组织机构ID 以英文:隔开 + */ + private String pids; + + /** + * 所有上级名称 以横杠隔开 + */ + private String allParentName; + /** * 下线时间 */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java index dfab2106a0..26bbba7918 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java @@ -30,4 +30,15 @@ public interface DraftConstant { * 审核中:auditing */ String AUDITING = "auditing"; + + //是否置顶 + /** + * 置顶:1 + */ + Integer TOP = 1; + + /** + * 不置顶:0 + */ + Integer UN_TOP = 0; } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticlePublishRangeEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticlePublishRangeEntity.java index de4911067c..1328aa6f1e 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticlePublishRangeEntity.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticlePublishRangeEntity.java @@ -58,6 +58,21 @@ public class ArticlePublishRangeEntity extends BaseEpmetEntity { */ private String agencyGridName; + /** + * 组织ID + */ + private String agencyId; + + /** + * 所有上级组织机构ID 以英文:隔开 + */ + private String pids; + + /** + * 所有上级名称 以横杠隔开 + */ + private String allParentName; + /** * 下线时间 */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftPublishRangeEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftPublishRangeEntity.java index fb3233cbb1..861b80c239 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftPublishRangeEntity.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftPublishRangeEntity.java @@ -58,6 +58,21 @@ public class DraftPublishRangeEntity extends BaseEpmetEntity { */ private String agencyGridName; + /** + * 组织ID + */ + private String agencyId; + + /** + * 所有上级组织机构ID 以英文:隔开 + */ + private String pids; + + /** + * 所有上级名称 以横杠隔开 + */ + private String allParentName; + /** * 下线时间 */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql index a648a84f99..3e6b5f587d 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql @@ -75,13 +75,13 @@ CREATE TABLE draft( TITLE VARCHAR(128) NOT NULL COMMENT '文章标题' , PREVIEW_CONTENT VARCHAR(512) NOT NULL COMMENT '文章内容 精简内容' , IS_TOP INT NOT NULL COMMENT '是否置顶 1是;0否;' , - PUBLISH_RANGE_DESC VARCHAR(512) NOT NULL COMMENT '发布范围描述 所有发布范围集合,顿号隔开' , - PUBLISHER_ID VARCHAR(64) NOT NULL COMMENT '发布单位ID' , - PUBLISHER_NAME VARCHAR(128) NOT NULL COMMENT '发布单位名称' , - PUBLISHER_TYPE VARCHAR(32) NOT NULL COMMENT '发布单位类型 机关:agency;部门:department;网格:grid' , - PUBLISH_DATE DATE NOT NULL COMMENT '发布时间' , + PUBLISH_RANGE_DESC VARCHAR(512) COMMENT '发布范围描述 所有发布范围集合,顿号隔开' , + PUBLISHER_ID VARCHAR(64) COMMENT '发布单位ID' , + PUBLISHER_NAME VARCHAR(128) COMMENT '发布单位名称' , + PUBLISHER_TYPE VARCHAR(32) COMMENT '发布单位类型 机关:agency;部门:department;网格:grid' , + PUBLISH_DATE DATE COMMENT '发布时间' , STATUS_FLAG VARCHAR(32) NOT NULL COMMENT '发布状态 未发布:unpublish ;已发布:published,审核中:auditing;审核失败:auditfail' , - TAGS VARCHAR(512) NOT NULL COMMENT '文章标签串 竖杠分割的标签名称' , + TAGS VARCHAR(512) COMMENT '文章标签串 竖杠分割的标签名称' , ORG_ID VARCHAR(64) COMMENT '组织ID' , ORG_ID_PATH VARCHAR(512) COMMENT '组织ID路径 eg:字段为def:abc' , GRID_ID VARCHAR(64) COMMENT '网格ID 数据权限使用' , @@ -121,6 +121,9 @@ CREATE TABLE draft_publish_range( DRAFT_ID VARCHAR(64) NOT NULL COMMENT 'ID草稿' , GRID_ID VARCHAR(64) NOT NULL COMMENT '网格ID' , AGENCY_GRID_NAME VARCHAR(64) NOT NULL COMMENT '组织-网格名称' , + AGENCY_ID VARCHAR(64) NOT NULL COMMENT '组织ID' , + PIDS VARCHAR(1024) NOT NULL COMMENT '所有上级组织机构ID 以英文:隔开' , + ALL_PARENT_NAME VARCHAR(1024) NOT NULL COMMENT '所有上级名称 以横杠隔开' , OFF_LINE_TIME DATETIME COMMENT '下线时间' , PUBLISH_STATUS VARCHAR(32) NOT NULL COMMENT '发布状态 未发布:unpublish ;已发布:published' , DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , @@ -221,6 +224,9 @@ CREATE TABLE article_publish_range( ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , GRID_ID VARCHAR(64) NOT NULL COMMENT '网格ID' , AGENCY_GRID_NAME VARCHAR(64) NOT NULL COMMENT '组织-网格名称' , + AGENCY_ID VARCHAR(64) NOT NULL COMMENT '组织ID' , + PIDS VARCHAR(1024) NOT NULL COMMENT '所有上级组织机构ID 以英文:隔开' , + ALL_PARENT_NAME VARCHAR(1024) NOT NULL COMMENT '所有上级名称 以横杠隔开' , OFF_LINE_TIME DATETIME COMMENT '下线时间' , PUBLISH_STATUS VARCHAR(32) NOT NULL COMMENT '发布状态 已发布:published;已下线:offline' , DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , @@ -269,3 +275,4 @@ CREATE TABLE article_visit_record( ALTER TABLE article_visit_record ADD UNIQUE UNX_INDEX(ARTICLE_ID,GRID_ID,USER_ID); ALTER TABLE article_visit_record COMMENT '文章访问记录表'; + From 3919ca113feac5c4b34626e61f62824a77747b4d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 4 Jun 2020 10:15:40 +0800 Subject: [PATCH 35/54] =?UTF-8?q?=E8=A7=92=E8=89=B2=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/constant/EpmetRoleKeyConstant.java | 2 +- .../com/epmet/constant/RoleKeyConstants.java | 34 +++++++++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/EpmetRoleKeyConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/EpmetRoleKeyConstant.java index 4d11b57738..d4ec337c86 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/EpmetRoleKeyConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/EpmetRoleKeyConstant.java @@ -1,7 +1,7 @@ package com.epmet.commons.tools.constant; /** - * @Description + * @Description 居民端角色key * @Author yinzuomei * @Date 2020/3/30 16:38 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/RoleKeyConstants.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/RoleKeyConstants.java index 1bc1e03a24..4d82df0d1f 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/RoleKeyConstants.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/RoleKeyConstants.java @@ -1,17 +1,47 @@ package com.epmet.constant; /** - * 角色key常量 + * 政府端工作人员角色key常量 */ public class RoleKeyConstants { - + /** + * 管理员 + */ public static final String ROLE_KEY_MANAGER = "manager"; + + /** + * 党建负责人 + */ public static final String ROLE_KEY_PARTY_PRINCIPALS = "party_principals"; + + /** + * 网格长 + */ public static final String ROLE_KEY_GRID_MANAGER = "grid_manager"; + + /** + * 单位领导 + */ public static final String ROLE_KEY_AGENCY_LEADER = "agency_leader"; + + /** + * 网格党建指导员 + */ public static final String ROLE_KEY_GRID_PARTY_DIRECTOR = "grid_party_director"; + + /** + * 部门领导 + */ public static final String ROLE_KEY_DEPT_LEADER = "dept_leader"; + + /** + * 工作人员 + */ public static final String ROLE_KEY_STAFF = "staff"; + + /** + * 网格员 + */ public static final String ROLE_KEY_GRID_MEMBER = "grid_member"; } From d67ad398669899d6d7c62cf5037ef93dd76be863 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Thu, 4 Jun 2020 10:17:41 +0800 Subject: [PATCH 36/54] =?UTF-8?q?=E7=BA=A7=E8=81=94=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/RedisUtils.java | 25 +++- .../epmet/dto/result/TagRankResultDTO.java | 30 +++++ .../main/java/com/epmet/redis/TagRedis.java | 107 ++++++++++++++---- 3 files changed, 138 insertions(+), 24 deletions(-) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagRankResultDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java index e8cec08991..ba34e7ff6a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java @@ -15,10 +15,12 @@ import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactor import org.springframework.data.redis.core.HashOperations; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.data.redis.core.ZSetOperations; import org.springframework.data.redis.support.atomic.RedisAtomicLong; import org.springframework.stereotype.Component; import java.util.Collection; +import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit; @@ -276,16 +278,33 @@ public class RedisUtils { } /** - * @Description 获取key集合与多个集合的并集 + * @Description 获取key集合与多个集合的交集 * @param key * @param otherKeys * @author zxc */ - public Set sUnion(String key, Collection otherKeys) { - return redisTemplate.opsForSet().union(key, otherKeys); + public Set intersect(String key, Collection otherKeys) { + return redisTemplate.opsForSet().intersect(key, otherKeys); } + /** + * @Description 获取集合(set) + * @param key + * @author zxc + */ public Set sMembers(String key){ return redisTemplate.opsForSet().members(key); } + + /** + * @Description 获取 zset 中带score的集合 + * @param key + * @param start + * @param end + * @author zxc + */ + public Set> zReverseRangeWithScores(String key, long start, long end) { + Set> typedTuples = redisTemplate.opsForZSet().reverseRangeWithScores(key, start, end); + return typedTuples; + } } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagRankResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagRankResultDTO.java new file mode 100644 index 0000000000..5763ecddbd --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagRankResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/3 19:38 + */ +@Data +public class TagRankResultDTO implements Serializable { + + private static final long serialVersionUID = 4107657623174653243L; + + /** + * zSet排序 + */ + private Double score; + + /** + * 标签Id + */ + private String tagId; + + /** + * 标签名字 + */ + private String tagName; +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java index 9de49830ba..48dcb2a23c 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java @@ -24,14 +24,17 @@ import com.epmet.dto.form.CorrelationTagListFormDTO; import com.epmet.dto.form.TagCascadeListFormDTO; import com.epmet.dto.result.CorrelationTagListResultDTO; import com.epmet.dto.result.TagInfoResultDTO; +import com.epmet.dto.result.TagRankResultDTO; import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.poi.ss.formula.functions.T; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.ZSetOperations; import org.springframework.stereotype.Component; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Set; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; @Component public class TagRedis { @@ -56,6 +59,7 @@ public class TagRedis { List tagIdList = formDto.getTagIdList(); Set objects ; Collection keys = new ArrayList<>(); + //当查询关联标签数量大于1条时 if (tagIdList.size() > 1){ for (int i = NumConstant.ONE; i < tagIdList.size(); i++) { String tagId = tagIdList.get(i); @@ -63,8 +67,9 @@ public class TagRedis { keys.add(tagId); } String key = TagConstant.GOV_RETAG_KEY+customerId+TagConstant.COLON+tagIdList.get(0); - objects = redisUtils.sUnion(key, keys); + objects = redisUtils.intersect(key, keys); }else { + // 查询关联标签数量 等于1条时 String key = TagConstant.GOV_RETAG_KEY+customerId+TagConstant.COLON+tagIdList.get(0); objects = redisUtils.sMembers(key); } @@ -72,12 +77,37 @@ public class TagRedis { if (objects.size()==NumConstant.ZERO){ return resultList; } - ObjectMapper objectMapper = new ObjectMapper(); + //转换DTO for (Object object : objects) { - CorrelationTagListResultDTO correlationTag = objectMapper.convertValue(object, CorrelationTagListResultDTO.class); - resultList.add(correlationTag); + resultList.add(objectToDTO(object,CorrelationTagListResultDTO.class)); + } + //级联标签排序 + //1.取出 zset 中的有序标签,根据级联标签,筛选有序标签 + List resultEquals = new ArrayList<>(); + if (resultList.size() > NumConstant.ZERO) { + long start = 0; + long end = -1; + String customerKey = TagConstant.GOV_TAG_KEY + customerId; + Set> typedTuples = redisUtils.zReverseRangeWithScores(customerKey, start, end); + for (CorrelationTagListResultDTO correlationTagList : resultList) { + for (ZSetOperations.TypedTuple typedTuple : typedTuples) { + TagRankResultDTO tagRank = objectToDTO(typedTuple.getValue(), TagRankResultDTO.class); + tagRank.setScore(typedTuple.getScore()); + if (correlationTagList.getTagId().equals(tagRank.getTagId())){ + resultEquals.add(tagRank); + } + } + } + } + // 根据标签使用顺序倒叙 + List collect = resultEquals.stream().sorted(Comparator.comparing(TagRankResultDTO::getScore).reversed()).collect(Collectors.toList()); + List realResult = new ArrayList<>(); + for (TagRankResultDTO tagRankResultDTO : collect) { + CorrelationTagListResultDTO correlation = new CorrelationTagListResultDTO(); + BeanUtils.copyProperties(tagRankResultDTO,correlation); + realResult.add(correlation); } - return resultList; + return realResult; } @@ -95,10 +125,8 @@ public class TagRedis { return new ArrayList<>(); } List result = new ArrayList(); - ObjectMapper objectMapper = new ObjectMapper(); for (Object object : objects) { - TagInfoResultDTO tagInfoResultDto = objectMapper.convertValue(object, TagInfoResultDTO.class); - result.add(tagInfoResultDto); + result.add(objectToDTO(object,TagInfoResultDTO.class)); } return result; } @@ -117,16 +145,14 @@ public class TagRedis { return new ArrayList<>(); } List result = new ArrayList(); - ObjectMapper objectMapper = new ObjectMapper(); for (Object object : objects) { - TagInfoResultDTO tagInfoResultDto = objectMapper.convertValue(object, TagInfoResultDTO.class); - result.add(tagInfoResultDto); + result.add(objectToDTO(object,TagInfoResultDTO.class)); } return result; } /** - * @Description + * @Description 获取居民端级联标签——按照使用次数倒序 * @param formDto * @author zxc */ @@ -135,6 +161,7 @@ public class TagRedis { String gridId = formDto.getGridId(); Set objects ; Collection keys = new ArrayList<>(); + //当 级联标签大于1条的时候 if (tagIdList.size() > 1){ for (int i = NumConstant.ONE; i < tagIdList.size(); i++) { String tagId = tagIdList.get(i); @@ -142,8 +169,9 @@ public class TagRedis { keys.add(tagId); } String key = TagConstant.GRID_RETAG_KEY+gridId+TagConstant.COLON+tagIdList.get(0); - objects = redisUtils.sUnion(key, keys); + objects = redisUtils.intersect(key, keys); }else { + //当级联标签为一条时 String key = TagConstant.GRID_RETAG_KEY+gridId+TagConstant.COLON+tagIdList.get(0); objects = redisUtils.sMembers(key); } @@ -151,12 +179,49 @@ public class TagRedis { if (objects.size()==NumConstant.ZERO){ return resultList; } - ObjectMapper objectMapper = new ObjectMapper(); + //转换DTO for (Object object : objects) { - TagInfoResultDTO tagInfo = objectMapper.convertValue(object, TagInfoResultDTO.class); - resultList.add(tagInfo); + resultList.add(objectToDTO(object, TagInfoResultDTO.class)); + } + //级联标签排序 + //1.取出 zset 中的有序标签,根据级联标签,筛选有序标签 + List resultEquals = new ArrayList<>(); + if (resultList.size() > NumConstant.ZERO) { + long start = 0; + long end = -1; + String customerKey = TagConstant.GRID_TAG_KEY+formDto.getGridId(); + Set> typedTuples = redisUtils.zReverseRangeWithScores(customerKey, start, end); + for (TagInfoResultDTO tagInfo : resultList) { + for (ZSetOperations.TypedTuple typedTuple : typedTuples) { + TagRankResultDTO tagRank = objectToDTO(typedTuple.getValue(), TagRankResultDTO.class); + tagRank.setScore(typedTuple.getScore()); + if (tagInfo.getTagId().equals(tagRank.getTagId())){ + resultEquals.add(tagRank); + } + } + } + } + // 根据标签使用顺序倒叙 + List collect = resultEquals.stream().sorted(Comparator.comparing(TagRankResultDTO::getScore).reversed()).collect(Collectors.toList()); + List tagInfoResultList = new ArrayList<>(); + for (TagRankResultDTO tagRankResultDTO : collect) { + TagInfoResultDTO tagInfoResult = new TagInfoResultDTO(); + BeanUtils.copyProperties(tagRankResultDTO,tagInfoResult); + tagInfoResultList.add(tagInfoResult); } - return resultList; + return tagInfoResultList; + } + + /** + * @Description Object 转换 DTO + * @param o + * @param tClass + * @author zxc + */ + public T objectToDTO(Object o,Class tClass){ + ObjectMapper objectMapper = new ObjectMapper(); + T t = objectMapper.convertValue(o, tClass); + return t; } } \ No newline at end of file From 095c4de6f2ce52c47622ef3bff50cda753c7336f Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 4 Jun 2020 11:14:45 +0800 Subject: [PATCH 37/54] =?UTF-8?q?resihome=E3=80=81resivoice=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E8=B0=83=E7=94=A8govvoice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/feign/GovVoiceFeignClient.java | 48 +++++++++++++++- .../fallback/GovVoiceFeignClientFallBack.java | 25 ++++++++- .../epmet/dto/form/ArticlePageFormDTO.java | 2 +- .../dto/form/ResiArticleDetailFormDTO.java | 37 +++++++++++++ .../dto/result/ArticleDetailResultDTO.java | 7 +++ .../epmet/controller/ArticleController.java | 27 ++++++--- .../main/java/com/epmet/dao/ArticleDao.java | 2 +- .../com/epmet/service/ArticleService.java | 18 +++--- .../service/impl/ArticleServiceImpl.java | 38 ++++++++++++- .../impl/ArticleVisitRecordServiceImpl.java | 12 +++- .../java/com/epmet/utils/ModuleConstant.java | 52 ++++++++++++++++++ .../src/main/resources/mapper/ArticleDao.xml | 5 +- .../dto/form/CommonArticleListFormDTO.java | 34 ++++++++++++ .../dto/result/ArticleBannerResultDTO.java | 31 +++++++++++ .../dto/result/ArticleLatestResultDTO.java | 41 ++++++++++++++ .../resi-home/resi-home-server/pom.xml | 6 ++ .../com/epmet/controller/VoiceController.java | 43 ++++++++++++++- .../epmet/dto/form/ArticlePageFormDTO.java | 43 +++++++++++++++ .../dto/form/CommonArticleListFormDTO.java | 34 ++++++++++++ .../dto/form/ResiArticleDetailFormDTO.java | 37 +++++++++++++ .../dto/result/ArticleContentResultDTO.java | 26 +++++++++ .../dto/result/ArticleDetailResultDTO.java | 55 +++++++++++++++++++ .../dto/result/ArticleListResultDTO.java | 46 ++++++++++++++++ .../epmet/controller/ArticleController.java | 35 +++++++++++- 24 files changed, 672 insertions(+), 32 deletions(-) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiArticleDetailFormDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java create mode 100644 epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java create mode 100644 epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ArticleBannerResultDTO.java create mode 100644 epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ArticleLatestResultDTO.java create mode 100644 epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ArticlePageFormDTO.java create mode 100644 epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java create mode 100644 epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ResiArticleDetailFormDTO.java create mode 100644 epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java create mode 100644 epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleDetailResultDTO.java create mode 100644 epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleListResultDTO.java diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java index 189c43de65..f955e2b125 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java @@ -1,11 +1,11 @@ package com.epmet.dto.feign; + import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.feign.fallback.GovVoiceFeignClientFallBack; -import com.epmet.dto.form.ResiTagListFormDTO; -import com.epmet.dto.form.TagCascadeListFormDTO; -import com.epmet.dto.result.TagInfoResultDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -37,5 +37,47 @@ public interface GovVoiceFeignClient { @PostMapping("/gov/voice/tag/tagcascadelist") Result> tagCascadeList(@RequestBody TagCascadeListFormDTO formDto); + /** + * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.02 16:13 + **/ + @PostMapping("/gov/voice/article/resitoparticlelist") + Result> resiTopArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO); + + + + /** + * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端首页最新文章列表 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.03 09:53 + **/ + @PostMapping("/gov/voice/article/resilatestarticlelist") + Result> resiLatestArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO); + + + /** + * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 + * @param articlePageFormDTO + * @return List + * @author wangc + * @date 2020.06.03 14:19 + **/ + @PostMapping("/gov/voice/article/resiarticlelist") + Result> resiArticleList(@RequestBody ArticlePageFormDTO articlePageFormDTO); + + /** + * @Description 根绝文章Id查询出文章的内容、封面等相关信息,如果居民端传入的网格Id不在该文章的发布范围内,则返回NULL + * @param articleDetailFormDTO + * @return ArticleDetailResultDTO + * @author wangc + * @date 2020.06.03 18:28 + **/ + @PostMapping("/gov/voice/article/resiarticledetail") + Result resiArticleDetail(@RequestBody ResiArticleDetailFormDTO articleDetailFormDTO); } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/fallback/GovVoiceFeignClientFallBack.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/fallback/GovVoiceFeignClientFallBack.java index 25cafda2ba..3e707a86f6 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/fallback/GovVoiceFeignClientFallBack.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/fallback/GovVoiceFeignClientFallBack.java @@ -4,9 +4,8 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.feign.GovVoiceFeignClient; -import com.epmet.dto.form.ResiTagListFormDTO; -import com.epmet.dto.form.TagCascadeListFormDTO; -import com.epmet.dto.result.TagInfoResultDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; import org.springframework.stereotype.Component; import java.util.List; @@ -26,4 +25,24 @@ public class GovVoiceFeignClientFallBack implements GovVoiceFeignClient { public Result> tagCascadeList(TagCascadeListFormDTO formDto) { return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "tagCascadeList", formDto); } + + @Override + public Result> resiTopArticleList(CommonArticleListFormDTO commonArticleListFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "resiTopArticleList", commonArticleListFormDTO); + } + + @Override + public Result> resiLatestArticleList(CommonArticleListFormDTO commonArticleListFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "resiLatestArticleList", commonArticleListFormDTO); + } + + @Override + public Result> resiArticleList(ArticlePageFormDTO articlePageFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "resiArticleList", articlePageFormDTO); + } + + @Override + public Result resiArticleDetail(ResiArticleDetailFormDTO articleDetailFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "resiArticleDetail", articleDetailFormDTO); + } } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticlePageFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticlePageFormDTO.java index 938349fbcc..f15a296854 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticlePageFormDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticlePageFormDTO.java @@ -7,7 +7,7 @@ import java.io.Serializable; import java.util.List; /** - * @Description + * @Description 居民端查看文章列表参数DTO * @ClassName ArticlePageFormDTO * @Auth wangc * @Date 2020-06-03 14:21 diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiArticleDetailFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiArticleDetailFormDTO.java new file mode 100644 index 0000000000..87de7f5045 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiArticleDetailFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 居民端查看文章详情传参DTO + * @ClassName ResiArticleDetailFormDTO + * @Auth wangc + * @Date 2020-06-04 09:20 + */ +@Data +public class ResiArticleDetailFormDTO implements Serializable { + private static final long serialVersionUID = -7197489284630455909L; + + public interface ResiArticleDetailInternalGroup{} + + /** + * 网格Id + * */ + @NotBlank(message = "网格Id不能为空",groups = ResiArticleDetailInternalGroup.class) + private String gridId; + + /** + * 文章Id + * */ + @NotBlank(message = "文章Id不能为空",groups = ResiArticleDetailInternalGroup.class) + private String articleId; + + /** + * 用户Id + * */ + @NotBlank(message = "用户Id不能为空",groups = ResiArticleDetailInternalGroup.class) + private String userId; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleDetailResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleDetailResultDTO.java index 059772e738..be9299e914 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleDetailResultDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleDetailResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.Data; import java.io.Serializable; @@ -11,6 +12,7 @@ import java.util.List; * @Auth wangc * @Date 2020-06-03 16:36 */ +@JsonIgnoreProperties(ignoreUnknown = true) @Data public class ArticleDetailResultDTO implements Serializable { private static final long serialVersionUID = 4659147595194692686L; @@ -49,4 +51,9 @@ public class ArticleDetailResultDTO implements Serializable { * 文章内容 * */ private List articleContentList; + + /** + * 客户Id + * */ + private String customerId; } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 60cc6cb411..84e93b7568 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -296,8 +296,8 @@ public class ArticleController { * @author wangc * @date 2020.06.02 16:13 **/ - @PostMapping("toparticlelist") - public Result> topArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO){ + @PostMapping("resitoparticlelist") + public Result> resiTopArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO){ ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); return new Result>().ok(articleService.getTopArticleList(commonArticleListFormDTO)); } @@ -309,10 +309,10 @@ public class ArticleController { * @author wangc * @date 2020.06.03 09:53 **/ - @PostMapping("latestarticlemsg") - public Result> latestArticleMsg(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO){ + @PostMapping("resilatestarticlelist") + public Result> resiLatestArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO){ ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); - return new Result>().ok(articleService.getLatestArticleMsg(commonArticleListFormDTO)); + return new Result>().ok(articleService.getLatestArticleList(commonArticleListFormDTO)); } /** @@ -322,9 +322,22 @@ public class ArticleController { * @author wangc * @date 2020.06.03 14:19 **/ - @PostMapping("articlelist") - public Result> articleList(@RequestBody ArticlePageFormDTO articlePageFormDTO){ + @PostMapping("resiarticlelist") + public Result> resiArticleList(@RequestBody ArticlePageFormDTO articlePageFormDTO){ ValidatorUtils.validateEntity(articlePageFormDTO,ArticlePageFormDTO.ArticlePageInternalGroup.class); return new Result>().ok(articleService.getArticleList(articlePageFormDTO)); } + + /** + * @Description 根绝文章Id查询出文章的内容、封面等相关信息,如果居民端传入的网格Id不在该文章的发布范围内,则返回NULL + * @param articleDetailFormDTO + * @return ArticleDetailResultDTO + * @author wangc + * @date 2020.06.03 18:28 + **/ + @PostMapping("resiarticledetail") + public Result resiArticleDetail(@RequestBody ResiArticleDetailFormDTO articleDetailFormDTO){ + ValidatorUtils.validateEntity(articleDetailFormDTO,ResiArticleDetailFormDTO.ResiArticleDetailInternalGroup.class); + return new Result().ok(articleService.getArticleDetail(articleDetailFormDTO)); + } } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java index fbb71c63ce..57fa72015c 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java @@ -129,7 +129,7 @@ public interface ArticleDao extends BaseDao { List selectArticleList(@Param("gridId") String gridId,@Param("tagIdList")List tagIdList); /** - * @Description 查询文章详情 + * @Description 根绝文章Id查询出文章的内容、封面等相关信息,如果居民端传入的网格Id不在该文章的发布范围内,则返回NULL * @param gridId * @param articleId * @return ArticleDetailResultDTO diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index e925a7607c..7936148774 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -22,14 +22,9 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.ArticleDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.ArticleGridResultDTO; -import com.epmet.dto.result.GovArticleDetailResultDTO; -import com.epmet.dto.result.PublishAgencyListResultDTO; +import com.epmet.dto.result.*; import com.epmet.dto.form.ArticlePageFormDTO; import com.epmet.dto.form.CommonArticleListFormDTO; -import com.epmet.dto.result.ArticleBannerResultDTO; -import com.epmet.dto.result.ArticleLatestResultDTO; -import com.epmet.dto.result.ArticleListResultDTO; import com.epmet.entity.ArticleEntity; @@ -208,7 +203,7 @@ public interface ArticleService extends BaseService { * @author wangc * @date 2020.06.03 09:53 **/ - List getLatestArticleMsg(CommonArticleListFormDTO commonArticleListFormDTO); + List getLatestArticleList(CommonArticleListFormDTO commonArticleListFormDTO); /** * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 @@ -218,4 +213,13 @@ public interface ArticleService extends BaseService { * @date 2020.06.03 14:19 **/ List getArticleList(ArticlePageFormDTO articlePageFormDTO); + + /** + * @Description 根绝文章Id查询出文章的内容、封面等相关信息,如果居民端传入的网格Id不在该文章的发布范围内,则返回NULL + * @param articleDetailFormDTO + * @return ArticleDetailResultDTO + * @author wangc + * @date 2020.06.03 18:28 + **/ + ArticleDetailResultDTO getArticleDetail(ResiArticleDetailFormDTO articleDetailFormDTO); } \ No newline at end of file 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 dcdcf9daa5..b2ab64eb21 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 @@ -37,6 +37,7 @@ import com.epmet.constant.DraftConstant; import com.epmet.constant.RoleKeyConstants; import com.epmet.dao.*; import com.epmet.dto.ArticleDTO; +import com.epmet.dto.ArticleVisitRecordDTO; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.feign.GovOrgSelfFeignClient; @@ -54,6 +55,7 @@ import com.epmet.redis.ArticleRedis; import com.epmet.service.ArticleOperateRecordService; import com.epmet.service.ArticlePublishRangeService; import com.epmet.service.ArticleService; +import com.epmet.utils.ModuleConstant; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; @@ -622,7 +624,7 @@ public class ArticleServiceImpl extends BaseServiceImpl getLatestArticleMsg(CommonArticleListFormDTO commonArticleListFormDTO) { + public List getLatestArticleList(CommonArticleListFormDTO commonArticleListFormDTO) { return baseDao.selectLatestArticleMsg(commonArticleListFormDTO.getGridId(), null == commonArticleListFormDTO.getNum() || commonArticleListFormDTO.getNum() <= NumConstant.ZERO ? NumConstant.FIVE : commonArticleListFormDTO.getNum()); @@ -641,4 +643,38 @@ public class ArticleServiceImpl extends BaseServiceImpl params = new HashMap<>(); + params.put(ModuleConstant.FIELD_GRID_ID_CAMEL,articleDetailFormDTO.getGridId()); + params.put(ModuleConstant.FIELD_USER_ID_CAMEL,articleDetailFormDTO.getUserId()); + params.put(ModuleConstant.FIELD_ARTICLE_ID_CAMEL,articleDetailFormDTO.getArticleId()); + params.put(ModuleConstant.FIELD_CUSTOMER_ID_CAMEL,articleInfo.getCustomerId()); + params.put(FieldConstant.DEL_FLAG_HUMP,NumConstant.ZERO_STR); + List existedVisitRecord = articleVisitRecordService.list(params); + //3.没有则插入 + if(null == existedVisitRecord || existedVisitRecord.size() < NumConstant.ONE){ + ArticleVisitRecordEntity recordToInsert = new ArticleVisitRecordEntity(); + recordToInsert.setArticleId(articleDetailFormDTO.getArticleId()); + recordToInsert.setGridId(articleDetailFormDTO.getGridId()); + recordToInsert.setUserId(articleDetailFormDTO.getUserId()); + recordToInsert.setCustomerId(articleInfo.getCustomerId()); + articleVisitRecordService.insert(recordToInsert); + } + + return articleInfo; + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleVisitRecordServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleVisitRecordServiceImpl.java index dc622799f3..e0f5c0d74e 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleVisitRecordServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleVisitRecordServiceImpl.java @@ -28,11 +28,13 @@ import com.epmet.dto.ArticleVisitRecordDTO; import com.epmet.entity.ArticleVisitRecordEntity; import com.epmet.redis.ArticleVisitRecordRedis; import com.epmet.service.ArticleVisitRecordService; +import com.epmet.utils.ModuleConstant; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; + import java.util.Arrays; import java.util.List; import java.util.Map; @@ -67,10 +69,16 @@ public class ArticleVisitRecordServiceImpl extends BaseServiceImpl getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); - + String gridId = (String)params.get(ModuleConstant.FIELD_GRID_ID_CAMEL); + String userId = (String)params.get(ModuleConstant.FIELD_USER_ID_CAMEL); + String articleId = (String)params.get(ModuleConstant.FIELD_ARTICLE_ID_CAMEL); + String delFlag = (String)params.get(FieldConstant.DEL_FLAG_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - + wrapper.eq(StringUtils.isNotBlank(gridId),ModuleConstant.FIELD_GRID_ID,gridId); + wrapper.eq(StringUtils.isNotBlank(userId),ModuleConstant.FIELD_USER_ID,userId); + wrapper.eq(StringUtils.isNotBlank(articleId), ModuleConstant.FIELD_ARTICLE_ID,articleId); + wrapper.eq(StringUtils.isNotBlank(delFlag),FieldConstant.DEL_FLAG,delFlag); return wrapper; } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java new file mode 100644 index 0000000000..1aa334094d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java @@ -0,0 +1,52 @@ +package com.epmet.utils; + +/** + * 常量类 + * */ +public interface ModuleConstant { + /** + * 数据库列名 - 网格ID + * */ + String FIELD_GRID_ID = "GRID_ID"; + + /** + * 实体属性名 - 网格ID + * */ + String FIELD_GRID_ID_CAMEL = "gridId"; + + /** + * 数据库列名 - 客户ID + * */ + String FIELD_CUSTOMER_ID = "CUSTOMER_ID"; + + /** + * 实体属性名 - 客户ID + * */ + String FIELD_CUSTOMER_ID_CAMEL = "customerId"; + + /** + * 数据库列名 - 用户ID + * */ + String FIELD_USER_ID = "USER_ID"; + + /** + * 实体属性名 - 用户ID + * */ + String FIELD_USER_ID_CAMEL = "userId"; + + /** + * 数据库列名 - 文章ID + * */ + String FIELD_ARTICLE_ID = "ARTICLE_ID"; + + /** + * 实体属性名 - 文章ID + * */ + String FIELD_ARTICLE_ID_CAMEL = "articleId"; + + /** + * 文章未找到异常模板 + * */ + String SPECIFIED_ARTICLE_NOT_FOUND_EXCEPTION_TEMPLATE = "未找到指定文章,文章Id:【%s】,发布网格Id:【%s】,可能原因:没有该文章或者请求网格不在该文章发布范围内。"; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml index 033ff015c9..c41aafc19f 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml @@ -159,7 +159,7 @@ ARTICLE_COVER cover WHERE NOT EXISTS( - SELECT 1 FROM ARTICLE_COVER WHERE DEL_FLAG = '0' AND ARTICLE_ID = cover.ARTICLE_ID AND AUDIT_STATUS = 'pass' AND cover.CREATED_TIME < CREATED_TIME) + SELECT 1 FROM ARTICLE_COVER WHERE DEL_FLAG = '0' AND ARTICLE_ID = cover.ARTICLE_ID AND AUDIT_STATUS = 'pass' AND cover.CREATED_TIME CREATED_TIME) AND cover.DEL_FLAG = '0' AND cover.AUDIT_STATUS = 'pass' @@ -238,7 +238,8 @@ art.TAGS AS tags, content2.CONTENT, content2.CONTENT_TYPE, - (SELECT COUNT(1) FROM ARTICLE_VISIT_RECORD WHERE DEL_FLAG = '0' AND ARTICLE_ID = #{articleId} AND GRID_ID = #{gridId}) AS visitRecordCount + (SELECT COUNT(1) FROM ARTICLE_VISIT_RECORD WHERE DEL_FLAG = '0' AND ARTICLE_ID = #{articleId} AND GRID_ID = #{gridId}) AS visitRecordCount, + art.CUSTOMER_ID FROM ARTICLE art LEFT JOIN ( diff --git a/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java b/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java new file mode 100644 index 0000000000..5602cabf48 --- /dev/null +++ b/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 居民端首页轮播查询接口DTO + * @ClassName ArticleBannerFormDTO + * @Auth wangc + * @Date 2020-06-02 11:20 + */ +@Data +public class CommonArticleListFormDTO implements Serializable { + private static final long serialVersionUID = 5996259506950697451L; + + /** + * 内部错误分组 + * */ + public interface ArticleBannerInternalGroup{} + + /** + * 网格Id + * */ + @NotBlank(message = "网格Id不能为空" , groups = {ArticleBannerInternalGroup.class}) + private String gridId; + + /** + * 客户定制化条数(高级配置里的参数) + * */ + private Integer num; + +} diff --git a/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ArticleBannerResultDTO.java b/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ArticleBannerResultDTO.java new file mode 100644 index 0000000000..c88dc10f22 --- /dev/null +++ b/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ArticleBannerResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName ArticleBannerResultDTO + * @Auth wangc + * @Date 2020-06-02 13:55 + */ +@Data +public class ArticleBannerResultDTO implements Serializable { + private static final long serialVersionUID = 7764443348626371305L; + + /** + * 文章Id + * */ + private String articleId; + + /** + * 封面图url + * */ + private String coverImg; + + /** + * 标题 + * */ + private String title; +} diff --git a/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ArticleLatestResultDTO.java b/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ArticleLatestResultDTO.java new file mode 100644 index 0000000000..ce5420f22e --- /dev/null +++ b/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ArticleLatestResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName ArticleLatestResultDTO + * @Auth wangc + * @Date 2020-06-02 17:11 + */ +@Data +public class ArticleLatestResultDTO implements Serializable { + private static final long serialVersionUID = 6953266228209247094L; + + /** + * 文章Id + * */ + private String articleId; + + /** + * 文章封面图片url + * */ + private String articleCoverImg; + + /** + * 文章标题 + * */ + private String articleTitle; + + /** + * 发布单位名称 + * */ + private String publishName; + + /** + * 发布时间(天级别) 时间戳 + * */ + private String publishDate; +} diff --git a/epmet-module/resi-home/resi-home-server/pom.xml b/epmet-module/resi-home/resi-home-server/pom.xml index cb97219777..d95ed1fd32 100644 --- a/epmet-module/resi-home/resi-home-server/pom.xml +++ b/epmet-module/resi-home/resi-home-server/pom.xml @@ -62,6 +62,12 @@ 2.0.0 compile + + com.epmet + gov-voice-client + 2.0.0 + compile + diff --git a/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/VoiceController.java b/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/VoiceController.java index 7e05f3c359..da34a9f1e0 100644 --- a/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/VoiceController.java +++ b/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/VoiceController.java @@ -1,11 +1,50 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.feign.GovVoiceFeignClient; +import com.epmet.dto.form.CommonArticleListFormDTO; +import com.epmet.dto.result.ArticleBannerResultDTO; +import com.epmet.dto.result.ArticleLatestResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RestController @RequestMapping("voice") public class VoiceController { - //最新党建声音列表 - //首页轮播图列表 + + @Autowired + private GovVoiceFeignClient govVoiceFeignClient; + + /** + * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.02 16:13 + **/ + @PostMapping("toparticlelist") + public Result> topArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO){ + ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); + return govVoiceFeignClient.resiTopArticleList(commonArticleListFormDTO); + } + + /** + * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端首页最新文章列表 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.03 09:53 + **/ + @PostMapping("latestarticlelist") + public Result> latestArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO){ + ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); + return govVoiceFeignClient.resiLatestArticleList(commonArticleListFormDTO); + } + } diff --git a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ArticlePageFormDTO.java b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ArticlePageFormDTO.java new file mode 100644 index 0000000000..f15a296854 --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ArticlePageFormDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 居民端查看文章列表参数DTO + * @ClassName ArticlePageFormDTO + * @Auth wangc + * @Date 2020-06-03 14:21 + */ + +@Data +public class ArticlePageFormDTO implements Serializable { + private static final long serialVersionUID = -6201259689082896334L; + + public interface ArticlePageInternalGroup{} + + /** + * 网格Id + * */ + @NotBlank(message = "网格Id不能为空" , groups = {ArticlePageInternalGroup.class}) + private String gridId; + + /** + * 标签Id集合 + * */ + private List tagIdList; + + /** + * 页码 + * */ + private Integer pageNo = 1; + + /** + * 每页显示量 + * */ + private Integer pageSize = 10; + +} diff --git a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java new file mode 100644 index 0000000000..5602cabf48 --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 居民端首页轮播查询接口DTO + * @ClassName ArticleBannerFormDTO + * @Auth wangc + * @Date 2020-06-02 11:20 + */ +@Data +public class CommonArticleListFormDTO implements Serializable { + private static final long serialVersionUID = 5996259506950697451L; + + /** + * 内部错误分组 + * */ + public interface ArticleBannerInternalGroup{} + + /** + * 网格Id + * */ + @NotBlank(message = "网格Id不能为空" , groups = {ArticleBannerInternalGroup.class}) + private String gridId; + + /** + * 客户定制化条数(高级配置里的参数) + * */ + private Integer num; + +} diff --git a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ResiArticleDetailFormDTO.java b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ResiArticleDetailFormDTO.java new file mode 100644 index 0000000000..87de7f5045 --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ResiArticleDetailFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 居民端查看文章详情传参DTO + * @ClassName ResiArticleDetailFormDTO + * @Auth wangc + * @Date 2020-06-04 09:20 + */ +@Data +public class ResiArticleDetailFormDTO implements Serializable { + private static final long serialVersionUID = -7197489284630455909L; + + public interface ResiArticleDetailInternalGroup{} + + /** + * 网格Id + * */ + @NotBlank(message = "网格Id不能为空",groups = ResiArticleDetailInternalGroup.class) + private String gridId; + + /** + * 文章Id + * */ + @NotBlank(message = "文章Id不能为空",groups = ResiArticleDetailInternalGroup.class) + private String articleId; + + /** + * 用户Id + * */ + @NotBlank(message = "用户Id不能为空",groups = ResiArticleDetailInternalGroup.class) + private String userId; +} diff --git a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java new file mode 100644 index 0000000000..9b12f89213 --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName ArticleContentResultDTO + * @Auth wangc + * @Date 2020-06-03 16:41 + */ +@Data +public class ArticleContentResultDTO implements Serializable { + private static final long serialVersionUID = 2853197212163051558L; + + /** + * 内容类型(图片:img;文字:text) + * */ + private String contentType; + + /** + * 内容 + * */ + private String content; +} diff --git a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleDetailResultDTO.java b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleDetailResultDTO.java new file mode 100644 index 0000000000..30adfb5e3e --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleDetailResultDTO.java @@ -0,0 +1,55 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @ClassName ArticleDetailResultDTO + * @Auth wangc + * @Date 2020-06-03 16:36 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@Data +public class ArticleDetailResultDTO implements Serializable { + private static final long serialVersionUID = 4659147595194692686L; + + /** + * 文章Id + * */ + private String articleId; + + /** + * 文章标题 + * */ + private String articleTitle; + + /** + * 文章发布单位名称 + * */ + private String publishUnitDesc; + + /** + * 发布时间 + * */ + private String publishDate; + + /** + * 文章当前网格阅读量(article_visit_record统计数) + * */ + private Integer visitRecordCount; + + /** + * 标签名称集合(竖线分隔) + * */ + private String tags; + + /** + * 文章内容 + * */ + private List articleContentList; + +} diff --git a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleListResultDTO.java b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleListResultDTO.java new file mode 100644 index 0000000000..04d4f14a27 --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleListResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName ArticleListResultDTO + * @Auth wangc + * @Date 2020-06-03 10:59 + */ +@Data +public class ArticleListResultDTO implements Serializable { + private static final long serialVersionUID = 293527138997974861L; + /** + * 文章Id + * */ + private String articleId; + + /** + * 文章标题 + * */ + private String articleTitle; + + /** + * 发布单位名称 + * */ + private String publishName; + + /** + * 发布时间(天级别) + * */ + private String publishDate; + + /** + * 文章发布内容(只截取前50字) + * */ + private String articleContent; + + /** + * 标签名称集合(竖线分隔) + * */ + private String tagName; + +} diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java index acccfad232..9096383be1 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -6,9 +6,9 @@ import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.form.ResiTagListFormDTO; -import com.epmet.dto.form.TagCascadeListFormDTO; -import com.epmet.dto.result.TagInfoResultDTO; +import com.epmet.dto.feign.GovVoiceFeignClient; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; import com.epmet.service.ArticleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -24,6 +24,8 @@ public class ArticleController { @Autowired private ArticleService articleService; + @Autowired + private GovVoiceFeignClient govVoiceFeignClient; /** * @Description 首页标签及更多——居民端 @@ -49,4 +51,31 @@ public class ArticleController { return new Result>().ok(articleService.tagCascadeList(tokenDto,formDto)); } + /** + * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 + * @param articlePageFormDTO + * @return List + * @author wangc + * @date 2020.06.03 14:19 + **/ + @PostMapping("articlelist") + public Result> articleList(@RequestBody ArticlePageFormDTO articlePageFormDTO){ + ValidatorUtils.validateEntity(articlePageFormDTO,ArticlePageFormDTO.ArticlePageInternalGroup.class); + return govVoiceFeignClient.resiArticleList(articlePageFormDTO); + } + + /** + * @Description 根绝文章Id查询出文章的内容、封面等相关信息,如果居民端传入的网格Id不在该文章的发布范围内,则返回NULL + * @param articleDetailFormDTO + * @return ArticleDetailResultDTO + * @author wangc + * @date 2020.06.03 18:28 + **/ + @PostMapping("articledetail") + public Result articleDetail(@LoginUser TokenDto tokenDto,@RequestBody ResiArticleDetailFormDTO articleDetailFormDTO){ + articleDetailFormDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(articleDetailFormDTO,ResiArticleDetailFormDTO.ResiArticleDetailInternalGroup.class); + return govVoiceFeignClient.resiArticleDetail(articleDetailFormDTO); + } + } From 90b2fa79aa7df76602b9cdd3d25c221d81f4949e Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 4 Jun 2020 12:11:54 +0800 Subject: [PATCH 38/54] =?UTF-8?q?=E6=96=87=E7=AB=A0=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=98=85=E8=AF=BB=E9=87=8F+1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/ArticleServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) 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 d9a4c4852e..c7c4786fe6 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 @@ -689,6 +689,8 @@ public class ArticleServiceImpl extends BaseServiceImpl Date: Thu, 4 Jun 2020 12:40:04 +0800 Subject: [PATCH 39/54] =?UTF-8?q?=E8=8D=89=E7=A8=BF=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/DraftAttrFromDTO.java | 7 ++- .../service/impl/ArticleServiceImpl.java | 45 +++++++------------ .../java/com/epmet/ArticleServiceTest.java | 3 +- 3 files changed, 24 insertions(+), 31 deletions(-) diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java index 42d31c7475..1a81faee29 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java @@ -68,10 +68,15 @@ public class DraftAttrFromDTO implements Serializable { */ private String publisher; + /** + * 发布单位名称 + */ + private String publisherName; + /** * 发布日期 */ - @NotBlank(message = "发布时间不能为空") + @NotBlank(message = "发布日期不能为空") private String publishDate; /** 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 c7c4786fe6..20ed5d4b1a 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 @@ -45,21 +45,15 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.*; import com.epmet.feign.EpmetUserSelfFeignClient; -import com.epmet.dto.form.ArticlePageFormDTO; -import com.epmet.dto.form.CommonArticleListFormDTO; -import com.epmet.dto.result.ArticleBannerResultDTO; -import com.epmet.dto.result.ArticleLatestResultDTO; -import com.epmet.dto.result.ArticleListResultDTO; -import com.epmet.entity.ArticleEntity; import com.epmet.redis.ArticleRedis; import com.epmet.service.ArticleOperateRecordService; import com.epmet.service.ArticlePublishRangeService; import com.epmet.service.ArticleService; import com.epmet.utils.ModuleConstant; +import com.epmet.service.ArticleVisitRecordService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; -import com.epmet.service.ArticleVisitRecordService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -205,20 +199,12 @@ public class ArticleServiceImpl extends BaseServiceImpldraftPublishRangeDao.insert(publishRange)); } diff --git a/epmet-module/gov-voice/gov-voice-server/src/test/java/com/epmet/ArticleServiceTest.java b/epmet-module/gov-voice/gov-voice-server/src/test/java/com/epmet/ArticleServiceTest.java index 227f6bf8a6..bf88b68040 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/test/java/com/epmet/ArticleServiceTest.java +++ b/epmet-module/gov-voice/gov-voice-server/src/test/java/com/epmet/ArticleServiceTest.java @@ -1,5 +1,6 @@ package com.epmet; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.constant.DraftConstant; import com.epmet.dto.form.DraftAttrFromDTO; import com.epmet.dto.form.DraftContentFromDTO; import com.epmet.service.ArticleService; @@ -53,7 +54,7 @@ public class ArticleServiceTest { draftAttrFromDTO.setDraftId("f93b9fa4e78eadc97164fb5203aa580a"); draftAttrFromDTO.setCoverImg("http://www.baidu.com"); draftAttrFromDTO.setTagNameList(Arrays.asList("标签1","标签2")); - draftAttrFromDTO.setIsTop(0); + draftAttrFromDTO.setIsTop(DraftConstant.UN_TOP); draftAttrFromDTO.setGridIdList(Arrays.asList("b3f5c5464ad3634982116c174b22ee35")); draftAttrFromDTO.setPublisher("1"); draftAttrFromDTO.setPublishDate("2020-06-03"); From 97639af40283122cc232bd116d3b769f46b0eee6 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 4 Jun 2020 13:00:00 +0800 Subject: [PATCH 40/54] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8E=9F=E6=9D=A5?= =?UTF-8?q?=E7=9A=84CommonFeignClient=E6=94=B9=E4=B8=BAEpmetCommonServiceO?= =?UTF-8?q?penFeignClient?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EpmetCommonServiceOpenFeignClient.java | 31 +++++++++++++++++++ ...tCommonServiceOpenFeignClientFallback.java | 25 +++++++++++++++ .../com/epmet/feign/CommonFeignClient.java | 23 -------------- .../fallback/CommonFeignClientFallBack.java | 24 -------------- .../service/impl/ProjectServiceImpl.java | 6 ++-- 5 files changed, 59 insertions(+), 50 deletions(-) create mode 100644 epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java create mode 100644 epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java delete mode 100644 epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/CommonFeignClient.java delete mode 100644 epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/fallback/CommonFeignClientFallBack.java diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java new file mode 100644 index 0000000000..be5117fbf1 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java @@ -0,0 +1,31 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.WorkDayFormDTO; +import com.epmet.dto.result.WorkDayResultDTO; +import com.epmet.feign.fallback.EpmetCommonServiceOpenFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 10:28 + */ +@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class) +public interface EpmetCommonServiceOpenFeignClient { + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei@elink-cn.com + * @description 根据起止时间,计算工作日 + * @date 2020/6/4 10:44 + **/ + @PostMapping("commonservice/workday/detentiondays") + Result> detentionDays(@RequestBody List formDTO); +} diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java new file mode 100644 index 0000000000..2a83a94bfc --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java @@ -0,0 +1,25 @@ +package com.epmet.feign.fallback; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.WorkDayFormDTO; +import com.epmet.dto.result.WorkDayResultDTO; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 10:32 + */ +@Component +public class EpmetCommonServiceOpenFeignClientFallback implements EpmetCommonServiceOpenFeignClient { + @Override + public Result> detentionDays(List formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "detentionDays", formDTO); + } +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/CommonFeignClient.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/CommonFeignClient.java deleted file mode 100644 index 10ed3733c3..0000000000 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/CommonFeignClient.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.epmet.feign; - -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.WorkDayFormDTO; -import com.epmet.dto.result.WorkDayResultDTO; -import com.epmet.feign.fallback.CommonFeignClientFallBack; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; - -import java.util.List; - -/** - * @author zhaoqifeng - * @dscription - * @date 2020/5/12 15:48 - */ -@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = CommonFeignClientFallBack.class) -public interface CommonFeignClient { - @PostMapping("commonservice/workday/detentiondays") - Result> detentionDays(@RequestBody List formDTO); -} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/fallback/CommonFeignClientFallBack.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/fallback/CommonFeignClientFallBack.java deleted file mode 100644 index 0d7aa93769..0000000000 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/fallback/CommonFeignClientFallBack.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.epmet.feign.fallback; - -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.ModuleUtils; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.WorkDayFormDTO; -import com.epmet.dto.result.WorkDayResultDTO; -import com.epmet.feign.CommonFeignClient; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * @author zhaoqifeng - * @dscription - * @date 2020/5/12 15:51 - */ -@Component -public class CommonFeignClientFallBack implements CommonFeignClient { - @Override - public Result> detentionDays(List formDTO) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "detentionDays", formDTO); - } -} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 2b55312a72..29a964851f 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -40,7 +40,7 @@ import com.epmet.entity.ProjectEntity; import com.epmet.entity.ProjectProcessEntity; import com.epmet.entity.ProjectRelatedPersonnelEntity; import com.epmet.entity.ProjectStaffEntity; -import com.epmet.feign.CommonFeignClient; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.GovOrgFeignClient; import com.epmet.feign.MessageFeignClient; @@ -69,7 +69,7 @@ public class ProjectServiceImpl extends BaseServiceImpl> detentionDays = commonFeignClient.detentionDays(list); + Result> detentionDays = epmetCommonServiceOpenFeignClient.detentionDays(list); return detentionDays.getData().get(NumConstant.ZERO).getDetentionDays(); } From 22cf4dbe1a4bea43147d0f7f7cb96afed99d2fb5 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 4 Jun 2020 15:05:59 +0800 Subject: [PATCH 41/54] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF-=E5=85=9A?= =?UTF-8?q?=E5=BB=BA=E5=A3=B0=E9=9F=B3=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../filter/CpAuthGatewayFilterFactory.java | 9 ++++--- .../service/impl/ArticleServiceImpl.java | 1 + .../impl/ArticleVisitRecordServiceImpl.java | 2 ++ .../src/main/resources/mapper/ArticleDao.xml | 26 +++++++++++-------- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java index 22ac52df2f..135398f025 100644 --- a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java +++ b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java @@ -117,14 +117,17 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -79,6 +80,7 @@ public class ArticleVisitRecordServiceImpl extends BaseServiceImpl @@ -145,7 +145,7 @@ SELECT art.ID AS articleId, art.TITLE AS articleTitle , - artcover.IMG_URL AS articleCoverImg, + IFNULL(artcover.IMG_URL,'') AS articleCoverImg, art.PUBLISHER_NAME AS publishName, art.PUBLISH_DATE AS publishDate FROM @@ -177,7 +177,7 @@ AND art.STATUS_FLAG = 'published' - ORDER BY art.PUBLISH_DATE , art.CREATED_TIME DESC + ORDER BY art.PUBLISH_DATE DESC , art.CREATED_TIME DESC LIMIT #{num} @@ -188,8 +188,8 @@ art.TITLE AS articleTitle, art.PUBLISHER_NAME AS publishName, art.PUBLISH_DATE AS publishDate, - art.PREVIEW_CONTENT AS articleContent, - art.TAGS AS tagName + IFNULL(art.PREVIEW_CONTENT,'') AS articleContent, + IFNULL(art.TAGS,'') AS tagName FROM ARTICLE art INNER JOIN ARTICLE_PUBLISH_RANGE prange @@ -204,15 +204,18 @@ art.DEL_FLAG = '0' AND art.STATUS_FLAG = 'published' - + + AND EXISTS( SELECT 1 FROM ARTICLE_TAGS WHERE DEL_FLAG = '0' AND ARTICLE_ID = art.ID AND TAG_ID=#{tagId} + ) + ORDER BY art.PUBLISH_DATE DESC , art.CREATED_TIME DESC @@ -222,6 +225,7 @@ + @@ -235,7 +239,7 @@ art.TITLE AS articleTitle, art.PUBLISHER_NAME AS publishUnitDesc, art.PUBLISH_DATE AS publishDate, - art.TAGS AS tags, + IFNULL(art.TAGS,'') AS tags, content2.CONTENT, content2.CONTENT_TYPE, (SELECT COUNT(1) FROM ARTICLE_VISIT_RECORD WHERE DEL_FLAG = '0' AND ARTICLE_ID = #{articleId} AND GRID_ID = #{gridId}) AS visitRecordCount, @@ -252,8 +256,8 @@ ARTICLE_CONTENT content WHERE DEL_FLAG = '0' - AND ARTICLE_ID = #{aritcleId} - AND NOT EXISTS ( SELECT 1 FROM ARTICLE_CONTENT WHERE DEL_FLAG = '0' AND ORDER_NUM = content.ORDER_NUM AND ARTICLE_ID = #{aritcleId} AND content.CREATED_TIME CREATED_TIME ) + AND ARTICLE_ID = #{articleId} + AND NOT EXISTS ( SELECT 1 FROM ARTICLE_CONTENT WHERE DEL_FLAG = '0' AND ORDER_NUM = content.ORDER_NUM AND ARTICLE_ID = #{articleId} AND content.CREATED_TIME CREATED_TIME ) GROUP BY ORDER_NUM ORDER BY @@ -265,7 +269,7 @@ WHERE art.DEL_FLAG = '0' - AND art.ID = #{aritcleId} + AND art.ID = #{articleId} ORDER BY content2.ORDER_NUM ASC \ No newline at end of file From 47303e2b232ed262cb12d70b4064cc6baa2934b0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 4 Jun 2020 15:56:10 +0800 Subject: [PATCH 42/54] =?UTF-8?q?openfeignclient=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/GovLoginServiceImpl.java | 3 --- .../epmet/service/impl/LoginServiceImpl.java | 7 +++--- .../epmet/service/impl/DemoServiceImpl.java | 4 ++-- ....java => EpmetMessageOpenFeignClient.java} | 22 ++++++++++++------- .../epmet/service/impl/SysSmsServiceImpl.java | 10 +++++---- .../epmet/feign/GovIssueOpenFeignClient.java | 16 ++++++++++++++ .../GovIssueOpenFeignClientFallBack.java | 14 ++++++++++++ .../feign/GovProjectOpenFeignClient.java | 16 ++++++++++++++ .../GovProjectOpenFeignClientFallback.java | 14 ++++++++++++ .../impl/ProjectProcessServiceImpl.java | 3 --- ...nt.java => OperAccessOpenFeignClient.java} | 15 +++++++------ ...=> OperAccessOpenFeignClientFallback.java} | 4 ++-- .../epmet/feign/OperCrmOpenFeignClient.java | 16 ++++++++++++++ .../OperCrmOpenFeignClientFallback.java | 14 ++++++++++++ .../feign/OperCustomizeOpenFeignClient.java | 17 ++++++++++++++ .../OperCustomizeOpenFeignClientFallback.java | 14 ++++++++++++ .../group/feign/ResiGroupOpenFeignClient.java | 16 ++++++++++++++ .../ResiGroupOpenFeignClientFallback.java | 14 ++++++++++++ .../impl/GroupInvitationServiceImpl.java | 7 +++--- .../impl/ResiGroupMemberServiceImpl.java | 16 +++++++------- .../feign/ResiPartyMemberOpenFeignClient.java | 16 ++++++++++++++ ...esiPartyMemberOpenFeignClientFallback.java | 14 ++++++++++++ .../epmet/feign/ResiVoiceOpenFeignClient.java | 16 ++++++++++++++ .../ResiVoiceOpenFeignClientFallback.java | 14 ++++++++++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 16 ++++++++++++++ .../EpmetUserOpenFeignClientFallback.java | 14 ++++++++++++ 26 files changed, 287 insertions(+), 45 deletions(-) rename epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/{MessageFeignClient.java => EpmetMessageOpenFeignClient.java} (76%) create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java rename epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/{OperAccessFeignClient.java => OperAccessOpenFeignClient.java} (69%) rename epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/fallback/{OperAccessFeignClientFallback.java => OperAccessOpenFeignClientFallback.java} (78%) create mode 100644 epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java create mode 100644 epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java create mode 100644 epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/feign/ResiVoiceOpenFeignClient.java create mode 100644 epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/feign/fallback/ResiVoiceOpenFeignClientFallback.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java index 42c52ff600..ce23ed85fb 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java @@ -19,7 +19,6 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.GovOrgFeignClient; -import com.epmet.feign.MessageFeignClient; import com.epmet.jwt.JwtTokenProperties; import com.epmet.jwt.JwtTokenUtils; import com.epmet.redis.CaptchaRedis; @@ -50,8 +49,6 @@ public class GovLoginServiceImpl implements GovLoginService { @Autowired private CaptchaRedis captchaRedis; @Autowired - private MessageFeignClient messageFeignClient; - @Autowired private JwtTokenUtils jwtTokenUtils; @Autowired private JwtTokenProperties jwtTokenProperties; diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java index a796eedf89..92905f4848 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java @@ -4,7 +4,6 @@ import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; import cn.binarywang.wx.miniapp.bean.WxMaUserInfo; import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; -import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.password.PasswordUtils; @@ -17,7 +16,7 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.PasswordLoginUserInfoResultDTO; import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.feign.EpmetUserFeignClient; -import com.epmet.feign.OperAccessFeignClient; +import com.epmet.feign.OperAccessOpenFeignClient; import com.epmet.jwt.JwtTokenProperties; import com.epmet.jwt.JwtTokenUtils; import com.epmet.service.CaptchaService; @@ -63,7 +62,7 @@ public class LoginServiceImpl implements LoginService { private CaptchaService captchaService; @Autowired - private OperAccessFeignClient operAccessFeignClient; + private OperAccessOpenFeignClient operAccessOpenFeignClient; /** * 居民端微信小程序登录 @@ -321,7 +320,7 @@ public class LoginServiceImpl implements LoginService { } cpUserDetailRedis.logout(tokenDto.getApp(), tokenDto.getClient(), tokenDto.getUserId()); //web端清空菜单栏和权限 - Result operAccessResult = operAccessFeignClient.clearOperUserAccess(); + Result operAccessResult = operAccessOpenFeignClient.clearOperUserAccess(); if (operAccessResult.success()) { logger.info(String.format("运营人员%s退出成功,清空菜单和权限redis成功", tokenDto.getUserId())); } else { diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/service/impl/DemoServiceImpl.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/service/impl/DemoServiceImpl.java index 1a8c985f55..ccb39198c4 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/service/impl/DemoServiceImpl.java +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/service/impl/DemoServiceImpl.java @@ -34,8 +34,8 @@ import com.epmet.dto.form.SaveCustomerFormDTO; import com.epmet.dto.result.ValidCustomerResultDTO; import com.epmet.entity.DemoEntity; import com.epmet.feign.AdminFeignClient; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.GovOrgFeignClient; -import com.epmet.feign.MessageFeignClient; import com.epmet.feign.OperCrmFeignClient; import com.epmet.redis.DemoRedis; import com.epmet.service.DemoService; @@ -70,7 +70,7 @@ public class DemoServiceImpl extends BaseServiceImpl implem @Autowired private AdminFeignClient adminFeignClient; @Autowired - private MessageFeignClient messageFeignClient; + private EpmetMessageOpenFeignClient messageFeignClient; @Override public PageData page(Map params) { diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/MessageFeignClient.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java similarity index 76% rename from epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/MessageFeignClient.java rename to epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java index 355bdf2a34..ba775e2546 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/MessageFeignClient.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java @@ -1,10 +1,5 @@ package com.epmet.feign; -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.SysSmsDTO; -import com.epmet.dto.form.UserMessageFormDTO; -import com.epmet.feign.fallback.MessageFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; @@ -12,9 +7,20 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; -@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = MessageFeignClientFallback.class) -public interface MessageFeignClient { +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.SysSmsDTO; +import com.epmet.dto.form.UserMessageFormDTO; +import com.epmet.feign.fallback.EpmetMessageOpenFeignClientFallback; +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:47 + */ +@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = EpmetMessageOpenFeignClientFallback.class) +public interface EpmetMessageOpenFeignClient { /** * 发送短信 * @return @@ -37,5 +43,5 @@ public interface MessageFeignClient { * @Date 2020/4/7 15:36 **/ @PostMapping(value = "message/usermessage/saveusermessage", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) - Result saveUserMessage(UserMessageFormDTO formDto); + Result saveUserMessage(@RequestBody UserMessageFormDTO formDto); } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java index 75da5ccf9e..9dc94b7a2d 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java @@ -22,7 +22,7 @@ import com.epmet.dao.SysSmsDao; import com.epmet.dto.SysSmsDTO; import com.epmet.entity.SysSmsEntity; import com.epmet.exception.ModuleErrorCode; -import com.epmet.feign.MessageFeignClient; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.service.SysSmsService; import com.epmet.sms.AbstractSmsService; import com.epmet.sms.SmsFactory; @@ -34,7 +34,9 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.*; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; @Service public class SysSmsServiceImpl extends BaseServiceImpl implements SysSmsService { @@ -42,7 +44,7 @@ public class SysSmsServiceImpl extends BaseServiceImpl private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired - private MessageFeignClient messageFeignClient; + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; @Override public PageData page(Map params) { @@ -125,7 +127,7 @@ public class SysSmsServiceImpl extends BaseServiceImpl sysSmsDTO.setMobile(mobile); sysSmsDTO.setParams(paramJson); - Result result = messageFeignClient.send(sysSmsDTO); + Result result = epmetMessageOpenFeignClient.send(sysSmsDTO); if (result != null && result.success()) { HashMap data = new HashMap<>(); data.put("code", codeStr); diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java new file mode 100644 index 0000000000..b9997f1705 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java @@ -0,0 +1,16 @@ +package com.epmet.feign; + +import org.springframework.cloud.openfeign.FeignClient; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.feign.fallback.GovIssueOpenFeignClientFallBack; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:37 + */ +@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class) +public interface GovIssueOpenFeignClient { +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java new file mode 100644 index 0000000000..65b8a24fc6 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java @@ -0,0 +1,14 @@ +package com.epmet.feign.fallback; + +import com.epmet.feign.GovIssueOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:43 + */ +@Component +public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient { +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java new file mode 100644 index 0000000000..b2e6b7f32c --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java @@ -0,0 +1,16 @@ +package com.epmet.feign; + +import org.springframework.cloud.openfeign.FeignClient; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.feign.fallback.GovProjectOpenFeignClientFallback; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:32 + */ +@FeignClient(name = ServiceConstant.GOV_PROJECT_SERVER, fallback = GovProjectOpenFeignClientFallback.class) +public interface GovProjectOpenFeignClient { +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java new file mode 100644 index 0000000000..4b8c2cd82b --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java @@ -0,0 +1,14 @@ +package com.epmet.feign.fallback; + +import com.epmet.feign.GovProjectOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:33 + */ +@Component +public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignClient { +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java index 8a9392db14..436610ef21 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java @@ -32,7 +32,6 @@ import com.epmet.constant.ReadFlagConstant; import com.epmet.constant.UserMessageConstant; import com.epmet.dao.ProjectProcessDao; import com.epmet.dao.ProjectStaffDao; -import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.ProjectProcessDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -41,7 +40,6 @@ import com.epmet.entity.ProjectProcessEntity; import com.epmet.entity.ProjectStaffEntity; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.GovOrgFeignClient; -import com.epmet.feign.MessageFeignClient; import com.epmet.redis.ProjectProcessRedis; import com.epmet.service.ProjectProcessService; import com.epmet.service.ProjectService; @@ -52,7 +50,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; -import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; /** diff --git a/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/OperAccessFeignClient.java b/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/OperAccessOpenFeignClient.java similarity index 69% rename from epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/OperAccessFeignClient.java rename to epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/OperAccessOpenFeignClient.java index 202b2c152d..cba3dfa021 100644 --- a/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/OperAccessFeignClient.java +++ b/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/OperAccessOpenFeignClient.java @@ -1,19 +1,20 @@ package com.epmet.feign; -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.Result; -import com.epmet.feign.fallback.OperAccessFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.fallback.OperAccessOpenFeignClientFallback; + /** * @Description 运营端权限模块 * @Author yinzuomei - * @Date 2020/5/21 15:17 + * @Date 2020/5/21 15:17 本服务对外开放的API,其他服务通过引用此client调用该服务 */ -//, url = "http://localhost:8093" -@FeignClient(name = ServiceConstant.OPER_ACCESS_SERVER, fallback = OperAccessFeignClientFallback.class) -public interface OperAccessFeignClient { +// , url = "http://localhost:8093" +@FeignClient(name = ServiceConstant.OPER_ACCESS_SERVER, fallback = OperAccessOpenFeignClientFallback.class) +public interface OperAccessOpenFeignClient { /** * @param * @return com.epmet.commons.tools.utils.Result diff --git a/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/fallback/OperAccessFeignClientFallback.java b/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/fallback/OperAccessOpenFeignClientFallback.java similarity index 78% rename from epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/fallback/OperAccessFeignClientFallback.java rename to epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/fallback/OperAccessOpenFeignClientFallback.java index 1cd7d7915d..32693f4ed8 100644 --- a/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/fallback/OperAccessFeignClientFallback.java +++ b/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/fallback/OperAccessOpenFeignClientFallback.java @@ -3,7 +3,7 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.feign.OperAccessFeignClient; +import com.epmet.feign.OperAccessOpenFeignClient; import org.springframework.stereotype.Component; /** @@ -12,7 +12,7 @@ import org.springframework.stereotype.Component; * @Date 2020/5/21 15:47 */ @Component -public class OperAccessFeignClientFallback implements OperAccessFeignClient { +public class OperAccessOpenFeignClientFallback implements OperAccessOpenFeignClient { @Override public Result clearOperUserAccess() { return ModuleUtils.feignConError(ServiceConstant.OPER_ACCESS_SERVER, "clearOperUserAccess"); diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java new file mode 100644 index 0000000000..5b85dd5438 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java @@ -0,0 +1,16 @@ +package com.epmet.feign; + +import org.springframework.cloud.openfeign.FeignClient; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.feign.fallback.OperCrmOpenFeignClientFallback; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:25 + */ +@FeignClient(name = ServiceConstant.OPER_CRM_SERVER, fallback = OperCrmOpenFeignClientFallback.class) +public interface OperCrmOpenFeignClient { +} diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java new file mode 100644 index 0000000000..896781e016 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java @@ -0,0 +1,14 @@ +package com.epmet.feign.fallback; + +import com.epmet.feign.OperCrmOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:26 + */ +@Component +public class OperCrmOpenFeignClientFallback implements OperCrmOpenFeignClient { +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java new file mode 100644 index 0000000000..9e81857ef7 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java @@ -0,0 +1,17 @@ +package com.epmet.feign; + +import org.springframework.cloud.openfeign.FeignClient; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.feign.fallback.OperCustomizeOpenFeignClientFallback; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:16 + */ +@FeignClient(name = ServiceConstant.OPER_CUSTOMIZE_SERVER, fallback = OperCustomizeOpenFeignClientFallback.class) +public interface OperCustomizeOpenFeignClient { + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java new file mode 100644 index 0000000000..7b912afc73 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java @@ -0,0 +1,14 @@ +package com.epmet.feign.fallback; + +import com.epmet.feign.OperCustomizeOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:23 + */ +@Component +public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFeignClient { +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java new file mode 100644 index 0000000000..58ff87be1e --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java @@ -0,0 +1,16 @@ +package com.epmet.resi.group.feign; + +import org.springframework.cloud.openfeign.FeignClient; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.resi.group.feign.fallback.ResiGroupOpenFeignClientFallback; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:16 + */ +@FeignClient(name = ServiceConstant.RESI_GROUP_SERVER, fallback = ResiGroupOpenFeignClientFallback.class) +public interface ResiGroupOpenFeignClient { +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java new file mode 100644 index 0000000000..df1c7bebf2 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java @@ -0,0 +1,14 @@ +package com.epmet.resi.group.feign.fallback; + +import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:17 + */ +@Component +public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClient { +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java index 610dfe3edb..36b41f84c4 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java @@ -33,8 +33,7 @@ import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.dto.form.UserResiInfoFormDTO; import com.epmet.dto.result.UserInfoOnEnterGridResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; -import com.epmet.dto.result.UserRoleResultDTO; -import com.epmet.feign.MessageFeignClient; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.modules.constant.UserMessageConstant; import com.epmet.modules.feign.EpmetUserFeignClient; import com.epmet.modules.feign.ResiGuideFeignClient; @@ -96,7 +95,7 @@ public class GroupInvitationServiceImpl extends BaseServiceImpl votableCountMap = new HashMap<>(); gridList.getGridIds().forEach(gridId -> { diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java new file mode 100644 index 0000000000..ef7105186d --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java @@ -0,0 +1,16 @@ +package com.epmet.resi.partymember.feign; + +import org.springframework.cloud.openfeign.FeignClient; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.resi.partymember.feign.fallback.ResiPartyMemberOpenFeignClientFallback; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:12 + */ +@FeignClient(name = ServiceConstant.RESI_PARTYMEMBER_SERVER, fallback = ResiPartyMemberOpenFeignClientFallback.class) +public interface ResiPartyMemberOpenFeignClient { +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java new file mode 100644 index 0000000000..cdcbbcbc92 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java @@ -0,0 +1,14 @@ +package com.epmet.resi.partymember.feign.fallback; + +import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:14 + */ +@Component +public class ResiPartyMemberOpenFeignClientFallback implements ResiPartyMemberOpenFeignClient { +} diff --git a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/feign/ResiVoiceOpenFeignClient.java b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/feign/ResiVoiceOpenFeignClient.java new file mode 100644 index 0000000000..a31843a85f --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/feign/ResiVoiceOpenFeignClient.java @@ -0,0 +1,16 @@ +package com.epmet.feign; + +import org.springframework.cloud.openfeign.FeignClient; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.feign.fallback.ResiVoiceOpenFeignClientFallback; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:01 + */ +@FeignClient(name = ServiceConstant.RESI_VOICE_SERVER, fallback = ResiVoiceOpenFeignClientFallback.class) +public interface ResiVoiceOpenFeignClient { +} diff --git a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/feign/fallback/ResiVoiceOpenFeignClientFallback.java b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/feign/fallback/ResiVoiceOpenFeignClientFallback.java new file mode 100644 index 0000000000..f538efd990 --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/feign/fallback/ResiVoiceOpenFeignClientFallback.java @@ -0,0 +1,14 @@ +package com.epmet.feign.fallback; + +import com.epmet.feign.ResiVoiceOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:05 + */ +@Component +public class ResiVoiceOpenFeignClientFallback implements ResiVoiceOpenFeignClient { +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java new file mode 100644 index 0000000000..8c0f822655 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -0,0 +1,16 @@ +package com.epmet.feign; + +import org.springframework.cloud.openfeign.FeignClient; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.feign.fallback.EpmetUserOpenFeignClientFallback; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:09 + */ +@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class) +public interface EpmetUserOpenFeignClient { +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java new file mode 100644 index 0000000000..817c48f7e6 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -0,0 +1,14 @@ +package com.epmet.feign.fallback; + +import com.epmet.feign.EpmetUserOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:10 + */ +@Component +public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClient { +} From dc08497a6a46a700d0074359f8040184e88fa03d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 4 Jun 2020 15:56:47 +0800 Subject: [PATCH 43/54] =?UTF-8?q?openfeignclient=E6=8F=90=E4=BA=A41?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...va => EpmetMessageOpenFeignClientFallback.java} | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) rename epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/{MessageFeignClientFallback.java => EpmetMessageOpenFeignClientFallback.java} (75%) diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/MessageFeignClientFallback.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java similarity index 75% rename from epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/MessageFeignClientFallback.java rename to epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java index cf105730e2..a3f4dbbbc1 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/MessageFeignClientFallback.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java @@ -1,19 +1,22 @@ package com.epmet.feign.fallback; +import org.springframework.stereotype.Component; + import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.SysSmsDTO; import com.epmet.dto.form.UserMessageFormDTO; -import com.epmet.feign.MessageFeignClient; -import org.springframework.stereotype.Component; +import com.epmet.feign.EpmetMessageOpenFeignClient; /** - * 消息服务降级 + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:48 */ @Component -public class MessageFeignClientFallback implements MessageFeignClient { - +public class EpmetMessageOpenFeignClientFallback implements EpmetMessageOpenFeignClient { @Override public Result send(SysSmsDTO smsDTO) { @@ -29,5 +32,4 @@ public class MessageFeignClientFallback implements MessageFeignClient { public Result saveUserMessage(UserMessageFormDTO formDto) { return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "saveUserMessage", formDto); } - } From e597190e4c6b213ebbf506f82ffbdea5a2ec9dee Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 4 Jun 2020 16:02:31 +0800 Subject: [PATCH 44/54] =?UTF-8?q?=E6=96=B0=E5=A2=9Egovvoiceopenfeignclient?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/feign/GovVoiceOpenFeignClient.java | 18 ++++++++++++++++++ .../feign/GovVoiceOpenFeignClientFallback.java | 13 +++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClient.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClientFallback.java diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClient.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClient.java new file mode 100644 index 0000000000..1c906ef6a3 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClient.java @@ -0,0 +1,18 @@ +package com.epmet.feign; + + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.dto.feign.fallback.GovVoiceFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 16:01 + */ +@FeignClient(name = ServiceConstant.GOV_VOICE_SERVER, fallback = GovVoiceFeignClientFallBack.class) +public interface GovVoiceOpenFeignClient { + + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClientFallback.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClientFallback.java new file mode 100644 index 0000000000..daf8abaa7f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClientFallback.java @@ -0,0 +1,13 @@ +package com.epmet.feign; + +import org.springframework.stereotype.Component; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 16:01 + */ +@Component +public class GovVoiceOpenFeignClientFallback implements GovVoiceOpenFeignClient{ +} From 55b8aeaec8bc3eb2fb417427058273c5807721e0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 4 Jun 2020 16:32:17 +0800 Subject: [PATCH 45/54] =?UTF-8?q?=E6=96=B0=E5=A2=9EGovOrgOpenFeignClient?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/feign/GovOrgFeignClient.java | 34 ------------------- .../epmet/feign/GovOrgOpenFeignClient.java | 27 ++++++++++++--- .../fallback/GovOrgFeignClientFallBack.java | 27 --------------- .../GovOrgOpenFeignClientFallback.java | 13 ++++++- 4 files changed, 34 insertions(+), 67 deletions(-) delete mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgFeignClient.java delete mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java rename epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/{callback => fallback}/GovOrgOpenFeignClientFallback.java (60%) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgFeignClient.java deleted file mode 100644 index 1b23a85ec8..0000000000 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.epmet.feign; - -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.CustomerAgencyDTO; -import com.epmet.dto.form.LatestGridFormDTO; -import com.epmet.dto.form.StaffInfoFromDTO; -import com.epmet.dto.result.CustomerGridByUserIdResultDTO; -import com.epmet.dto.result.LatestCustomerResultDTO; -import com.epmet.dto.result.MineResultDTO; -import com.epmet.feign.fallback.GovOrgFeignClientFallBack; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; - -import java.util.List; - -/** - * @Description url = "localhost:8092" - * @Author sun - */ -@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class) -public interface GovOrgFeignClient { - - /** - * 根据staffId查询所属的组织机构 - * @param staffId - * @return - */ - @PostMapping("/gov/org/agency/agencybystaff/{staffId}") - Result getAgencyByStaff(@PathVariable("staffId") String staffId); -} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 88df475dac..a780ef8896 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -1,23 +1,40 @@ package com.epmet.feign; -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.CustomerAgencyDTO; -import com.epmet.feign.callback.GovOrgOpenFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; -//@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class, url = "localhost:8092") +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.feign.fallback.GovOrgOpenFeignClientFallback; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:37 + */ +// @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class, url = +// "localhost:8092") @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class) public interface GovOrgOpenFeignClient { /** * 根据Id查询agency + * * @param agencyId * @return */ @PostMapping("/gov/org/agency/agencybyid/{agencyId}") Result getAgencyById(@PathVariable("agencyId") String agencyId); + /** + * 根据staffId查询所属的组织机构 + * + * @param staffId + * @return + */ + @PostMapping("/gov/org/agency/agencybystaff/{staffId}") + Result getAgencyByStaff(@PathVariable("staffId") String staffId); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java deleted file mode 100644 index 8b0cb47059..0000000000 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.epmet.feign.fallback; - -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.ModuleUtils; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.CustomerAgencyDTO; -import com.epmet.dto.form.LatestGridFormDTO; -import com.epmet.dto.form.StaffInfoFromDTO; -import com.epmet.dto.result.CustomerGridByUserIdResultDTO; -import com.epmet.dto.result.LatestCustomerResultDTO; -import com.epmet.dto.result.MineResultDTO; -import com.epmet.feign.GovOrgFeignClient; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * @Description - * @Author sun - */ -@Component -public class GovOrgFeignClientFallBack implements GovOrgFeignClient { - @Override - public Result getAgencyByStaff(String staffId) { - return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyByStaff", staffId); - } -} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/callback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java similarity index 60% rename from epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/callback/GovOrgOpenFeignClientFallback.java rename to epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 03c5cf8712..262b037206 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/callback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -1,4 +1,4 @@ -package com.epmet.feign.callback; +package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; @@ -7,10 +7,21 @@ import com.epmet.dto.CustomerAgencyDTO; import com.epmet.feign.GovOrgOpenFeignClient; import org.springframework.stereotype.Component; +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:37 + */ @Component public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { @Override public Result getAgencyById(String agencyId) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getAgencyById", agencyId); } + + @Override + public Result getAgencyByStaff(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyByStaff", staffId); + } } From bf7e6c0b708a9316af5ec1dc2fc2bebc3952a881 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 4 Jun 2020 16:51:29 +0800 Subject: [PATCH 46/54] =?UTF-8?q?DTO=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/ArticleController.java | 2 +- .../main/java/com/epmet/dao/ArticleDao.java | 7 +--- .../service/impl/ArticleServiceImpl.java | 1 - .../src/main/resources/mapper/ArticleDao.xml | 1 + .../dto/form/CommonArticleListFormDTO.java | 34 --------------- .../dto/result/ArticleBannerResultDTO.java | 31 -------------- .../dto/result/ArticleLatestResultDTO.java | 41 ------------------ .../epmet/controller/ArticleController.java | 6 +-- .../com/epmet/service/ArticleService.java | 11 +++++ .../service/impl/ArticleServiceImpl.java | 42 +++++++++++++++++++ .../java/com/epmet/utils/ModuleConstant.java | 12 ++++++ 11 files changed, 71 insertions(+), 117 deletions(-) delete mode 100644 epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java delete mode 100644 epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ArticleBannerResultDTO.java delete mode 100644 epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ArticleLatestResultDTO.java create mode 100644 epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 6040b192de..fd551fbe25 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -36,7 +36,7 @@ import com.epmet.dto.form.ArticlePageFormDTO; import com.epmet.dto.form.CommonArticleListFormDTO; import com.epmet.dto.result.ArticleBannerResultDTO; import com.epmet.dto.result.ArticleLatestResultDTO; -import com.epmet.dto.result.ArticleListResultDTO; +import com.epmet.dto.result.ArticleWithTagsResultDTO; import com.epmet.excel.ArticleExcel; import com.epmet.service.ArticleOperateRecordService; import com.epmet.service.ArticleService; diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java index 57fa72015c..9946d010b2 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java @@ -23,16 +23,13 @@ import com.epmet.dto.result.GovArticleDetailResultDTO; import com.epmet.dto.result.ArticleBannerResultDTO; import com.epmet.dto.result.ArticleDetailResultDTO; import com.epmet.dto.result.ArticleLatestResultDTO; -import com.epmet.dto.result.ArticleListResultDTO; +import com.epmet.dto.result.ArticleWithTagsResultDTO; import com.epmet.entity.ArticleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Set; -import org.apache.ibatis.annotations.Param; - -import java.util.List; /** * 文章表 @@ -126,7 +123,7 @@ public interface ArticleDao extends BaseDao { * @author wangc * @date 2020.06.03 14:19 **/ - List selectArticleList(@Param("gridId") String gridId,@Param("tagIdList")List tagIdList); + List selectArticleList(@Param("gridId") String gridId, @Param("tagIdList")List tagIdList); /** * @Description 根绝文章Id查询出文章的内容、封面等相关信息,如果居民端传入的网格Id不在该文章的发布范围内,则返回NULL 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 205aecc0d6..5219c1de67 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 @@ -38,7 +38,6 @@ import com.epmet.constant.RoleKeyConstants; import com.epmet.dao.*; import com.epmet.dto.ArticleDTO; import com.epmet.dto.ArticleVisitRecordDTO; -import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.feign.GovOrgSelfFeignClient; import com.epmet.dto.form.*; diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml index d5f9b7f9a2..14f8875696 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml @@ -226,6 +226,7 @@ + diff --git a/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java b/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java deleted file mode 100644 index 5602cabf48..0000000000 --- a/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.epmet.dto.form; - -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import java.io.Serializable; - -/** - * @Description 居民端首页轮播查询接口DTO - * @ClassName ArticleBannerFormDTO - * @Auth wangc - * @Date 2020-06-02 11:20 - */ -@Data -public class CommonArticleListFormDTO implements Serializable { - private static final long serialVersionUID = 5996259506950697451L; - - /** - * 内部错误分组 - * */ - public interface ArticleBannerInternalGroup{} - - /** - * 网格Id - * */ - @NotBlank(message = "网格Id不能为空" , groups = {ArticleBannerInternalGroup.class}) - private String gridId; - - /** - * 客户定制化条数(高级配置里的参数) - * */ - private Integer num; - -} diff --git a/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ArticleBannerResultDTO.java b/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ArticleBannerResultDTO.java deleted file mode 100644 index c88dc10f22..0000000000 --- a/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ArticleBannerResultDTO.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.epmet.dto.result; - -import lombok.Data; - -import java.io.Serializable; - -/** - * @Description - * @ClassName ArticleBannerResultDTO - * @Auth wangc - * @Date 2020-06-02 13:55 - */ -@Data -public class ArticleBannerResultDTO implements Serializable { - private static final long serialVersionUID = 7764443348626371305L; - - /** - * 文章Id - * */ - private String articleId; - - /** - * 封面图url - * */ - private String coverImg; - - /** - * 标题 - * */ - private String title; -} diff --git a/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ArticleLatestResultDTO.java b/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ArticleLatestResultDTO.java deleted file mode 100644 index ce5420f22e..0000000000 --- a/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ArticleLatestResultDTO.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.epmet.dto.result; - -import lombok.Data; - -import java.io.Serializable; - -/** - * @Description - * @ClassName ArticleLatestResultDTO - * @Auth wangc - * @Date 2020-06-02 17:11 - */ -@Data -public class ArticleLatestResultDTO implements Serializable { - private static final long serialVersionUID = 6953266228209247094L; - - /** - * 文章Id - * */ - private String articleId; - - /** - * 文章封面图片url - * */ - private String articleCoverImg; - - /** - * 文章标题 - * */ - private String articleTitle; - - /** - * 发布单位名称 - * */ - private String publishName; - - /** - * 发布时间(天级别) 时间戳 - * */ - private String publishDate; -} diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 9096383be1..4a21402b45 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -1,8 +1,6 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; -import com.epmet.commons.tools.annotation.RequirePermission; -import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -59,9 +57,9 @@ public class ArticleController { * @date 2020.06.03 14:19 **/ @PostMapping("articlelist") - public Result> articleList(@RequestBody ArticlePageFormDTO articlePageFormDTO){ + public Result> articleList(@RequestBody ArticlePageFormDTO articlePageFormDTO){ ValidatorUtils.validateEntity(articlePageFormDTO,ArticlePageFormDTO.ArticlePageInternalGroup.class); - return govVoiceFeignClient.resiArticleList(articlePageFormDTO); + return new Result>().ok(articleService.articleList(articlePageFormDTO)); } /** diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/ArticleService.java index 853e0a3579..d84c9fb966 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -1,8 +1,10 @@ package com.epmet.service; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.ArticlePageFormDTO; import com.epmet.dto.form.ResiTagListFormDTO; import com.epmet.dto.form.TagCascadeListFormDTO; +import com.epmet.dto.result.ArticleWithTagsResultDTO; import com.epmet.dto.result.TagInfoResultDTO; import java.util.List; @@ -26,4 +28,13 @@ public interface ArticleService { * @author zxc */ List tagCascadeList(TokenDto tokenDto, TagCascadeListFormDTO formDto); + + /** + * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 返回的标签以数组形式 + * @param articlePageFormDTO + * @return List + * @author wangc + * @date 2020.06.03 14:19 + **/ + List articleList(ArticlePageFormDTO articlePageFormDTO); } diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index 7fb0e57bdb..27eb5433d6 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -1,15 +1,28 @@ package com.epmet.service.impl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.dto.feign.GovVoiceFeignClient; +import com.epmet.dto.form.ArticlePageFormDTO; import com.epmet.dto.form.ResiTagListFormDTO; import com.epmet.dto.form.TagCascadeListFormDTO; +import com.epmet.dto.result.ArticleListResultDTO; +import com.epmet.dto.result.ArticleWithTagsResultDTO; import com.epmet.dto.result.TagInfoResultDTO; import com.epmet.service.ArticleService; +import com.epmet.utils.ModuleConstant; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.Arrays; +import java.util.HashSet; import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; /** @@ -44,4 +57,33 @@ public class ArticleServiceImpl implements ArticleService { // formDto.setCustomerId(tokenDto.getCustomerId()); return govVoiceFeignClient.tagCascadeList(formDto).getData(); } + + /** + * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 返回的标签以数组形式 + * @param articlePageFormDTO + * @return List + * @author wangc + * @date 2020.06.03 14:19 + **/ + @Override + public List articleList(ArticlePageFormDTO articlePageFormDTO) { + Result> articles = govVoiceFeignClient.resiArticleList(articlePageFormDTO); + if(articles.success() && null != articles.getData() && articles.getData().size() > NumConstant.ZERO){ + return articles.getData().stream().map(article -> { + ArticleWithTagsResultDTO artObj = ConvertUtils.sourceToTarget(article,ArticleWithTagsResultDTO.class); + artObj.setTagName(new HashSet<>()); + if(StringUtils.isNotBlank(article.getTagName())){ + String[] tagArray = article.getTagName().split(ModuleConstant.VERTICAL_BAR_WITH_ESCAPE_CHARACTER); + if(tagArray.length > NumConstant.ZERO){ + artObj.setTagName(new HashSet<>(Arrays.asList(tagArray))); + } + } + return artObj; + }).collect(Collectors.toList()); + + } + + throw new RenException(articles.getInternalMsg()); + } + } diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java new file mode 100644 index 0000000000..693bdc156d --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java @@ -0,0 +1,12 @@ +package com.epmet.utils; + +/** + * 常量类 + * */ +public interface ModuleConstant { + + /** + * 竖线的转义字符表示 + * */ + String VERTICAL_BAR_WITH_ESCAPE_CHARACTER = "\\|"; +} From b8845ad94715e8b9577fc822699a30ea62063e75 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 4 Jun 2020 17:38:15 +0800 Subject: [PATCH 47/54] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=85=9A=E5=BB=BA=E5=A3=B0=E9=9F=B3=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=B0=86=E6=A0=87=E7=AD=BE=E5=90=8D=E6=94=B9=E6=88=90=E6=95=B0?= =?UTF-8?q?=E7=BB=84=E4=BC=A0=E9=80=92=EF=BC=8C=E5=88=A0=E9=99=A4=E9=87=8D?= =?UTF-8?q?=E5=A4=8Ddto=EF=BC=8C=E5=B0=86govvoicefeign=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=BF=81=E7=A7=BB=E5=88=B0govvoiceopenfeign=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E5=88=A0=E9=99=A4govvoicefeign=E4=B8=AD=E7=9A=84=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../filter/CpAuthGatewayFilterFactory.java | 12 +++- .../epmet/dto/feign/GovVoiceFeignClient.java | 44 -------------- .../fallback/GovVoiceFeignClientFallBack.java | 20 ------- .../epmet/feign/GovVoiceOpenFeignClient.java | 58 ++++++++++++++++++- .../GovVoiceOpenFeignClientFallback.java | 32 ++++++++++ .../com/epmet/controller/VoiceController.java | 4 +- .../epmet/dto/form/ArticlePageFormDTO.java | 43 -------------- .../dto/form/CommonArticleListFormDTO.java | 34 ----------- .../dto/form/ResiArticleDetailFormDTO.java | 37 ------------ .../dto/result/ArticleContentResultDTO.java | 26 --------- .../dto/result/ArticleDetailResultDTO.java | 55 ------------------ ...DTO.java => ArticleWithTagsResultDTO.java} | 12 ++-- .../epmet/controller/ArticleController.java | 5 +- .../service/impl/ArticleServiceImpl.java | 5 +- 14 files changed, 114 insertions(+), 273 deletions(-) delete mode 100644 epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ArticlePageFormDTO.java delete mode 100644 epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java delete mode 100644 epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ResiArticleDetailFormDTO.java delete mode 100644 epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java delete mode 100644 epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleDetailResultDTO.java rename epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/{ArticleListResultDTO.java => ArticleWithTagsResultDTO.java} (69%) diff --git a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java index 135398f025..75cb2d2151 100644 --- a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java +++ b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java @@ -72,7 +72,17 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory().error(e.getCode(),e.getMsg())); + } + }else{ + baseTokenDto = null; + } String customerId = ""; diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java index f955e2b125..6a03cbafbc 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java @@ -36,48 +36,4 @@ public interface GovVoiceFeignClient { */ @PostMapping("/gov/voice/tag/tagcascadelist") Result> tagCascadeList(@RequestBody TagCascadeListFormDTO formDto); - - /** - * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 - * @param commonArticleListFormDTO :: getGridId :: getNum - * @return List - * @author wangc - * @date 2020.06.02 16:13 - **/ - @PostMapping("/gov/voice/article/resitoparticlelist") - Result> resiTopArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO); - - - - /** - * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端首页最新文章列表 - * @param commonArticleListFormDTO :: getGridId :: getNum - * @return List - * @author wangc - * @date 2020.06.03 09:53 - **/ - @PostMapping("/gov/voice/article/resilatestarticlelist") - Result> resiLatestArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO); - - - /** - * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 - * @param articlePageFormDTO - * @return List - * @author wangc - * @date 2020.06.03 14:19 - **/ - @PostMapping("/gov/voice/article/resiarticlelist") - Result> resiArticleList(@RequestBody ArticlePageFormDTO articlePageFormDTO); - - /** - * @Description 根绝文章Id查询出文章的内容、封面等相关信息,如果居民端传入的网格Id不在该文章的发布范围内,则返回NULL - * @param articleDetailFormDTO - * @return ArticleDetailResultDTO - * @author wangc - * @date 2020.06.03 18:28 - **/ - @PostMapping("/gov/voice/article/resiarticledetail") - Result resiArticleDetail(@RequestBody ResiArticleDetailFormDTO articleDetailFormDTO); - } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/fallback/GovVoiceFeignClientFallBack.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/fallback/GovVoiceFeignClientFallBack.java index 3e707a86f6..9e2c1eebba 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/fallback/GovVoiceFeignClientFallBack.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/fallback/GovVoiceFeignClientFallBack.java @@ -25,24 +25,4 @@ public class GovVoiceFeignClientFallBack implements GovVoiceFeignClient { public Result> tagCascadeList(TagCascadeListFormDTO formDto) { return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "tagCascadeList", formDto); } - - @Override - public Result> resiTopArticleList(CommonArticleListFormDTO commonArticleListFormDTO) { - return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "resiTopArticleList", commonArticleListFormDTO); - } - - @Override - public Result> resiLatestArticleList(CommonArticleListFormDTO commonArticleListFormDTO) { - return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "resiLatestArticleList", commonArticleListFormDTO); - } - - @Override - public Result> resiArticleList(ArticlePageFormDTO articlePageFormDTO) { - return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "resiArticleList", articlePageFormDTO); - } - - @Override - public Result resiArticleDetail(ResiArticleDetailFormDTO articleDetailFormDTO) { - return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "resiArticleDetail", articleDetailFormDTO); - } } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClient.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClient.java index 1c906ef6a3..eb9cf4c240 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClient.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClient.java @@ -2,8 +2,19 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.dto.feign.fallback.GovVoiceFeignClientFallBack; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.ArticlePageFormDTO; +import com.epmet.dto.form.CommonArticleListFormDTO; +import com.epmet.dto.form.ResiArticleDetailFormDTO; +import com.epmet.dto.result.ArticleBannerResultDTO; +import com.epmet.dto.result.ArticleDetailResultDTO; +import com.epmet.dto.result.ArticleLatestResultDTO; +import com.epmet.dto.result.ArticleListResultDTO; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -11,8 +22,51 @@ import org.springframework.cloud.openfeign.FeignClient; * @author yinzuomei@elink-cn.com * @date 2020/6/4 16:01 */ -@FeignClient(name = ServiceConstant.GOV_VOICE_SERVER, fallback = GovVoiceFeignClientFallBack.class) +@FeignClient(name = ServiceConstant.GOV_VOICE_SERVER, fallback = GovVoiceOpenFeignClientFallback.class) public interface GovVoiceOpenFeignClient { + /** + * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.02 16:13 + **/ + @PostMapping("/gov/voice/article/resitoparticlelist") + Result> resiTopArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO); + + + + /** + * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端首页最新文章列表 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.03 09:53 + **/ + @PostMapping("/gov/voice/article/resilatestarticlelist") + Result> resiLatestArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO); + + + /** + * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 + * @param articlePageFormDTO + * @return List + * @author wangc + * @date 2020.06.03 14:19 + **/ + @PostMapping("/gov/voice/article/resiarticlelist") + Result> resiArticleList(@RequestBody ArticlePageFormDTO articlePageFormDTO); + + /** + * @Description 根绝文章Id查询出文章的内容、封面等相关信息,如果居民端传入的网格Id不在该文章的发布范围内,则返回NULL + * @param articleDetailFormDTO + * @return ArticleDetailResultDTO + * @author wangc + * @date 2020.06.03 18:28 + **/ + @PostMapping("/gov/voice/article/resiarticledetail") + Result resiArticleDetail(@RequestBody ResiArticleDetailFormDTO articleDetailFormDTO); + } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClientFallback.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClientFallback.java index daf8abaa7f..16b020b732 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClientFallback.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClientFallback.java @@ -1,7 +1,19 @@ package com.epmet.feign; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.ArticlePageFormDTO; +import com.epmet.dto.form.CommonArticleListFormDTO; +import com.epmet.dto.form.ResiArticleDetailFormDTO; +import com.epmet.dto.result.ArticleBannerResultDTO; +import com.epmet.dto.result.ArticleDetailResultDTO; +import com.epmet.dto.result.ArticleLatestResultDTO; +import com.epmet.dto.result.ArticleListResultDTO; import org.springframework.stereotype.Component; +import java.util.List; + /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 * @@ -10,4 +22,24 @@ import org.springframework.stereotype.Component; */ @Component public class GovVoiceOpenFeignClientFallback implements GovVoiceOpenFeignClient{ + + @Override + public Result> resiTopArticleList(CommonArticleListFormDTO commonArticleListFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "resiTopArticleList", commonArticleListFormDTO); + } + + @Override + public Result> resiLatestArticleList(CommonArticleListFormDTO commonArticleListFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "resiLatestArticleList", commonArticleListFormDTO); + } + + @Override + public Result> resiArticleList(ArticlePageFormDTO articlePageFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "resiArticleList", articlePageFormDTO); + } + + @Override + public Result resiArticleDetail(ResiArticleDetailFormDTO articleDetailFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "resiArticleDetail", articleDetailFormDTO); + } } diff --git a/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/VoiceController.java b/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/VoiceController.java index da34a9f1e0..16a9774f59 100644 --- a/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/VoiceController.java +++ b/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/VoiceController.java @@ -2,10 +2,10 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.feign.GovVoiceFeignClient; import com.epmet.dto.form.CommonArticleListFormDTO; import com.epmet.dto.result.ArticleBannerResultDTO; import com.epmet.dto.result.ArticleLatestResultDTO; +import com.epmet.feign.GovVoiceOpenFeignClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -19,7 +19,7 @@ import java.util.List; public class VoiceController { @Autowired - private GovVoiceFeignClient govVoiceFeignClient; + private GovVoiceOpenFeignClient govVoiceFeignClient; /** * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 diff --git a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ArticlePageFormDTO.java b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ArticlePageFormDTO.java deleted file mode 100644 index f15a296854..0000000000 --- a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ArticlePageFormDTO.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.epmet.dto.form; - -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import java.io.Serializable; -import java.util.List; - -/** - * @Description 居民端查看文章列表参数DTO - * @ClassName ArticlePageFormDTO - * @Auth wangc - * @Date 2020-06-03 14:21 - */ - -@Data -public class ArticlePageFormDTO implements Serializable { - private static final long serialVersionUID = -6201259689082896334L; - - public interface ArticlePageInternalGroup{} - - /** - * 网格Id - * */ - @NotBlank(message = "网格Id不能为空" , groups = {ArticlePageInternalGroup.class}) - private String gridId; - - /** - * 标签Id集合 - * */ - private List tagIdList; - - /** - * 页码 - * */ - private Integer pageNo = 1; - - /** - * 每页显示量 - * */ - private Integer pageSize = 10; - -} diff --git a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java deleted file mode 100644 index 5602cabf48..0000000000 --- a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.epmet.dto.form; - -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import java.io.Serializable; - -/** - * @Description 居民端首页轮播查询接口DTO - * @ClassName ArticleBannerFormDTO - * @Auth wangc - * @Date 2020-06-02 11:20 - */ -@Data -public class CommonArticleListFormDTO implements Serializable { - private static final long serialVersionUID = 5996259506950697451L; - - /** - * 内部错误分组 - * */ - public interface ArticleBannerInternalGroup{} - - /** - * 网格Id - * */ - @NotBlank(message = "网格Id不能为空" , groups = {ArticleBannerInternalGroup.class}) - private String gridId; - - /** - * 客户定制化条数(高级配置里的参数) - * */ - private Integer num; - -} diff --git a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ResiArticleDetailFormDTO.java b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ResiArticleDetailFormDTO.java deleted file mode 100644 index 87de7f5045..0000000000 --- a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/form/ResiArticleDetailFormDTO.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.epmet.dto.form; - -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import java.io.Serializable; - -/** - * @Description 居民端查看文章详情传参DTO - * @ClassName ResiArticleDetailFormDTO - * @Auth wangc - * @Date 2020-06-04 09:20 - */ -@Data -public class ResiArticleDetailFormDTO implements Serializable { - private static final long serialVersionUID = -7197489284630455909L; - - public interface ResiArticleDetailInternalGroup{} - - /** - * 网格Id - * */ - @NotBlank(message = "网格Id不能为空",groups = ResiArticleDetailInternalGroup.class) - private String gridId; - - /** - * 文章Id - * */ - @NotBlank(message = "文章Id不能为空",groups = ResiArticleDetailInternalGroup.class) - private String articleId; - - /** - * 用户Id - * */ - @NotBlank(message = "用户Id不能为空",groups = ResiArticleDetailInternalGroup.class) - private String userId; -} diff --git a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java deleted file mode 100644 index 9b12f89213..0000000000 --- a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.epmet.dto.result; - -import lombok.Data; - -import java.io.Serializable; - -/** - * @Description - * @ClassName ArticleContentResultDTO - * @Auth wangc - * @Date 2020-06-03 16:41 - */ -@Data -public class ArticleContentResultDTO implements Serializable { - private static final long serialVersionUID = 2853197212163051558L; - - /** - * 内容类型(图片:img;文字:text) - * */ - private String contentType; - - /** - * 内容 - * */ - private String content; -} diff --git a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleDetailResultDTO.java b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleDetailResultDTO.java deleted file mode 100644 index 30adfb5e3e..0000000000 --- a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleDetailResultDTO.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.epmet.dto.result; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import lombok.Data; - -import java.io.Serializable; -import java.util.List; - -/** - * @Description - * @ClassName ArticleDetailResultDTO - * @Auth wangc - * @Date 2020-06-03 16:36 - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@Data -public class ArticleDetailResultDTO implements Serializable { - private static final long serialVersionUID = 4659147595194692686L; - - /** - * 文章Id - * */ - private String articleId; - - /** - * 文章标题 - * */ - private String articleTitle; - - /** - * 文章发布单位名称 - * */ - private String publishUnitDesc; - - /** - * 发布时间 - * */ - private String publishDate; - - /** - * 文章当前网格阅读量(article_visit_record统计数) - * */ - private Integer visitRecordCount; - - /** - * 标签名称集合(竖线分隔) - * */ - private String tags; - - /** - * 文章内容 - * */ - private List articleContentList; - -} diff --git a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleListResultDTO.java b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleWithTagsResultDTO.java similarity index 69% rename from epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleListResultDTO.java rename to epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleWithTagsResultDTO.java index 04d4f14a27..9b55cf2d13 100644 --- a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleListResultDTO.java +++ b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleWithTagsResultDTO.java @@ -3,16 +3,17 @@ package com.epmet.dto.result; import lombok.Data; import java.io.Serializable; +import java.util.Set; /** * @Description - * @ClassName ArticleListResultDTO + * @ClassName ArticleWithTagsResultDTO * @Auth wangc - * @Date 2020-06-03 10:59 + * @Date 2020-06-04 16:53 */ @Data -public class ArticleListResultDTO implements Serializable { - private static final long serialVersionUID = 293527138997974861L; +public class ArticleWithTagsResultDTO implements Serializable { + private static final long serialVersionUID = 2877103226476707681L; /** * 文章Id * */ @@ -41,6 +42,5 @@ public class ArticleListResultDTO implements Serializable { /** * 标签名称集合(竖线分隔) * */ - private String tagName; - + private Set tagName; } diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 4a21402b45..346549afd2 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -7,6 +7,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.feign.GovVoiceFeignClient; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.feign.GovVoiceOpenFeignClient; import com.epmet.service.ArticleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -23,7 +24,7 @@ public class ArticleController { @Autowired private ArticleService articleService; @Autowired - private GovVoiceFeignClient govVoiceFeignClient; + private GovVoiceOpenFeignClient govVoiceOpenFeignClient; /** * @Description 首页标签及更多——居民端 @@ -73,7 +74,7 @@ public class ArticleController { public Result articleDetail(@LoginUser TokenDto tokenDto,@RequestBody ResiArticleDetailFormDTO articleDetailFormDTO){ articleDetailFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(articleDetailFormDTO,ResiArticleDetailFormDTO.ResiArticleDetailInternalGroup.class); - return govVoiceFeignClient.resiArticleDetail(articleDetailFormDTO); + return govVoiceOpenFeignClient.resiArticleDetail(articleDetailFormDTO); } } diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index 27eb5433d6..dad9543720 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -12,6 +12,7 @@ import com.epmet.dto.form.TagCascadeListFormDTO; import com.epmet.dto.result.ArticleListResultDTO; import com.epmet.dto.result.ArticleWithTagsResultDTO; import com.epmet.dto.result.TagInfoResultDTO; +import com.epmet.feign.GovVoiceOpenFeignClient; import com.epmet.service.ArticleService; import com.epmet.utils.ModuleConstant; import org.apache.commons.lang3.StringUtils; @@ -34,6 +35,8 @@ public class ArticleServiceImpl implements ArticleService { @Autowired private GovVoiceFeignClient govVoiceFeignClient; + @Autowired + private GovVoiceOpenFeignClient govVoiceOpenFeignClient; /** * @Description 首页标签及更多——居民端 @@ -67,7 +70,7 @@ public class ArticleServiceImpl implements ArticleService { **/ @Override public List articleList(ArticlePageFormDTO articlePageFormDTO) { - Result> articles = govVoiceFeignClient.resiArticleList(articlePageFormDTO); + Result> articles = govVoiceOpenFeignClient.resiArticleList(articlePageFormDTO); if(articles.success() && null != articles.getData() && articles.getData().size() > NumConstant.ZERO){ return articles.getData().stream().map(article -> { ArticleWithTagsResultDTO artObj = ConvertUtils.sourceToTarget(article,ArticleWithTagsResultDTO.class); From 10fb1b8146cba227783e257c00607e25a8f8d17b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 4 Jun 2020 22:14:44 +0800 Subject: [PATCH 48/54] =?UTF-8?q?=E6=96=B0=E5=A2=9EGovVoiceOpenFeignClient?= =?UTF-8?q?,=E5=88=A0=E9=99=A4=E5=8E=9F=E6=9D=A5=E7=9A=84GovVoiceFeignClie?= =?UTF-8?q?nt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/feign/GovVoiceFeignClient.java | 39 ------------------- .../fallback/GovVoiceFeignClientFallBack.java | 28 ------------- .../epmet/feign/GovVoiceOpenFeignClient.java | 26 +++++++++---- .../GovVoiceOpenFeignClientFallback.java | 23 ++++++----- .../epmet/controller/ArticleController.java | 5 --- .../epmet/controller/ArticleController.java | 10 +++-- .../service/impl/ArticleServiceImpl.java | 8 +--- 7 files changed, 42 insertions(+), 97 deletions(-) delete mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java delete mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/fallback/GovVoiceFeignClientFallBack.java rename epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/{ => fallback}/GovVoiceOpenFeignClientFallback.java (71%) diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java deleted file mode 100644 index 6a03cbafbc..0000000000 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/GovVoiceFeignClient.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.epmet.dto.feign; - - -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.feign.fallback.GovVoiceFeignClientFallBack; -import com.epmet.dto.form.*; -import com.epmet.dto.result.*; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; - -import java.util.List; - -/** - * @Author zxc - * @CreateTime 2020/6/2 16:05 - * , url = "localhost:8105" - */ -//@FeignClient(name = ServiceConstant.GOV_VOICE_SERVER, fallback = GovVoiceFeignClientFallBack.class,url = "localhost:8105") -@FeignClient(name = ServiceConstant.GOV_VOICE_SERVER, fallback = GovVoiceFeignClientFallBack.class) -public interface GovVoiceFeignClient { - - /** - * @Description 已发布列表页的标签——居民端 - * @param formDto - * @author zxc - */ - @PostMapping("/gov/voice/tag/resitaglist") - Result> resiTagList(@RequestBody ResiTagListFormDTO formDto); - - /** - * @Description 标签级联查询——居民端 - * @param formDto - * @author zxc - */ - @PostMapping("/gov/voice/tag/tagcascadelist") - Result> tagCascadeList(@RequestBody TagCascadeListFormDTO formDto); -} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/fallback/GovVoiceFeignClientFallBack.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/fallback/GovVoiceFeignClientFallBack.java deleted file mode 100644 index 9e2c1eebba..0000000000 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/feign/fallback/GovVoiceFeignClientFallBack.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.epmet.dto.feign.fallback; - -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.ModuleUtils; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.feign.GovVoiceFeignClient; -import com.epmet.dto.form.*; -import com.epmet.dto.result.*; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * @Author zxc - * @CreateTime 2020/6/2 16:07 - */ -@Component -public class GovVoiceFeignClientFallBack implements GovVoiceFeignClient { - @Override - public Result> resiTagList(ResiTagListFormDTO formDto) { - return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "resiTagList", formDto); - } - - @Override - public Result> tagCascadeList(TagCascadeListFormDTO formDto) { - return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "tagCascadeList", formDto); - } -} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClient.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClient.java index eb9cf4c240..3bbc14112f 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClient.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClient.java @@ -3,13 +3,9 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.ArticlePageFormDTO; -import com.epmet.dto.form.CommonArticleListFormDTO; -import com.epmet.dto.form.ResiArticleDetailFormDTO; -import com.epmet.dto.result.ArticleBannerResultDTO; -import com.epmet.dto.result.ArticleDetailResultDTO; -import com.epmet.dto.result.ArticleLatestResultDTO; -import com.epmet.dto.result.ArticleListResultDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.feign.fallback.GovVoiceOpenFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -25,6 +21,22 @@ import java.util.List; @FeignClient(name = ServiceConstant.GOV_VOICE_SERVER, fallback = GovVoiceOpenFeignClientFallback.class) public interface GovVoiceOpenFeignClient { + /** + * @Description 已发布列表页的标签——居民端 + * @param formDto + * @author zxc + */ + @PostMapping("/gov/voice/tag/resitaglist") + Result> resiTagList(@RequestBody ResiTagListFormDTO formDto); + + /** + * @Description 标签级联查询——居民端 + * @param formDto + * @author zxc + */ + @PostMapping("/gov/voice/tag/tagcascadelist") + Result> tagCascadeList(@RequestBody TagCascadeListFormDTO formDto); + /** * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 * @param commonArticleListFormDTO :: getGridId :: getNum diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClientFallback.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/fallback/GovVoiceOpenFeignClientFallback.java similarity index 71% rename from epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClientFallback.java rename to epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/fallback/GovVoiceOpenFeignClientFallback.java index 16b020b732..9ed332730a 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClientFallback.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/fallback/GovVoiceOpenFeignClientFallback.java @@ -1,15 +1,11 @@ -package com.epmet.feign; +package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.ArticlePageFormDTO; -import com.epmet.dto.form.CommonArticleListFormDTO; -import com.epmet.dto.form.ResiArticleDetailFormDTO; -import com.epmet.dto.result.ArticleBannerResultDTO; -import com.epmet.dto.result.ArticleDetailResultDTO; -import com.epmet.dto.result.ArticleLatestResultDTO; -import com.epmet.dto.result.ArticleListResultDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.feign.GovVoiceOpenFeignClient; import org.springframework.stereotype.Component; import java.util.List; @@ -21,7 +17,16 @@ import java.util.List; * @date 2020/6/4 16:01 */ @Component -public class GovVoiceOpenFeignClientFallback implements GovVoiceOpenFeignClient{ +public class GovVoiceOpenFeignClientFallback implements GovVoiceOpenFeignClient { + @Override + public Result> resiTagList(ResiTagListFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "resiTagList", formDto); + } + + @Override + public Result> tagCascadeList(TagCascadeListFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "tagCascadeList", formDto); + } @Override public Result> resiTopArticleList(CommonArticleListFormDTO commonArticleListFormDTO) { diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index fd551fbe25..bb1013913f 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -32,11 +32,6 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.ArticleDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.dto.form.ArticlePageFormDTO; -import com.epmet.dto.form.CommonArticleListFormDTO; -import com.epmet.dto.result.ArticleBannerResultDTO; -import com.epmet.dto.result.ArticleLatestResultDTO; -import com.epmet.dto.result.ArticleWithTagsResultDTO; import com.epmet.excel.ArticleExcel; import com.epmet.service.ArticleOperateRecordService; import com.epmet.service.ArticleService; diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 346549afd2..4db3c1162b 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -4,9 +4,13 @@ import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.feign.GovVoiceFeignClient; -import com.epmet.dto.form.*; -import com.epmet.dto.result.*; +import com.epmet.dto.form.ArticlePageFormDTO; +import com.epmet.dto.form.ResiArticleDetailFormDTO; +import com.epmet.dto.form.ResiTagListFormDTO; +import com.epmet.dto.form.TagCascadeListFormDTO; +import com.epmet.dto.result.ArticleDetailResultDTO; +import com.epmet.dto.result.ArticleWithTagsResultDTO; +import com.epmet.dto.result.TagInfoResultDTO; import com.epmet.feign.GovVoiceOpenFeignClient; import com.epmet.service.ArticleService; import org.springframework.beans.factory.annotation.Autowired; diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index dad9543720..565e6bfda3 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -5,7 +5,6 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.feign.GovVoiceFeignClient; import com.epmet.dto.form.ArticlePageFormDTO; import com.epmet.dto.form.ResiTagListFormDTO; import com.epmet.dto.form.TagCascadeListFormDTO; @@ -22,7 +21,6 @@ import org.springframework.stereotype.Service; import java.util.Arrays; import java.util.HashSet; import java.util.List; -import java.util.Set; import java.util.stream.Collectors; @@ -33,8 +31,6 @@ import java.util.stream.Collectors; @Service public class ArticleServiceImpl implements ArticleService { - @Autowired - private GovVoiceFeignClient govVoiceFeignClient; @Autowired private GovVoiceOpenFeignClient govVoiceOpenFeignClient; @@ -47,7 +43,7 @@ public class ArticleServiceImpl implements ArticleService { public List resiTagList(TokenDto tokenDto, ResiTagListFormDTO formDto) { // formDto.setCustomerId(tokenDto.getCustomerId()); formDto.setUserId(tokenDto.getUserId()); - return govVoiceFeignClient.resiTagList(formDto).getData(); + return govVoiceOpenFeignClient.resiTagList(formDto).getData(); } /** @@ -58,7 +54,7 @@ public class ArticleServiceImpl implements ArticleService { @Override public List tagCascadeList(TokenDto tokenDto, TagCascadeListFormDTO formDto) { // formDto.setCustomerId(tokenDto.getCustomerId()); - return govVoiceFeignClient.tagCascadeList(formDto).getData(); + return govVoiceOpenFeignClient.tagCascadeList(formDto).getData(); } /** From ca0eb0f7a91bb69a0db18634a25b74e6dce6faef Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 4 Jun 2020 22:15:24 +0800 Subject: [PATCH 49/54] =?UTF-8?q?=E6=96=B0=E5=A2=9EGovVoiceOpenFeignClient?= =?UTF-8?q?,=E5=88=A0=E9=99=A4=E5=8E=9F=E6=9D=A5=E7=9A=84GovVoiceFeignClie?= =?UTF-8?q?nt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/ArticleController.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 4db3c1162b..2a8bbfd988 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -36,7 +36,6 @@ public class ArticleController { * @author zxc */ @PostMapping("taglist") -// @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISHED_LIST) public Result> resiTagList(@LoginUser TokenDto tokenDto, @RequestBody ResiTagListFormDTO formDto){ ValidatorUtils.validateEntity(formDto, ResiTagListFormDTO.ResiTagListForm.class); return new Result>().ok(articleService.resiTagList(tokenDto,formDto)); @@ -48,7 +47,6 @@ public class ArticleController { * @author zxc */ @PostMapping("tagcascadelist") -// @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISHED_LIST) public Result> tagCascadeList(@LoginUser TokenDto tokenDto, @RequestBody TagCascadeListFormDTO formDto){ ValidatorUtils.validateEntity(formDto, TagCascadeListFormDTO.TagCascadeList.class); return new Result>().ok(articleService.tagCascadeList(tokenDto,formDto)); From e5acef4585db6d271cc55a58bb4029e8919a4eb5 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 4 Jun 2020 23:15:04 +0800 Subject: [PATCH 50/54] =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../deploy/docker-compose-dev.yml | 17 ++ .../deploy/docker-compose-test.yml | 17 ++ epmet-openapi/epmet-openapi-scan/pom.xml | 136 +++++++++++++++ .../epmet/openapi/scan/ScanApplication.java | 28 +++ .../openapi/scan/aspect/RequestLogAspect.java | 40 +++++ .../openapi/scan/common/enu/ImgSceneEnum.java | 46 +++++ .../openapi/scan/common/enu/RegionIdEnum.java | 49 ++++++ .../scan/controller/TestController.java | 36 ++++ .../openapi/scan/support/param/ScanParam.java | 37 ++++ .../openapi/scan/support/param/Task.java | 25 +++ .../src/main/resources/bootstrap.yml | 77 ++++++++ .../src/main/resources/logback-spring.xml | 164 ++++++++++++++++++ .../src/test/java/BaseSample.java | 50 ++++++ .../java/ImageAsyncScanRequestSample.java | 95 ++++++++++ .../java/ImageAsyncScanResultsSample.java | 83 +++++++++ .../test/java/ImageSyncScanRequestSample.java | 101 +++++++++++ epmet-openapi/pom.xml | 18 ++ pom.xml | 1 + 18 files changed, 1020 insertions(+) create mode 100644 epmet-openapi/epmet-openapi-scan/deploy/docker-compose-dev.yml create mode 100644 epmet-openapi/epmet-openapi-scan/deploy/docker-compose-test.yml create mode 100644 epmet-openapi/epmet-openapi-scan/pom.xml create mode 100644 epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/ScanApplication.java create mode 100644 epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/aspect/RequestLogAspect.java create mode 100644 epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/ImgSceneEnum.java create mode 100644 epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/RegionIdEnum.java create mode 100644 epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/TestController.java create mode 100644 epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ScanParam.java create mode 100644 epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/Task.java create mode 100644 epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml create mode 100644 epmet-openapi/epmet-openapi-scan/src/main/resources/logback-spring.xml create mode 100644 epmet-openapi/epmet-openapi-scan/src/test/java/BaseSample.java create mode 100644 epmet-openapi/epmet-openapi-scan/src/test/java/ImageAsyncScanRequestSample.java create mode 100644 epmet-openapi/epmet-openapi-scan/src/test/java/ImageAsyncScanResultsSample.java create mode 100644 epmet-openapi/epmet-openapi-scan/src/test/java/ImageSyncScanRequestSample.java create mode 100644 epmet-openapi/pom.xml diff --git a/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-dev.yml b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-dev.yml new file mode 100644 index 0000000000..8aed7ac022 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-dev.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + epmet-user-server: + container_name: epmet-openapi-scan-dev + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-openapi-scan:0.3.56 + ports: + - "8107:8107" + network_mode: host # 不会创建新的网络 + volumes: + - "/opt/epmet-cloud-logs/dev:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 300M \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-test.yml b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-test.yml new file mode 100644 index 0000000000..ef6895dc7b --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-test.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + epmet-user-server: + container_name: epmet-openapi-scan-test + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-user-scan:0.3.53 + ports: + - "8107:8107" + network_mode: host # 不会创建新的网络 + volumes: + - "/opt/epmet-cloud-logs/test:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 300M \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-scan/pom.xml b/epmet-openapi/epmet-openapi-scan/pom.xml new file mode 100644 index 0000000000..47462e4a16 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/pom.xml @@ -0,0 +1,136 @@ + + + + epmet-cloud + com.epmet + 2.0.0 + + 4.0.0 + + epmet-openapi-scan + jar + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework + spring-context-support + + + org.springframework.boot + spring-boot-starter-actuator + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + com.epmet + epmet-commons-tools + 2.0.0 + + + + com.aliyun + aliyun-java-sdk-core + 3.5.0 + + + com.aliyun + aliyun-java-sdk-green + 3.5.0 + + + + org.apache.httpcomponents + httpclient + 4.5.2 + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + + ${project.basedir}/src/main/java + + + true + ${basedir}/src/main/resources + + + + + + + dev + + true + + + 8107 + dev + + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + + + false + + + + + test + + + 8107 + test + + + 0 + r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com + 6379 + EpmEtrEdIs!q@w + + true + 192.168.10.150:8848 + 67e3c350-533e-4d7c-9f8f-faf1b4aa82ae + + + false + + + + + + \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/ScanApplication.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/ScanApplication.java new file mode 100644 index 0000000000..b87a8dc231 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/ScanApplication.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.openapi.scan; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * 管理后台 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ + +@SpringBootApplication +public class ScanApplication { + + public static void main(String[] args) { + SpringApplication.run(ScanApplication.class, args); + } + +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/aspect/RequestLogAspect.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..ae6960a52d --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/aspect/RequestLogAspect.java @@ -0,0 +1,40 @@ +package com.epmet.openapi.scan.aspect; + +import com.epmet.commons.tools.aspect.BaseRequestLogAspect; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * 日志/异常处理切面实现,调用父类方法完成日志记录和异常处理。 + */ +@Aspect +@Component +@Order(0) +public class RequestLogAspect extends BaseRequestLogAspect { + + @Override + @Around(value = "execution(* com.epmet.openapi.scan.controller.*Controller*.*(..)) ") + public Object proceed(ProceedingJoinPoint point) throws Throwable { + return super.proceed(point, getRequest()); + } + + /** + * 获取Request对象 + * + * @return + */ + private HttpServletRequest getRequest() { + RequestAttributes ra = RequestContextHolder.getRequestAttributes(); + ServletRequestAttributes sra = (ServletRequestAttributes) ra; + return sra.getRequest(); + } + +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/ImgSceneEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/ImgSceneEnum.java new file mode 100644 index 0000000000..1fcbbba9f0 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/ImgSceneEnum.java @@ -0,0 +1,46 @@ +package com.epmet.openapi.scan.common.enu; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author jianjun liu + * @date 2020-06-04 21:39 + **/ +public enum ImgSceneEnum { + PORN("porn", "图片智能鉴黄"), + TERRORISM("terrorism", "图片暴恐涉政识别"); + + private String code; + private String desc; + + ImgSceneEnum(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public static List getImgSceneList() { + List result = new ArrayList<>(); + ImgSceneEnum[] values = ImgSceneEnum.values(); + for (ImgSceneEnum v : values) { + result.add(v.getCode()); + } + return result; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/RegionIdEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/RegionIdEnum.java new file mode 100644 index 0000000000..e1dbd5897b --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/RegionIdEnum.java @@ -0,0 +1,49 @@ +package com.epmet.openapi.scan.common.enu; + +/** + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-04 21:39 + **/ +public enum RegionIdEnum { + SHANG_HAI("cn-shanghai","green.cn-shanghai.aliyuncs.com"), + BEI_JING("cn-beijing","green.cn-beijing.aliyuncs.com"), + AP_SOUTHEAST_1("ap-southeast-1","green.ap-southeast-1.aliyuncs.com"), + US_WEST_1("us-west-1","green.us-west-1.aliyuncs.com"); + + private String regionId; + private String domain; + RegionIdEnum(String regionId, String domain){ + this.regionId = regionId; + this.domain = domain; + } + + public static String getDoMain(String regionId){ + if (regionId == null) { + return SHANG_HAI.getDomain(); + } + RegionIdEnum[] values = RegionIdEnum.values(); + for (RegionIdEnum v : values) { + if (regionId.equals(v.getDomain())) { + return v.getDomain(); + } + } + return SHANG_HAI.getDomain(); + } + + public String getRegionId() { + return regionId; + } + + public void setRegionId(String regionId) { + this.regionId = regionId; + } + + public String getDomain() { + return domain; + } + + public void setDomain(String domain) { + this.domain = domain; + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/TestController.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/TestController.java new file mode 100644 index 0000000000..e903a8d0e7 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/TestController.java @@ -0,0 +1,36 @@ +package com.epmet.openapi.scan.controller; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.utils.Result; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author jianjun liu + * @date 2020-06-04 20:39 + **/ +@RestController +@RequestMapping("test") +public class TestController { + @Value("${aliyun.green.accessKeyId}") + private String accessKeyId; + + @Value("${aliyun.green.accessKeySecret}") + private String accessKeySecret; + + @Value("${aliyun.green.regionId}") + private String regionId; + @GetMapping("api") + public Result page() { + Map map = new HashMap<>(); + map.put(accessKeyId,accessKeyId); + map.put(accessKeySecret,accessKeySecret); + map.put(regionId, regionId); + return new Result().ok(JSON.toJSONString(map)); + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ScanParam.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ScanParam.java new file mode 100644 index 0000000000..d589aa33b7 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ScanParam.java @@ -0,0 +1,37 @@ +package com.epmet.openapi.scan.support.param; + +import lombok.Data; + +import java.util.List; + +/** + * 审查参数 + * + * @author jianjun liu + * @date 2020-06-04 21:57 + **/ +@Data +public class ScanParam { + /** + * 场景 必填 + * + * @see com.epmet.openapi.scan.common.enu.ImgSceneEnum; + */ + private List scenes; + + /** + * 要检测的内容列表,必填 + * remark:一组任务列表中的taskId不能相同 + */ + private List tasks; + + /** + * 异步检测结果回调地址,执行异步审查内容时 必填 + */ + private String callback; + + /** + * 随机字符串,该值用于回调通知请求中的签名,使用callback时 必填 + */ + private String seed; +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/Task.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/Task.java new file mode 100644 index 0000000000..51f38b1b3b --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/Task.java @@ -0,0 +1,25 @@ +package com.epmet.openapi.scan.support.param; + +import lombok.Data; + +/** + * 任务参数 + * + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-04 22:13 + **/ +@Data +public class Task { + + /** + * 要检测的数据id 非必填 + * + * */ + private String dataId; + + /** + * 图片url 必填 + */ + private String url; +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml b/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000..c2cf89a17e --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml @@ -0,0 +1,77 @@ +server: + port: @server.port@ + servlet: + context-path: /epmetscan + +spring: + main: + allow-bean-definition-overriding: true + application: + name: epmet-openapi-scan + #环境 dev|test|prod + profiles: + active: dev + messages: + encoding: UTF-8 + basename: i18n/messages_common + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + redis: + database: @spring.redis.index@ + host: @spring.redis.host@ + port: @spring.redis.port@ + password: @spring.redis.password@ + timeout: 30s + cloud: + nacos: + discovery: + server-addr: @nacos.server-addr@ + #nacos的命名空间ID,默认是public + namespace: @nacos.discovery.namespace@ + #不把自己注册到注册中心的地址 + register-enabled: @nacos.register-enabled@ + ip: @nacos.ip@ + config: + enabled: @nacos.config-enabled@ + server-addr: @nacos.server-addr@ + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + file-extension: yaml +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +feign: + hystrix: + enabled: true + client: + config: + default: + loggerLevel: BASIC + httpclient: + enabled: true + + +hystrix: + command: + default: + execution: + isolation: + thread: + timeoutInMilliseconds: 60000 #缺省为1000 + +ribbon: + ReadTimeout: 300000 + ConnectTimeout: 300000 + +aliyun: + green: + accessKeyId: 123 + accessKeySecret: 456 + regionId: cn-shanghai \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-scan/src/main/resources/logback-spring.xml b/epmet-openapi/epmet-openapi-scan/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..d244b6fa2a --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/resources/logback-spring.xml @@ -0,0 +1,164 @@ + + + + + + + + + + ${appname} + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + ${log.path}/error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-openapi/epmet-openapi-scan/src/test/java/BaseSample.java b/epmet-openapi/epmet-openapi-scan/src/test/java/BaseSample.java new file mode 100644 index 0000000000..8c0774030d --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/test/java/BaseSample.java @@ -0,0 +1,50 @@ +import java.io.IOException; +import java.util.Properties; + +/** + * Created by liuhai.lh on 17/01/12. + */ +public class BaseSample { + + protected static String accessKeyId = "123"; + protected static String accessKeySecret = "456"; + + protected static String regionId = "cn-shanghai"; + + static { + Properties properties = new Properties(); + + try { + properties.load(BaseSample.class.getResourceAsStream("bootstrap.yml")); + accessKeyId = properties.getProperty("aliyun.green.accessKeyId"); + accessKeySecret = properties.getProperty("aliyun.green.accessKeySecret"); + regionId = properties.getProperty("aliyun.green.url"); + } catch(IOException e) { + e.printStackTrace(); + } + + } + protected static String getDomain(){ + if("cn-shanghai".equals(regionId)){ + return "green.cn-shanghai.aliyuncs.com"; + } + + if ("cn-beijing".equals(regionId)) { + return "green.cn-beijing.aliyuncs.com"; + } + + if ("ap-southeast-1".equals(regionId)) { + return "green.ap-southeast-1.aliyuncs.com"; + } + + if ("us-west-1".equals(regionId)) { + return "green.us-west-1.aliyuncs.com"; + } + + return "green.cn-shanghai.aliyuncs.com"; + } + protected static String getEndPointName(){ + return regionId; + } + +} diff --git a/epmet-openapi/epmet-openapi-scan/src/test/java/ImageAsyncScanRequestSample.java b/epmet-openapi/epmet-openapi-scan/src/test/java/ImageAsyncScanRequestSample.java new file mode 100644 index 0000000000..acba42e763 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/test/java/ImageAsyncScanRequestSample.java @@ -0,0 +1,95 @@ +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.aliyuncs.DefaultAcsClient; +import com.aliyuncs.IAcsClient; +import com.aliyuncs.exceptions.ClientException; +import com.aliyuncs.exceptions.ServerException; +import com.aliyuncs.green.model.v20180509.ImageAsyncScanRequest; +import com.aliyuncs.http.FormatType; +import com.aliyuncs.http.HttpResponse; +import com.aliyuncs.profile.DefaultProfile; +import com.aliyuncs.profile.IClientProfile; +import com.epmet.openapi.scan.common.enu.RegionIdEnum; + +import java.util.*; + +/** + * Created by liuhai.lh on 2017/2/17. + * 图片异步检测接口 + * @author liuhai.lh + * @date 2017/02/17 + */ +public class ImageAsyncScanRequestSample extends BaseSample{ + + public static void main(String[] args) throws Exception { + //请替换成你自己的accessKeyId、accessKeySecret + IClientProfile profile = DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret); + DefaultProfile.addEndpoint(getEndPointName(), regionId, "Green", RegionIdEnum.getDoMain(regionId)); + IAcsClient client = new DefaultAcsClient(profile); + + ImageAsyncScanRequest imageAsyncScanRequest = new ImageAsyncScanRequest(); + imageAsyncScanRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式 + imageAsyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法 + imageAsyncScanRequest.setEncoding("utf-8"); + imageAsyncScanRequest.setRegionId(regionId); + + + List> tasks = new ArrayList>(); + Map task1 = new LinkedHashMap(); + task1.put("dataId", UUID.randomUUID().toString()); + task1.put("url", "https://img.alicdn.com/tfs/TB1Xk_qvwmTBuNjy1XbXXaMrVXa-550-407.jpg"); + task1.put("time", new Date()); + + tasks.add(task1); + JSONObject data = new JSONObject(); + /** + * porn: 色情 + * terrorism: 暴恐 + * qrcode: 二维码 + * ad: 图片广告 + * ocr: 文字识别 + */ + data.put("scenes", Arrays.asList("porn", "ocr", "qrcode", "sface")); + data.put("tasks", tasks); + + imageAsyncScanRequest.setHttpContent(data.toJSONString().getBytes("UTF-8"), "UTF-8", FormatType.JSON); + + /** + * 请务必设置超时时间 + */ + imageAsyncScanRequest.setConnectTimeout(3000); + imageAsyncScanRequest.setReadTimeout(6000); + + try { + HttpResponse httpResponse = client.doAction(imageAsyncScanRequest); + + if(httpResponse.isSuccess()){ + JSONObject scrResponse = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8")); + System.out.println(JSON.toJSONString(scrResponse, true)); + if (200 == scrResponse.getInteger("code")) { + JSONArray taskResults = scrResponse.getJSONArray("data"); + for (Object taskResult : taskResults) { + if(200 == ((JSONObject)taskResult).getInteger("code")){ + String taskId = ((JSONObject)taskResult).getString("taskId"); + // 将taskId 保存下来,间隔一段时间来轮询结果, 参照ImageAsyncScanResultsRequest + System.out.println("args = [" + taskId + "]"); + }else{ + System.out.println("task process fail:" + ((JSONObject)taskResult).getInteger("code")); + } + } + } else { + System.out.println("detect not success. code:" + scrResponse.getInteger("code")); + } + }else{ + System.out.println("response not success. status:" + httpResponse.getStatus()); + } + } catch (ServerException e) { + e.printStackTrace(); + } catch (ClientException e) { + e.printStackTrace(); + } catch (Exception e){ + e.printStackTrace(); + } + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/test/java/ImageAsyncScanResultsSample.java b/epmet-openapi/epmet-openapi-scan/src/test/java/ImageAsyncScanResultsSample.java new file mode 100644 index 0000000000..27e0b6e233 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/test/java/ImageAsyncScanResultsSample.java @@ -0,0 +1,83 @@ +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.aliyuncs.DefaultAcsClient; +import com.aliyuncs.IAcsClient; +import com.aliyuncs.exceptions.ClientException; +import com.aliyuncs.exceptions.ServerException; +import com.aliyuncs.green.model.v20180509.ImageAsyncScanResultsRequest; +import com.aliyuncs.http.FormatType; +import com.aliyuncs.http.HttpResponse; +import com.aliyuncs.profile.DefaultProfile; +import com.aliyuncs.profile.IClientProfile; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by liuhai.lh on 2017/2/17. + * 获取图片异步检测结果接口 + * @author liuhai.lh + * @date 2017/02/17 + */ +public class ImageAsyncScanResultsSample extends BaseSample{ + + public static void main(String[] args) throws Exception { + //请替换成你自己的accessKeyId、accessKeySecret + IClientProfile profile = DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret); + DefaultProfile.addEndpoint(getEndPointName(), regionId, "Green", getDomain()); + IAcsClient client = new DefaultAcsClient(profile); + + ImageAsyncScanResultsRequest imageAsyncScanResultsRequest = new ImageAsyncScanResultsRequest(); + imageAsyncScanResultsRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式 + imageAsyncScanResultsRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法 + imageAsyncScanResultsRequest.setEncoding("utf-8"); + imageAsyncScanResultsRequest.setRegionId(regionId); + + + List taskIds = new ArrayList(); + taskIds.add("img1hdP5Wn0QC@7wW0n$VX0R@-1p3mnZ"); + imageAsyncScanResultsRequest.setHttpContent(JSON.toJSONString(taskIds).getBytes("UTF-8"), "UTF-8", FormatType.JSON); + + /** + * 请务必设置超时时间 + */ + imageAsyncScanResultsRequest.setConnectTimeout(3000); + imageAsyncScanResultsRequest.setReadTimeout(6000); + + try { + HttpResponse httpResponse = client.doAction(imageAsyncScanResultsRequest); + + if(httpResponse.isSuccess()){ + JSONObject scrResponse = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8")); + System.out.println(JSON.toJSONString(scrResponse, true)); + if (200 == scrResponse.getInteger("code")) { + JSONArray taskResults = scrResponse.getJSONArray("data"); + for (Object taskResult : taskResults) { + if(200 == ((JSONObject)taskResult).getInteger("code")){ + JSONArray sceneResults = ((JSONObject)taskResult).getJSONArray("results"); + for (Object sceneResult : sceneResults) { + String scene = ((JSONObject)sceneResult).getString("scene"); + String suggestion = ((JSONObject)sceneResult).getString("suggestion"); + //根据scene和suggetion做相关的处理 + //do something + } + }else{ + System.out.println("task process fail:" + ((JSONObject)taskResult).getInteger("code")); + } + } + } else { + System.out.println("detect not success. code:" + scrResponse.getInteger("code")); + } + }else{ + System.out.println("response not success. status:" + httpResponse.getStatus()); + } + } catch (ServerException e) { + e.printStackTrace(); + } catch (ClientException e) { + e.printStackTrace(); + } catch (Exception e){ + e.printStackTrace(); + } + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/test/java/ImageSyncScanRequestSample.java b/epmet-openapi/epmet-openapi-scan/src/test/java/ImageSyncScanRequestSample.java new file mode 100644 index 0000000000..ec418154d9 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/test/java/ImageSyncScanRequestSample.java @@ -0,0 +1,101 @@ +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.aliyuncs.DefaultAcsClient; +import com.aliyuncs.IAcsClient; +import com.aliyuncs.exceptions.ClientException; +import com.aliyuncs.exceptions.ServerException; +import com.aliyuncs.green.model.v20180509.ImageSyncScanRequest; +import com.aliyuncs.http.FormatType; +import com.aliyuncs.http.HttpResponse; +import com.aliyuncs.profile.DefaultProfile; +import com.aliyuncs.profile.IClientProfile; + +import java.util.*; + +/** + * Created by liuhai.lh on 2017/2/17. + * 图片同步检测接口 + * @author liuhai.lh + * @date 2017/02/17 + */ +public class ImageSyncScanRequestSample extends BaseSample { + + + public static void main(String[] args) throws Exception { + //请替换成你自己的accessKeyId、accessKeySecret + IClientProfile profile = DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret); + DefaultProfile.addEndpoint(getEndPointName(), regionId, "Green", getDomain()); + IAcsClient client = new DefaultAcsClient(profile); + + ImageSyncScanRequest imageSyncScanRequest = new ImageSyncScanRequest(); + imageSyncScanRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式 + imageSyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法 + imageSyncScanRequest.setEncoding("utf-8"); + imageSyncScanRequest.setRegionId(regionId); + + + List> tasks = new ArrayList>(); + Map task = new LinkedHashMap(); + task.put("dataId", UUID.randomUUID().toString()); + task.put("url", "http://f.hiphotos.baidu.com/image/pic/item/aa18972bd40735fa13899ac392510fb30f24084b.jpg"); + task.put("time", new Date()); + + tasks.add(task); + JSONObject data = new JSONObject(); + /** + * porn: 色情 + * terrorism: 暴恐 + * qrcode: 二维码 + * ad: 图片广告 + * ocr: 文字识别 + */ + data.put("scenes", Arrays.asList("porn","terrorism")); + data.put("tasks", tasks); + + imageSyncScanRequest.setHttpContent(data.toJSONString().getBytes("UTF-8"), "UTF-8", FormatType.JSON); + + /** + * 请务必设置超时时间 + */ + imageSyncScanRequest.setConnectTimeout(3000); + imageSyncScanRequest.setReadTimeout(10000); + + try { + HttpResponse httpResponse = client.doAction(imageSyncScanRequest); + + if (httpResponse.isSuccess()) { + JSONObject scrResponse = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8")); + System.out.println(JSON.toJSONString(scrResponse, true)); + if (200 == scrResponse.getInteger("code")) { + JSONArray taskResults = scrResponse.getJSONArray("data"); + for (Object taskResult : taskResults) { + if(200 == ((JSONObject)taskResult).getInteger("code")){ + JSONArray sceneResults = ((JSONObject)taskResult).getJSONArray("results"); + for (Object sceneResult : sceneResults) { + String scene = ((JSONObject)sceneResult).getString("scene"); + String suggestion = ((JSONObject)sceneResult).getString("suggestion"); + //根据scene和suggetion做相关的处理 + //do something + System.out.println("args = [" + scene + "]"); + System.out.println("args = [" + suggestion + "]"); + } + }else{ + System.out.println("task process fail:" + ((JSONObject)taskResult).getInteger("code")); + } + } + } else { + System.out.println("detect not success. code:" + scrResponse.getInteger("code")); + } + } else { + System.out.println("response not success. status:" + httpResponse.getStatus()); + } + } catch (ServerException e) { + e.printStackTrace(); + } catch (ClientException e) { + e.printStackTrace(); + } catch (Exception e){ + e.printStackTrace(); + } + } +} diff --git a/epmet-openapi/pom.xml b/epmet-openapi/pom.xml new file mode 100644 index 0000000000..47fcd27942 --- /dev/null +++ b/epmet-openapi/pom.xml @@ -0,0 +1,18 @@ + + + + epmet-cloud + com.epmet + 2.0.0 + + 4.0.0 + jar + + epmet-openapi + + epmet-openapi-scan + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 741f491b12..ee379a6b7a 100644 --- a/pom.xml +++ b/pom.xml @@ -27,6 +27,7 @@ epmet-admin epmet-module epmet-user + epmet-openapi From 719951d71b0afb7435212b5d4f95f70e0ffa9371 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 5 Jun 2020 09:57:08 +0800 Subject: [PATCH 51/54] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ArticleServiceImpl.java | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) 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 5219c1de67..b5e4cb2a44 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 @@ -23,9 +23,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; @@ -43,13 +45,14 @@ import com.epmet.dto.feign.GovOrgSelfFeignClient; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.*; +import com.epmet.feign.EpmetUserClientFeignClient; import com.epmet.feign.EpmetUserSelfFeignClient; import com.epmet.redis.ArticleRedis; import com.epmet.service.ArticleOperateRecordService; import com.epmet.service.ArticlePublishRangeService; import com.epmet.service.ArticleService; -import com.epmet.utils.ModuleConstant; import com.epmet.service.ArticleVisitRecordService; +import com.epmet.utils.ModuleConstant; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; @@ -92,6 +95,10 @@ public class ArticleServiceImpl extends BaseServiceImpl loginUserDetails = epmetUserClientFeignClient.getLoginUserDetails(detailsFormDTO); + if (loginUserDetails == null || loginUserDetails.getData() == null){ + log.warn("saveOrUpdateContent getloginUserDetails return null"); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(),EpmetErrorCode.SERVER_ERROR.getMsg()); + } draftEntity = new DraftEntity(); draftEntity.setTitle(fromDTO.getTitle()); draftEntity.setCustomerId(tokenDto.getCustomerId()); draftEntity.setIsTop(DraftConstant.UN_TOP); draftEntity.setStatusFlag(DraftConstant.UNPUBLISH); - draftEntity.setOrgId(""); - draftEntity.setOrgIdPath(""); + draftEntity.setOrgId(loginUserDetails.getData().getAgencyId()); + draftEntity.setOrgIdPath(loginUserDetails.getData().getOrgIdPath()); draftEntity.setGridId(""); - draftEntity.setDepartmentId(""); + draftEntity.setDepartmentId(loginUserDetails.getData().getCustomerId()); draftEntity.setDelFlag(NumConstant.ZERO_STR); - draftDao.insert(draftEntity); } @@ -348,7 +363,7 @@ public class ArticleServiceImpl extends BaseServiceImpl publishRangeEntityList = new ArrayList<>(); List agencyGridNameList = new ArrayList<>(); - ArticleGridResultDTO articleGridResultDTO = agencyGridList(tokenDto); + ArticleGridResultDTO articleGridResultDTO = this.agencyGridList(tokenDto); if (articleGridResultDTO == null) { log.warn("saveDraftAttr userId:{} have not right access publishRange", tokenDto.getUserId()); throw new RenException("参数错误"); @@ -422,6 +437,8 @@ public class ArticleServiceImpl extends BaseServiceImpl Date: Fri, 5 Jun 2020 12:27:28 +0800 Subject: [PATCH 52/54] =?UTF-8?q?=E8=8D=89=E7=A8=BF=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dao/DraftContentDao.java | 15 ++++- .../java/com/epmet/dao/DraftCoverDao.java | 15 ++++- .../com/epmet/dao/DraftPublishRangeDao.java | 14 ++++- .../com/epmet/service/ArticleService.java | 9 +++ .../service/impl/ArticleServiceImpl.java | 63 ++++++++++++++++++- .../java/com/epmet/utils/ModuleConstant.java | 15 +++++ .../main/resources/mapper/DraftContentDao.xml | 21 +++++++ .../main/resources/mapper/DraftCoverDao.xml | 18 ++++++ .../resources/mapper/DraftPublishRangeDao.xml | 17 +++++ 9 files changed, 181 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftContentDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftContentDao.java index 8d36568edf..3c7af386a0 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftContentDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftContentDao.java @@ -18,8 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.DraftContentDTO; import com.epmet.entity.DraftContentEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 草稿内容表 @@ -29,5 +33,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface DraftContentDao extends BaseDao { - + + /** + * @Description 通过草稿Id获取草稿内容并按照orderNum排序,默认拿取所有状态 + * @param draftId + * @param auditStatus + * @return List + * @author wangc + * @date 2020.06.05 10:28 + **/ + List selectByDraftId(@Param("draftId")String draftId,@Param("auditStatus")String auditStatus); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftCoverDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftCoverDao.java index b625204667..bcf58361e1 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftCoverDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftCoverDao.java @@ -18,8 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.DraftCoverDTO; import com.epmet.entity.DraftCoverEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 草稿封面表 @@ -29,5 +33,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface DraftCoverDao extends BaseDao { - + + /** + * @Description 通过草稿Id获取草稿封面且创建时间是为最新的 + * @param draftId + * @param auditStatus + * @return DraftCoverDTO + * @author wangc + * @date 2020.06.05 10:28 + **/ + DraftCoverDTO selectByDraftId(@Param("draftId")String draftId,@Param("auditStatus")String auditStatus); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftPublishRangeDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftPublishRangeDao.java index 98a6a65f8e..b3da6a7c4e 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftPublishRangeDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftPublishRangeDao.java @@ -18,8 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.DraftPublishRangeDTO; import com.epmet.entity.DraftPublishRangeEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 草稿发布范围表 @@ -29,5 +33,13 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface DraftPublishRangeDao extends BaseDao { - + + /** + * @Description 通过草稿Id获取草稿发布范围 + * @param draftId + * @return List + * @author wangc + * @date 2020.06.05 10:28 + **/ + List selectByDraftId(@Param("draftId")String draftId); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index 1fbeeadf2f..4e8613f908 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -230,4 +230,13 @@ public interface ArticleService extends BaseService { * @date 2020.06.03 18:28 **/ ArticleDetailResultDTO getArticleDetail(ResiArticleDetailFormDTO articleDetailFormDTO); + + /** + * @Description 草稿发布文章 + * @param draftId + * @return String 返回新发布文章的Id + * @author wangc + * @date 2020.06.05 09:10 + **/ + String publishDraftToArticle(String draftId); } \ No newline at end of file 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 5219c1de67..78817ea0fa 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 @@ -18,6 +18,7 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -36,9 +37,7 @@ import com.epmet.constant.ArticleConstant; import com.epmet.constant.DraftConstant; import com.epmet.constant.RoleKeyConstants; import com.epmet.dao.*; -import com.epmet.dto.ArticleDTO; -import com.epmet.dto.ArticleVisitRecordDTO; -import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.*; import com.epmet.dto.feign.GovOrgSelfFeignClient; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -92,6 +91,10 @@ public class ArticleServiceImpl extends BaseServiceImpl draftContents = draftContentDao.selectByDraftId(draftId,ModuleConstant.AUDIT_STATUS_PASS); + DraftCoverDTO draftCover = draftCoverDao.selectByDraftId(draftId,ModuleConstant.AUDIT_STATUS_PASS); + List draftPublishRange = draftPublishRangeDao.selectByDraftId(draftId); + + //3.生成文章以及相关记录 + ArticleEntity article = ConvertUtils.sourceToTarget(draft,ArticleEntity.class); + article.setId(null); + article.setDraftId(draftId); + baseDao.insert(article); + int order = NumConstant.ONE; + if(null != draftContents && draftContents.size() > NumConstant.ZERO){ + draftContents.forEach(content -> { + content.setOrderNum(order+NumConstant.ONE); + ArticleContentEntity contentToInsert = ConvertUtils.sourceToTarget(content,ArticleContentEntity.class); + contentToInsert.setArticleId(article.getId()); + contentToInsert.setId(null); + articleContentDao.insert(contentToInsert); + }); + } + if(null != draftPublishRange && draftPublishRange.size() > NumConstant.ZERO){ + draftPublishRange.forEach(range -> { + ArticlePublishRangeEntity rangeToInsert = ConvertUtils.sourceToTarget(range,ArticlePublishRangeEntity.class); + rangeToInsert.setArticleId(article.getId()); + rangeToInsert.setId(null); + articlePublishRangeDao.insert(rangeToInsert); + }); + if(null != draftCover){ + ArticleCoverEntity coverToInsert = ConvertUtils.sourceToTarget(draftCover,ArticleCoverEntity.class); + coverToInsert.setArticleId(article.getId()); + coverToInsert.setId(null); + articleCoverDao.insert(coverToInsert); + } + } + + return article.getId(); + } + + throw new RenException(String.format(ModuleConstant.SPECIFIED_DRAFT_NOT_FOUNT_EXCEPTION_TEMPLATE,draftId)); + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java index 1aa334094d..e3df228591 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java @@ -49,4 +49,19 @@ public interface ModuleConstant { * */ String SPECIFIED_ARTICLE_NOT_FOUND_EXCEPTION_TEMPLATE = "未找到指定文章,文章Id:【%s】,发布网格Id:【%s】,可能原因:没有该文章或者请求网格不在该文章发布范围内。"; + /** + * 审核类型 通过 + * */ + String AUDIT_STATUS_PASS = "pass"; + + /** + * 审核类型 失败 + * */ + String AUDIT_STATUS_FAIL = "fail"; + + /** + * 草稿未找到异常模板 + * */ + String SPECIFIED_DRAFT_NOT_FOUNT_EXCEPTION_TEMPLATE = "未找到指定草稿,草稿Id:【%s】"; + } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftContentDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftContentDao.xml index ad230ebefc..271ba5b972 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftContentDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftContentDao.xml @@ -3,5 +3,26 @@ + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftCoverDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftCoverDao.xml index f514eeceb3..03f8a04596 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftCoverDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftCoverDao.xml @@ -3,5 +3,23 @@ + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftPublishRangeDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftPublishRangeDao.xml index 2d2c8df78a..afcb6f71a9 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftPublishRangeDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftPublishRangeDao.xml @@ -3,5 +3,22 @@ + + \ No newline at end of file From 5ba9e9aa8757273a1fcabb158e48a5eaf05127a7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 5 Jun 2020 12:34:33 +0800 Subject: [PATCH 53/54] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF=E8=8D=89?= =?UTF-8?q?=E7=A8=BF=E9=A2=84=E8=A7=88=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/DraftDetailResultDTO.java | 62 +++++++++++++++++++ .../epmet/dto/result/GovDraftContentDTO.java | 27 ++++++++ .../epmet/controller/ArticleController.java | 14 +++++ .../src/main/java/com/epmet/dao/DraftDao.java | 38 +++++++++--- .../java/com/epmet/service/DraftService.java | 11 ++++ .../epmet/service/impl/DraftServiceImpl.java | 19 ++++-- .../src/main/resources/mapper/DraftDao.xml | 29 +++++++++ 7 files changed, 186 insertions(+), 14 deletions(-) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftDetailResultDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftDetailResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftDetailResultDTO.java new file mode 100644 index 0000000000..ccd0e9918e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftDetailResultDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 政府端:文章预览接口返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/5 10:56 + */ +@Data +public class DraftDetailResultDTO implements Serializable { + + private static final long serialVersionUID = 6156947260878857897L; + /** + * 草稿Id + */ + private String draftId; + + /** + * 标题 + */ + private String title; + + /** + * 发布单位名称 + */ + private String publisherName; + + /** + * 发布日期 + */ + @JsonFormat(pattern="yyyy-MM-dd") + private Date publishDate; + + /** + * 访问量 + */ + private Integer visitRecordCount; + + /** + * 标签字符串 已废弃 + */ + @JsonIgnore + private String tags; + + /** + * 内容列表 + */ + private List articleContentList; + + /** + * 标签名称数组 + */ + private String[] tagNameList; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java new file mode 100644 index 0000000000..1b0530e3e4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 政府端:文章预览接口返参DTO-内容列表 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/5 12:10 + */ +@Data +public class GovDraftContentDTO implements Serializable { + private static final long serialVersionUID = 5653062658148122552L; + + /** + * 内容类型,图片:img;文字:text + */ + private String contentType; + + /** + * 内容 + */ + private String content; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index bb1013913f..fbd76b780f 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -347,4 +347,18 @@ public class ArticleController { ValidatorUtils.validateEntity(articleDetailFormDTO,ResiArticleDetailFormDTO.ResiArticleDetailInternalGroup.class); return new Result().ok(articleService.getArticleDetail(articleDetailFormDTO)); } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei@elink-cn.com + * @description 政府端:文章预览 + * @date 2020/6/5 10:56 + **/ + @PostMapping("draftdetail") + public Result queryDraftDetail(@RequestBody DraftDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); + DraftDetailResultDTO draftDetailResultDTO = draftService.queryDraftDetail(formDTO); + return new Result().ok(draftDetailResultDTO); + } } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java index 4daa493ba0..39b47a54f9 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java @@ -36,40 +36,40 @@ public interface DraftDao extends BaseDao { /** * 政府端查询草稿内容详情 * - * @param draftId - * 草稿id + * @param draftId 草稿id + * @author yinzuomei */ DraftContentResultDTO selectDraftContent(String draftId); /** * 政府端查询草稿内容详情 * - * @param draftId - * 草稿id + * @param draftId 草稿id + * @author yinzuomei */ List selectDraftContentDetail(String draftId); /** * 政府端:选中草稿编辑,获取草稿属性 * - * @param draftId - * 草稿id + * @param draftId 草稿id + * @author yinzuomei */ DraftAttrResultDTO selectDraftAttr(String draftId); /** * 政府端:选中草稿编辑,获取草稿属性-封面信息 * - * @param draftId - * 草稿id + * @param draftId 草稿id + * @author yinzuomei */ CoverImgDTO selectDraftCoverImg(String draftId); /** * 政府端:选中草稿编辑,获取草稿属性-已选择发布网格 * - * @param draftId - * 草稿id + * @param draftId 草稿id + * @author yinzuomei */ List selectDraftGrids(String draftId); @@ -81,4 +81,22 @@ public interface DraftDao extends BaseDao { * @return java.util.List */ List selectDraftList(@Param("userId") String userId); + + /** + * @param draftId + * @return com.epmet.dto.result.DraftDetailResultDTO + * @author yinzuomei@elink-cn.com + * @description 文章预览-获取文章基本属性 + * @date 2020/6/5 12:23 + **/ + DraftDetailResultDTO selectDraftDetail(String draftId); + + /** + * @param draftId + * @return java.util.List + * @author yinzuomei@elink-cn.com + * @description 文章预览-获取文章内容列表 + * @date 2020/6/5 12:23 + **/ + List selectDraftContentList(String draftId); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java index ad56f053a9..a11c1361a3 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java @@ -26,6 +26,7 @@ import com.epmet.dto.form.DraftDetailFormDTO; import com.epmet.dto.form.DraftListFormDTO; import com.epmet.dto.result.DraftAttrResultDTO; import com.epmet.dto.result.DraftContentResultDTO; +import com.epmet.dto.result.DraftDetailResultDTO; import com.epmet.entity.DraftEntity; import java.util.List; @@ -137,4 +138,14 @@ public interface DraftService extends BaseService { * @return java.util.List */ PageData draftList(TokenDto tokenDto, DraftListFormDTO formDTO); + + /** + * 政府端:文章预览 + * + * @param formDTO + * @return com.epmet.dto.result.DraftContentResultDTO + * @author yinzuomei@elink-cn.com + * @date 2020-06-03 + */ + DraftDetailResultDTO queryDraftDetail(DraftDetailFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java index 709da69d32..1cd8271353 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java @@ -31,10 +31,7 @@ import com.epmet.dto.DraftDTO; import com.epmet.dto.form.DeleteDraftFormDTO; import com.epmet.dto.form.DraftDetailFormDTO; import com.epmet.dto.form.DraftListFormDTO; -import com.epmet.dto.result.CoverImgDTO; -import com.epmet.dto.result.DraftAttrResultDTO; -import com.epmet.dto.result.DraftContentResultDTO; -import com.epmet.dto.result.DraftListResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.DraftEntity; import com.epmet.redis.DraftRedis; import com.epmet.service.DraftService; @@ -159,4 +156,18 @@ public class DraftServiceImpl extends BaseServiceImpl imp return new PageData<>(resultList, pageInfo.getTotal()); } + @Override + public DraftDetailResultDTO queryDraftDetail(DraftDetailFormDTO formDTO) { + DraftDetailResultDTO draftDetailResultDTO=baseDao.selectDraftDetail(formDTO.getDraftId()); + if(null!=draftDetailResultDTO){ + List articleContentList=baseDao.selectDraftContentList(formDTO.getDraftId()); + draftDetailResultDTO.setArticleContentList(articleContentList); + if (StringUtils.isNoneBlank(draftDetailResultDTO.getTags())) { + String[] tagNames = draftDetailResultDTO.getTags().split("\\|"); + draftDetailResultDTO.setTagNameList(tagNames); + } + } + return draftDetailResultDTO; + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml index a74713fd55..0c1f84593f 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml @@ -96,4 +96,33 @@ AND (STATUS_FLAG = 'unpublish' OR STATUS_FLAG = 'auditfail') AND CREATED_BY = #{userId} + + + + \ No newline at end of file From 5a2625d9fc85ea8755a83faf5b5f5997d07ae751 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 5 Jun 2020 12:40:39 +0800 Subject: [PATCH 54/54] =?UTF-8?q?=E5=85=9A=E5=BB=BA=E5=A3=B0=E9=9F=B3-?= =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF-=E5=8F=AF=E4=B8=8B=E7=BA=BF?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/ArticleGridResultDTO.java | 5 +- .../impl/CustomerAgencyServiceImpl.java | 7 +- .../dto/form/PublishGridListFormDTO.java | 4 + .../epmet/controller/ArticleController.java | 1 + .../service/impl/ArticleServiceImpl.java | 148 ++++++++++++++++-- .../epmet/feign/EpmetUserOpenFeignClient.java | 50 ++++++ .../epmet/feign/EpmetUserSelfFeignClient.java | 18 --- .../EpmetUserOpenFeignClientFallback.java | 31 ++++ .../EpmetUserSelfFeignClientFallBack.java | 10 -- 9 files changed, 225 insertions(+), 49 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ArticleGridResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ArticleGridResultDTO.java index 8ab4f95bec..923872f31e 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ArticleGridResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ArticleGridResultDTO.java @@ -20,6 +20,7 @@ package com.epmet.dto.result; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.List; @@ -44,11 +45,11 @@ public class ArticleGridResultDTO implements Serializable { /** * 当前机关的下属网格列表 */ - private List gridList; + private List gridList = new ArrayList<>(); /** * 当前组织的所有下级组织信息(递归) */ - private List subAgencyGridList; + private List subAgencyGridList = new ArrayList<>(); /** * 上级组织机构ID */ diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index bebb36025d..3a9e12778d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -35,6 +35,7 @@ import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerGridEntity; import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.EpmetUserSelfFeignClient; import com.epmet.feign.OperCrmFeignClient; import com.epmet.redis.CustomerAgencyRedis; @@ -77,7 +78,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl page(Map params) { @@ -652,7 +653,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl> listResult = epmetUserSelfFeignClient.getCustomerStaffRoleList(formDTO); + Result> listResult = epmetUserOpenFeignClient.getCustomerStaffRoleList(formDTO); if (null == listResult.getData() || listResult.getData().size() < NumConstant.ONE) { return returnDTO; } @@ -746,7 +747,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl> listResult = epmetUserSelfFeignClient.getCustomerStaffRoleList(formDTO); + Result> listResult = epmetUserOpenFeignClient.getCustomerStaffRoleList(formDTO); if (null == listResult.getData() || listResult.getData().size() < NumConstant.ONE) { return returnDTO; } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishGridListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishGridListFormDTO.java index 4d16716083..3186b08037 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishGridListFormDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishGridListFormDTO.java @@ -22,4 +22,8 @@ public class PublishGridListFormDTO implements Serializable { */ @NotBlank(message = "文章id不能为空", groups = {PublishGridListFormDTO.AddUserInternalGroup.class}) private String articleId; + /** + * token中人员Id + */ + private String staffId; } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index bb1013913f..abf1f0965b 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -330,6 +330,7 @@ public class ArticleController { **/ @PostMapping("publishgridlist") public Result publishGridList(@LoginUser TokenDto tokenDTO, @RequestBody PublishGridListFormDTO formDTO) { + formDTO.setStaffId(tokenDTO.getUserId()); ValidatorUtils.validateEntity(formDTO, PublishGridListFormDTO.AddUserInternalGroup.class); return new Result().ok(articleService.publishGridList(formDTO)); } 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 b5e4cb2a44..845c8b38d7 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 @@ -45,8 +45,7 @@ import com.epmet.dto.feign.GovOrgSelfFeignClient; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.*; -import com.epmet.feign.EpmetUserClientFeignClient; -import com.epmet.feign.EpmetUserSelfFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.redis.ArticleRedis; import com.epmet.service.ArticleOperateRecordService; import com.epmet.service.ArticlePublishRangeService; @@ -57,6 +56,7 @@ import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.jsoup.helper.StringUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -88,7 +88,7 @@ public class ArticleServiceImpl extends BaseServiceImpl loginUserDetails = epmetUserClientFeignClient.getLoginUserDetails(detailsFormDTO); + Result loginUserDetails = epmetUserOpenFeignClient.getLoginUserDetails(detailsFormDTO); if (loginUserDetails == null || loginUserDetails.getData() == null){ log.warn("saveOrUpdateContent getloginUserDetails return null"); throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(),EpmetErrorCode.SERVER_ERROR.getMsg()); @@ -536,7 +534,7 @@ public class ArticleServiceImpl extends BaseServiceImpl resultStaff = epmetUserSelfFeignClient.getCustomerStaff(formDTO.getStaffId()); + Result resultStaff = epmetUserOpenFeignClient.getCustomerStaff(formDTO.getStaffId()); if (null == resultStaff.getData()) { throw new RenException(ArticleConstant.SELECT_STAFF_EXCEPTION); } @@ -558,12 +556,12 @@ public class ArticleServiceImpl extends BaseServiceImpl resultList; - List roles = epmetUserSelfFeignClient.getStaffRoles(tokenDto.getUserId()).getData(); + List roles = epmetUserOpenFeignClient.getStaffRoles(tokenDto.getUserId()).getData(); LoginUserDetailsFormDTO loginUserDetailsFormDTO = new LoginUserDetailsFormDTO(); loginUserDetailsFormDTO.setApp(tokenDto.getApp()); loginUserDetailsFormDTO.setClient(tokenDto.getClient()); loginUserDetailsFormDTO.setUserId(tokenDto.getUserId()); - LoginUserDetailsResultDTO userInfo = epmetUserSelfFeignClient.getLoginUserDetails(loginUserDetailsFormDTO).getData(); + LoginUserDetailsResultDTO userInfo = epmetUserOpenFeignClient.getLoginUserDetails(loginUserDetailsFormDTO).getData(); String staffLevel = ""; for (CustomerStaffRoleResultDTO role : roles) { //党建负责人 @@ -595,7 +593,7 @@ public class ArticleServiceImpl extends BaseServiceImpl resultList = baseDao.selectOfflineList(userInfo.getGridIdList()); PageInfo pageInfo = new PageInfo<>(resultList); return new PageData<>(resultList, pageInfo.getTotal()); @@ -650,19 +648,137 @@ public class ArticleServiceImpl extends BaseServiceImpl rangeEntityList = articlePublishRangeDao.selectByArticleId(rangeEntity); - if(null==rangeEntityList||rangeEntityList.size() gridIdList = rangeEntityList.stream().map(ArticlePublishRangeEntity::getGridId).collect(Collectors.toList()); - formDTO.setGridIdList(gridIdList);*/ - - return null; + //2:查询当前工作人员的所属组织,以此作为根节点的起始位置 + LoginUserDetailsFormDTO loginUserDetailsFormDTO = new LoginUserDetailsFormDTO(); + loginUserDetailsFormDTO.setApp("gov"); + loginUserDetailsFormDTO.setClient("wxmp"); + loginUserDetailsFormDTO.setUserId(formDTO.getStaffId()); + Result resultDTOResult = epmetUserOpenFeignClient.getLoginUserDetails(loginUserDetailsFormDTO); + String agencyId = resultDTOResult.getData().getOrgIdPath(); + //存放树的每一个节点对象,用于将同一节点下的网格列表合并(主键:agencyId 值:节点对象) + Map map = new HashMap<>(); + //3:循环可下线网格列表,根据pids组织每一个树节点对象信息 + for (ArticlePublishRangeEntity range : rangeEntityList) { + //当前网格的所有机关id + String gridPids = range.getPids() + ":" + range.getAgencyId(); + //当前网格的所有机关名称 + String gridAgencyNames = range.getAllParentName() + "-" + range.getAgencyGridName().substring(NumConstant.ZERO, range.getAgencyGridName().lastIndexOf("-")); + String[] pids = gridPids.split(":"); + String[] names = gridAgencyNames.split("-"); + //倒序遍历 + for (int i = (pids.length - NumConstant.ONE); i >= NumConstant.ZERO; i--) { + //遍历到当前人员所属组织的上一级组织时停止遍历 + if (i + NumConstant.ONE < pids.length && agencyId.equals(pids[i + NumConstant.ONE])) { + break; + } + if (null == map.get(pids[i])) { + ArticleGridResultDTO dto = new ArticleGridResultDTO(); + dto.setAgencyId(pids[i]); + dto.setAgencyName(names[i]); + //根节点没有上级id的值 + if (i > NumConstant.ZERO) { + dto.setPid(pids[i - NumConstant.ONE]); + } + if (pids.length - NumConstant.ONE == i) { + List gridList = new ArrayList<>(); + AgencyGridListResultDTO gridDto = new AgencyGridListResultDTO(); + gridDto.setGridId(range.getGridId()); + gridDto.setGridName(range.getAgencyGridName().substring(range.getAgencyGridName().lastIndexOf("-") + NumConstant.ONE)); + gridList.add(gridDto); + dto.setGridList(gridList); + } + map.put(pids[i], dto); + } else { + if (pids.length - NumConstant.ONE == i) { + ArticleGridResultDTO dto1 = map.get(pids[i]); + List gridList = dto1.getGridList(); + AgencyGridListResultDTO gridDto = new AgencyGridListResultDTO(); + gridDto.setGridId(range.getGridId()); + gridDto.setGridName(range.getAgencyGridName().substring(range.getAgencyGridName().lastIndexOf("-") + NumConstant.ONE)); + gridList.add(gridDto); + dto1.setGridList(gridList); + map.put(pids[i], dto1); + } + } + } + } + //去除map中所有的节点对象,将list转成tree结构 + List resultDTOList = map.values().stream().collect(Collectors.toList()); + List list = agencyGridListToTree(resultDTOList); + return list.get(NumConstant.ZERO); } + /** + * @Author sun + * @Description 可下线网格列表-将list转为Tree结构 + */ + private List agencyGridListToTree(List resultDTOList) { + //根节点集合(pid为空) + List listParentRecord = new ArrayList<>(); + //非根节点集合(pid不为空) + List listNotParentRecord = new ArrayList<>(); + //1:遍历resultDTOList 保存所有数据的agencyId 用于判断是不是根节点 + //agencyId + Map agencyIdMap = new HashMap<>(); + //每一个agencyId对应的节点对象信息 + Map allRecordMap = new HashMap(); + for (ArticleGridResultDTO dto : resultDTOList) { + agencyIdMap.put(dto.getAgencyId(), dto.getAgencyId()); + allRecordMap.put(dto.getAgencyId(), dto); + } + //2:遍历resultDTOList 找出所有的根节点和非根节点(pid是否为空) + if (resultDTOList != null && resultDTOList.size() > NumConstant.ZERO) { + for (ArticleGridResultDTO record : resultDTOList) { + //为空且存在 + if (StringUtil.isBlank(record.getPid()) || !agencyIdMap.containsKey(record.getPid())) { + listParentRecord.add(record); + } else { + listNotParentRecord.add(record); + } + } + } + //3:遍历根节点,递归获取所有子节点并添加到对应下级 + for (ArticleGridResultDTO dto : listParentRecord) { + //添加所有子级 + List subList = getSubTreeNodeList(listNotParentRecord, dto.getAgencyId()); + dto.setSubAgencyGridList(subList); + } + return listParentRecord; + } + /** + * @Author sun + * @Description 可下线网格列表-将list转为Tree结构-递归查询每一个根节点的下级节点集合 + */ + private List getSubTreeNodeList(List listNotParentRecord, String agencyId) { + List subParentRecordList = new ArrayList<>(); + List subNotParentRecordList = new ArrayList<>(); + //1:遍历tmpList,找出所有的根节点和非根节点 + if (listNotParentRecord != null && listNotParentRecord.size() > NumConstant.ZERO) { + for (ArticleGridResultDTO record : listNotParentRecord) { + // 对比找出父节点 + if (record.getPid().equals(agencyId)) { + subParentRecordList.add(record); + } else { + subNotParentRecordList.add(record); + } + } + } + //2:层层递归添加下级查询子节点 + for (ArticleGridResultDTO record : subParentRecordList) { + //添加子节点 + List subList = getSubTreeNodeList(subNotParentRecordList, record.getAgencyId()); + record.setSubAgencyGridList(subList); + } + return subParentRecordList; + } + /** * @Description 根绝文章Id查询出文章的内容、封面等相关信息,如果居民端传入的网格Id不在该文章的发布范围内,则返回NULL * @param articleDetailFormDTO diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 8c0f822655..93c756c76a 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -1,9 +1,21 @@ package com.epmet.feign; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.form.CustomerStaffRoleListFormDTO; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.CustomerStaffRoleListResultDTO; +import com.epmet.dto.result.CustomerStaffRoleResultDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; import org.springframework.cloud.openfeign.FeignClient; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.feign.fallback.EpmetUserOpenFeignClientFallback; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -13,4 +25,42 @@ import com.epmet.feign.fallback.EpmetUserOpenFeignClientFallback; */ @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class) public interface EpmetUserOpenFeignClient { + + /** + * 从缓存中查询已登录用户的基本信息以及角色等相关信息 + * + * @return + */ + @PostMapping("/epmetuser/user/loginuserdetails") + Result getLoginUserDetails(@RequestBody LoginUserDetailsFormDTO dto); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 根据客户Id和staffId查询一个员工在指定客户下的角色列表 + **/ + @PostMapping("/epmetuser/staffrole/getcustomerstaffrolelist") + Result> getCustomerStaffRoleList(@RequestBody CustomerStaffRoleListFormDTO formDTO); + + /** + * 根据staffId查询人员拥有的所有角色信息 + * + * @param staffId + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2020/6/2 16:11 + */ + @PostMapping("/epmetuser/staffrole/staffroles/{staffId}") + Result> getStaffRoles(@PathVariable String staffId); + + /** + * @param staffId + * @return + * @Author sun + * @Description 根据staffId查询工作人员基本信息 + **/ + @PostMapping("/epmetuser/customerstaff/getcustomerstaff/{staffId}") + Result getCustomerStaff(@PathVariable("staffId") String staffId); + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserSelfFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserSelfFeignClient.java index ddbf87f49c..8d1d933de2 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserSelfFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserSelfFeignClient.java @@ -25,24 +25,6 @@ import java.util.List; @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserSelfFeignClientFallBack.class) public interface EpmetUserSelfFeignClient { - /** - * @param formDTO - * @return - * @Author sun - * @Description 根据客户Id和staffId查询一个员工在指定客户下的角色列表 - **/ - @PostMapping("/epmetuser/staffrole/getcustomerstaffrolelist") - Result> getCustomerStaffRoleList(@RequestBody CustomerStaffRoleListFormDTO formDTO); - - /** - * @param staffId - * @return - * @Author sun - * @Description 根据staffId查询工作人员基本信息 - **/ - @PostMapping("/epmetuser/customerstaff/getcustomerstaff/{staffId}") - Result getCustomerStaff(@PathVariable("staffId") String staffId); - /** * 从缓存中查询已登录用户的基本信息以及角色等相关信息 * diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 817c48f7e6..58b4543d2d 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -1,8 +1,19 @@ package com.epmet.feign.fallback; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.form.CustomerStaffRoleListFormDTO; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.CustomerStaffRoleListResultDTO; +import com.epmet.dto.result.CustomerStaffRoleResultDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import org.springframework.stereotype.Component; +import java.util.List; + /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 * @@ -11,4 +22,24 @@ import org.springframework.stereotype.Component; */ @Component public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClient { + + @Override + public Result getLoginUserDetails(LoginUserDetailsFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getLoginUserDetails", dto); + } + + @Override + public Result> getCustomerStaffRoleList(CustomerStaffRoleListFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffRoleList", formDTO); + } + + @Override + public Result> getStaffRoles(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffRoles", staffId); + } + + @Override + public Result getCustomerStaff(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaff", staffId); + } } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserSelfFeignClientFallBack.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserSelfFeignClientFallBack.java index ec30a52fc5..5b6c8abb57 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserSelfFeignClientFallBack.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserSelfFeignClientFallBack.java @@ -23,16 +23,6 @@ import java.util.List; @Component public class EpmetUserSelfFeignClientFallBack implements EpmetUserSelfFeignClient { - @Override - public Result> getCustomerStaffRoleList(CustomerStaffRoleListFormDTO formDTO) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffRoleList", formDTO); - } - - @Override - public Result getCustomerStaff(String staffId) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaff", staffId); - } - @Override public Result getLoginUserDetails(LoginUserDetailsFormDTO dto) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getLoginUserDetails", dto);