From b96444ed21f3ae050e021d716f988f483380966f Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 11 Dec 2020 11:10:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/IssueProjectTagDictServiceImpl.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectTagDictServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectTagDictServiceImpl.java index f2acf15e3c..12c8cb4764 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectTagDictServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectTagDictServiceImpl.java @@ -34,6 +34,7 @@ import com.epmet.entity.IssueProjectTagDictEntity; import com.epmet.redis.IssueProjectTagDictRedis; import com.epmet.service.IssueProjectTagDictService; import com.epmet.utils.ModuleConstants; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -118,10 +119,15 @@ public class IssueProjectTagDictServiceImpl extends BaseServiceImpl> map = issueProjectTagDictRedis.getTagsOrderByRank(tokenDto.getCustomerId(), + Map> map = issueProjectTagDictRedis.getDefaultTagsSortedByCategoryAndCustomizedTagsOrderByRank(tokenDto.getCustomerId(), formDTO.getCategoryIdList()); result.setDefaulted(map.get(ModuleConstants.DEFAULT_TAG_CATEGORY_NAME)); - result.setCustomized(map.get(ModuleConstants.CUSTOMIZED_TAG_CATEGORY_NAME).stream().limit(NumConstant.TEN).collect(Collectors.toList())); + List list = map.get(ModuleConstants.CUSTOMIZED_TAG_CATEGORY_NAME); + if (CollectionUtils.isNotEmpty(list)) { + result.setCustomized(list.stream().limit(NumConstant.TEN).collect(Collectors.toList())); + } else { + result.setCustomized(Collections.emptyList()); + } return result; }