Commit ee57942e authored by 刘林's avatar 刘林

fix:(大屏):设备数据分析接口修改

parent 7ec9d511
...@@ -4640,7 +4640,11 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -4640,7 +4640,11 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
// 获取索引 // 获取索引
String index = "idx_biz_view_jg_all"; String index = "idx_biz_view_jg_all";
// 1. 查询数据库中所有设备 record // 1. 查询数据库中所有设备 record
List<String> dbRecords = idxBizJgUseInfoMapper.selectEquipsClaimStatus(); //List<String> dbRecords = idxBizJgUseInfoMapper.selectEquipsClaimStatus();
LambdaQueryWrapper<IdxBizJgUseInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.select(IdxBizJgUseInfo::getRecord);
List<IdxBizJgUseInfo> list = idxBizJgUseInfoMapper.selectList(lambdaQueryWrapper);
List<String> dbRecords = list.stream().map(IdxBizJgUseInfo::getRecord).collect(Collectors.toList());
log.info("数据库设备记录数: {}", dbRecords.size()); log.info("数据库设备记录数: {}", dbRecords.size());
// 2. 从ES中查询对应记录 // 2. 从ES中查询对应记录
List<String> esRecords = getEsDataV2(index); List<String> esRecords = getEsDataV2(index);
...@@ -4660,8 +4664,10 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -4660,8 +4664,10 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
private List<String> getEsDataV2(String index) { private List<String> getEsDataV2(String index) {
// 使用 match_all 查询,拉取所有文档(通过 scroll 分批) // 使用 match_all 查询,拉取所有文档(通过 scroll 分批)
log.info("ES 全量查询开始, index={}, 时间={}", index, System.currentTimeMillis()); log.info("ES 全量查询开始, index={}, 时间={}", index, System.currentTimeMillis());
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery() //BoolQueryBuilder boolQuery = QueryBuilders.boolQuery()
.must(QueryBuilders.termsQuery("STATUS", Collections.singletonList("已认领"))); // .must(QueryBuilders.termsQuery("STATUS", Collections.singletonList("已认领")));
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
boolQuery.must(QueryBuilders.matchAllQuery());
// 线程安全的结果容器 // 线程安全的结果容器
List<String> esIds = Collections.synchronizedList(new ArrayList<>()); List<String> esIds = Collections.synchronizedList(new ArrayList<>());
......
...@@ -239,6 +239,5 @@ ...@@ -239,6 +239,5 @@
SELECT ibjui."RECORD" SELECT ibjui."RECORD"
FROM idx_biz_jg_use_info ibjui FROM idx_biz_jg_use_info ibjui
JOIN idx_biz_jg_other_info joi ON ibjui."RECORD" = joi."RECORD" JOIN idx_biz_jg_other_info joi ON ibjui."RECORD" = joi."RECORD"
WHERE joi.claim_status = '已认领'
</select> </select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment