From ad202471862a8e529ebfbc8a6e5e8cc46055aeae Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Mon, 8 Jun 2020 10:32:23 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/constant/TagConstant.java | 2 ++ .../com/epmet/service/impl/ArticleServiceImpl.java | 14 +++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) 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 978a9ab394..494ec2c154 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 @@ -44,6 +44,8 @@ public interface TagConstant { String SUCCESS_UPDATE = "更新标签缓存成功... ..."; String FAILURE_UPDATE = "更新标签缓存失败... ..."; + String SELECT_GRIDIDLIST_FAILURE = "查询gridId集合数量为0"; + } 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 36f47c9fc0..5a2b58c338 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 @@ -890,7 +890,7 @@ public class ArticleServiceImpl extends BaseServiceImpl tagsList = Arrays.asList(tags.split("\\|")); List tagsInfo = new ArrayList<>(); - //政府端的 标签使用次数 DB和redis更新(zSet) + //政府端的 标签使用次数 DB for (String tag : tagsList) { UpdateTagUseCountsResultDTO updateTagUseCount = tagCustomerService.checkTagInfo(tag, customerId, userId); tagsInfo.add(updateTagUseCount); @@ -915,7 +915,7 @@ public class ArticleServiceImpl extends BaseServiceImpl tagsInfo = formDto.getTagsInfo(); String userId = tokenDto.getUserId(); + //根据草稿id查询发布范围id集合 List gridIds = articlePublishRangeDao.selectGridIdByDraftId(draftId); + if (gridIds.size() == NumConstant.ZERO){ + throw new RenException(TagConstant.SELECT_GRIDIDLIST_FAILURE); + } List gridTags = new ArrayList<>(); List gridTagCache = new ArrayList<>(); for (String gridId : gridIds) { @@ -976,7 +980,7 @@ public class ArticleServiceImpl extends BaseServiceImpl Date: Mon, 8 Jun 2020 10:59:55 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=9C=A8=E6=9C=AC=E7=BD=91=E6=A0=BC=E4=B8=8B?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E8=BF=87=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/service/impl/TagServiceImpl.java | 2 +- .../src/main/resources/mapper/ArticleDao.xml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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 340516bfb6..1a625c42d1 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 @@ -43,7 +43,7 @@ public class TagServiceImpl implements TagService { */ @Override public List resiTagList(ResiTagListFormDTO formDto) { - //校验 在本网格是否发布过文章 + //校验 客户在本网格是否发布过文章 Integer articleCounts = articleDao.checkPublishArticle(formDto); if (articleCounts== NumConstant.ZERO){ return new ArrayList<>(); 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 d1066b44f6..d3be4c7e2f 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,16 +34,17 @@ ORDER BY ac.ORDER_NUM ASC + +