Commit 4f434b07 authored by 麻笑宇's avatar 麻笑宇

纵览大屏地图和八大类修改已纳管查询条件为已赋码和已认领

代码修改
parent 016ed367
...@@ -211,12 +211,12 @@ public class StCommonServiceImpl { ...@@ -211,12 +211,12 @@ public class StCommonServiceImpl {
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*")); boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*"));
// 设备类别精确查询气瓶 // 设备类别精确查询气瓶
boolMust.must(QueryBuilders.termQuery("EQU_CATEGORY_CODE", EQU_CATEGORY_CYLINDER)); boolMust.must(QueryBuilders.termQuery("EQU_CATEGORY_CODE", EQU_CATEGORY_CYLINDER));
// 只统计已纳管设备 //已赋码
boolMust.must(QueryBuilders.termQuery("IS_INTO_MANAGEMENT", Boolean.TRUE));
// 只统计有监管码的、状态不是草稿且不是已拒领的
boolMust.must(QueryBuilders.existsQuery("SUPERVISORY_CODE")); boolMust.must(QueryBuilders.existsQuery("SUPERVISORY_CODE"));
boolMust.mustNot(QueryBuilders.termQuery("STATUS","草稿")); boolMust.mustNot(QueryBuilders.termQuery("SUPERVISORY_CODE","null"));
boolMust.mustNot(QueryBuilders.termQuery("STATUS","已拒领")); //状态为已认领
String[] status = {"草稿","已拒领","待认领"};
boolMust.mustNot(QueryBuilders.termsQuery("STATUS",Arrays.asList(status)));
request.query(boolMust); request.query(boolMust);
try { try {
CountResponse response = restHighLevelClient.count(request, RequestOptions.DEFAULT); CountResponse response = restHighLevelClient.count(request, RequestOptions.DEFAULT);
...@@ -234,12 +234,12 @@ public class StCommonServiceImpl { ...@@ -234,12 +234,12 @@ public class StCommonServiceImpl {
BoolQueryBuilder boolMust = QueryBuilders.boolQuery(); BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
// 按照管辖机构区域信息模糊查询 // 按照管辖机构区域信息模糊查询
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*")); boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*"));
// 只统计已纳管设备 //已赋码
boolMust.must(QueryBuilders.termQuery("IS_INTO_MANAGEMENT", Boolean.TRUE));
// 只统计有监管码的、状态不是草稿且不是已拒领的
boolMust.must(QueryBuilders.existsQuery("SUPERVISORY_CODE")); boolMust.must(QueryBuilders.existsQuery("SUPERVISORY_CODE"));
boolMust.mustNot(QueryBuilders.termQuery("STATUS","草稿")); boolMust.mustNot(QueryBuilders.termQuery("SUPERVISORY_CODE","null"));
boolMust.mustNot(QueryBuilders.termQuery("STATUS","已拒领")); //状态为已认领
String[] status = {"草稿","已拒领","待认领"};
boolMust.mustNot(QueryBuilders.termsQuery("STATUS",Arrays.asList(status)));
// 且8大类,目的去掉脏数据 // 且8大类,目的去掉脏数据
boolMust.must(QueryBuilders.termsQuery("EQU_LIST_CODE",StCommonServiceImpl.getEquipmentCategory().stream().map(EquipmentCategoryDto::getCode).collect(Collectors.toList()))); boolMust.must(QueryBuilders.termsQuery("EQU_LIST_CODE",StCommonServiceImpl.getEquipmentCategory().stream().map(EquipmentCategoryDto::getCode).collect(Collectors.toList())));
SearchSourceBuilder builder = new SearchSourceBuilder(); SearchSourceBuilder builder = new SearchSourceBuilder();
......
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