Browse Source

标签列表

master
zhaoqifeng 5 years ago
parent
commit
b96444ed21
  1. 10
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectTagDictServiceImpl.java

10
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<IssueProject
@Override
public TagListResultDTO getTagList(TokenDto tokenDto, TagListFormDTO formDTO) {
TagListResultDTO result = new TagListResultDTO();
Map<String,List<IssueCategoryTagResultDTO>> map = issueProjectTagDictRedis.getTagsOrderByRank(tokenDto.getCustomerId(),
Map<String,List<IssueCategoryTagResultDTO>> 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<IssueCategoryTagResultDTO> 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;
}

Loading…
Cancel
Save