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

智库分页列表bug修改

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