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
37d65431
Commit
37d65431
authored
Jun 29, 2021
by
郭武斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*)修改相似警情同步时间
parent
3a2e7baa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
application.properties
...boot-jcs-system/src/main/resources/application.properties
+2
-0
ESAlertCalledService.java
...oot/module/jcs/biz/service/impl/ESAlertCalledService.java
+13
-4
No files found.
amos-boot-jcs-system/src/main/resources/application.properties
View file @
37d65431
...
...
@@ -10,6 +10,8 @@ logging.config=classpath:logback-${spring.profiles.active}.xml
mybatis-plus.configuration.log-impl
=
org.apache.ibatis.logging.stdout.StdOutImpl
#redis����ʧЧʱ�䵥λ��
redis.cache.failure.time
=
10800
#unit(h)
alertcall.es.synchrony.time
=
48
spring.datasource.type
=
com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.minimum-idle
=
10
...
...
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 @
37d65431
...
...
@@ -9,6 +9,7 @@ import javax.annotation.PostConstruct;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate
;
import
org.springframework.data.elasticsearch.core.SearchHit
;
...
...
@@ -48,8 +49,10 @@ public class ESAlertCalledService {
@Autowired
private
AlertCalledServiceImpl
alertCalledService
;
@Value
(
"${alertcall.es.synchrony.time}"
)
private
Long
time
;
@PostConstruct
public
void
init
()
throws
Exception
{
...
...
@@ -68,7 +71,13 @@ public class ESAlertCalledService {
QueryWrapper
<
AlertCalled
>
wrapper
=
new
QueryWrapper
<>();
long
currentTime
=
System
.
currentTimeMillis
()
;
currentTime
=
currentTime
-
480
*
60
*
60
*
1000
;
if
(
ValidationUtil
.
isEmpty
(
time
))
//默认为同步48小时
{
currentTime
=
currentTime
-
48
*
60
*
60
*
1000
;
}
else
{
currentTime
=
currentTime
-
time
*
60
*
60
*
1000
;
}
Date
date
=
new
Date
(
currentTime
);
wrapper
.
ge
(
"call_time"
,
date
);
...
...
@@ -256,7 +265,7 @@ public class ESAlertCalledService {
// 分页
.
withPageable
(
PageRequest
.
of
(
current
,
size
))
// 排序
// .withSort(SortBuilders.fieldSort("callTime").order(SortOrder.DESC))
// .withSort(SortBuilders.fieldSort("callTime
Long
").order(SortOrder.DESC))
//过滤条件
.
withQuery
(
boolMust
);
...
...
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