提交 9918e8dc 作者: 925993793@qq.com

智库分页列表bug修改

上级 e0c3d38e
...@@ -294,24 +294,26 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -294,24 +294,26 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
//智库绑定信息源栏目采集资讯的数量 //智库绑定信息源栏目采集资讯的数量
Map<String, Integer> groupCount = new HashMap<>(); Map<String, Integer> groupCount = new HashMap<>();
//查询es //查询es
BoolQueryBuilder boolQuerylist = QueryBuilders.boolQuery(); if (!sidList.isEmpty()) {
boolQuerylist.must(QueryBuilders.termsQuery("sid", sidList)); BoolQueryBuilder boolQuerylist = QueryBuilders.boolQuery();
try { boolQuerylist.must(QueryBuilders.termsQuery("sid", sidList));
Map<String, Long> mapGroup = esUtil.groupBy("basedata", "sid", boolQuerylist, sidList.size()); try {
for (Map.Entry<String, List<BindSourceDetailVO>> entry : collect.entrySet()) { Map<String, Long> mapGroup = esUtil.groupBy("basedata", "sid", boolQuerylist, sidList.size());
String thinkTankId = entry.getKey(); for (Map.Entry<String, List<BindSourceDetailVO>> entry : collect.entrySet()) {
List<String> bindSidList = entry.getValue().stream().map(BindSourceDetailVO::getSourceId).collect(Collectors.toList()); String thinkTankId = entry.getKey();
long count = 0; List<String> bindSidList = entry.getValue().stream().map(BindSourceDetailVO::getSourceId).collect(Collectors.toList());
for (Map.Entry<String, Long> longEntry : mapGroup.entrySet()) { long count = 0;
if (bindSidList.contains(longEntry.getKey())) { for (Map.Entry<String, Long> longEntry : mapGroup.entrySet()) {
count += longEntry.getValue(); if (bindSidList.contains(longEntry.getKey())) {
count += longEntry.getValue();
}
} }
groupCount.put(thinkTankId, Math.toIntExact(count));
} }
groupCount.put(thinkTankId, Math.toIntExact(count)); } catch (IOException e) {
log.error("ES查询失败");
e.printStackTrace();
} }
} catch (IOException e) {
log.error("ES查询失败");
e.printStackTrace();
} }
for (ThinktankBasicInfoVo thinktankBasicInfoVo : list) { for (ThinktankBasicInfoVo thinktankBasicInfoVo : list) {
String id = thinktankBasicInfoVo.getId(); String id = thinktankBasicInfoVo.getId();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论