Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
4de910dd
Commit
4de910dd
authored
Sep 03, 2021
by
郭武斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*)修改相似警情搜索
parent
bb2ab374
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
ESAlertCalledService.java
...oot/module/jcs/biz/service/impl/ESAlertCalledService.java
+7
-4
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/ESAlertCalledService.java
View file @
4de910dd
...
@@ -208,7 +208,7 @@ public class ESAlertCalledService {
...
@@ -208,7 +208,7 @@ public class ESAlertCalledService {
/**
/**
* 通用匹配规则,条件构建
* 通用匹配规则,条件构建
*/
*/
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
boolMust
All
=
QueryBuilders
.
boolQuery
();
//警情状态
//警情状态
BoolQueryBuilder
qb0
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
qb0
=
QueryBuilders
.
boolQuery
();
for
(
String
status
:
alertStatus
)
for
(
String
status
:
alertStatus
)
...
@@ -219,7 +219,9 @@ public class ESAlertCalledService {
...
@@ -219,7 +219,9 @@ public class ESAlertCalledService {
qb0
.
should
(
QueryBuilders
.
termQuery
(
"alertStatusStr.keyword"
,
alertStatusEnum
.
getCode
()));
qb0
.
should
(
QueryBuilders
.
termQuery
(
"alertStatusStr.keyword"
,
alertStatusEnum
.
getCode
()));
}
}
}
}
boolMust
.
must
(
qb0
);
boolMustAll
.
must
(
qb0
);
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
//接警时间,距离当前时间不超过半小时的
//接警时间,距离当前时间不超过半小时的
long
currentTime
=
System
.
currentTimeMillis
()
;
long
currentTime
=
System
.
currentTimeMillis
()
;
currentTime
=
currentTime
-
30
*
60
*
1000
;
currentTime
=
currentTime
-
30
*
60
*
1000
;
...
@@ -258,7 +260,8 @@ public class ESAlertCalledService {
...
@@ -258,7 +260,8 @@ public class ESAlertCalledService {
*/
*/
boolMust
.
minimumShouldMatch
(
1
);
//至少满足一个
boolMustAll
.
must
(
boolMust
);
// 创建查询构造器
// 创建查询构造器
NativeSearchQueryBuilder
queryBuilder
=
new
NativeSearchQueryBuilder
()
NativeSearchQueryBuilder
queryBuilder
=
new
NativeSearchQueryBuilder
()
// 分页
// 分页
...
@@ -266,7 +269,7 @@ public class ESAlertCalledService {
...
@@ -266,7 +269,7 @@ public class ESAlertCalledService {
// 排序
// 排序
// .withSort(SortBuilders.fieldSort("callTimeLong").order(SortOrder.DESC))
// .withSort(SortBuilders.fieldSort("callTimeLong").order(SortOrder.DESC))
//过滤条件
//过滤条件
.
withQuery
(
boolMust
);
.
withQuery
(
boolMust
All
);
List
<
ESAlertCalledDto
>
list
=
new
LinkedList
<>();
List
<
ESAlertCalledDto
>
list
=
new
LinkedList
<>();
long
totle
=
0
;
long
totle
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment