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
d2b16664
Commit
d2b16664
authored
Jun 23, 2021
by
郭武斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*)修改相似警情过滤参数
parent
a98a89be
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
120 additions
and
7 deletions
+120
-7
ESAlertCalledRequestDto.java
...amos/boot/module/jcs/api/dto/ESAlertCalledRequestDto.java
+13
-0
ESAlertCalled.java
...eejoin/amos/boot/module/jcs/api/entity/ESAlertCalled.java
+6
-1
AlertStatusEnum.java
...ejoin/amos/boot/module/jcs/api/enums/AlertStatusEnum.java
+53
-0
AlertCalledController.java
...boot/module/jcs/biz/controller/AlertCalledController.java
+18
-2
ESAlertCalledService.java
...oot/module/jcs/biz/service/impl/ESAlertCalledService.java
+30
-4
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/dto/ESAlertCalledRequestDto.java
0 → 100644
View file @
d2b16664
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
dto
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledVo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
ESAlertCalledRequestDto
extends
AlertCalledVo
{
@ApiModelProperty
(
value
=
"警情状态"
)
private
String
[]
alertStatus
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/entity/ESAlertCalled.java
View file @
d2b16664
...
...
@@ -31,9 +31,14 @@ public class ESAlertCalled {
/**
* 警情状态
*/
@Field
(
type
=
FieldType
.
Text
)
@Field
(
type
=
FieldType
.
Boolean
,
index
=
false
)
private
Boolean
alertStatus
;
/**
* 警情状态
*/
@Field
(
type
=
FieldType
.
Text
)
private
String
alertStatusStr
;
/**
* 响应级别字典code 为了过滤用(只有航空器故障有)
*/
@Field
(
type
=
FieldType
.
Text
,
index
=
false
)
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/enums/AlertStatusEnum.java
0 → 100644
View file @
d2b16664
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
/**
*
* <pre>
* 警情状态枚举
* </pre>
*
* @author gwb
* @version $Id: AlertStatusEnum.java, v 0.1 2021年6月23日 下午5:11:18 gwb Exp $
*/
@Getter
@AllArgsConstructor
public
enum
AlertStatusEnum
{
UNCLOSED
(
"unclosed"
,
"未结案"
),
CLOSED
(
"closed"
,
"已结案"
);
private
String
code
;
private
String
name
;
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
static
AlertStatusEnum
getEnum
(
String
code
)
{
for
(
AlertStatusEnum
status
:
AlertStatusEnum
.
values
())
{
if
(
status
.
getCode
().
equals
(
code
))
{
return
status
;
}
}
return
null
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/AlertCalledController.java
View file @
d2b16664
...
...
@@ -35,6 +35,7 @@ import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledRequestDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledFormVo
;
...
...
@@ -203,17 +204,32 @@ public class AlertCalledController extends BaseController {
* @return
* @throws Exception
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"相似警情分页查询"
)
@RequestMapping
(
value
=
"/page/similar"
,
method
=
RequestMethod
.
POST
)
public
ResponseModel
<
Page
<
ESAlertCalledDto
>>
pageBySimilar
(
@RequestBody
AlertCalledV
o
alertCalledVo
,
@RequestBody
ESAlertCalledRequestDt
o
alertCalledVo
,
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
eSAlertCalledService
.
queryByKeys
(
alertCalledVo
,
current
,
size
));
}
/**
*
* <pre>
* 初始化ES
* </pre>
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"初始化ES"
)
@RequestMapping
(
value
=
"/es/init"
,
method
=
RequestMethod
.
PUT
)
public
ResponseModel
<
Boolean
>
initEs
()
{
return
ResponseHelper
.
buildResponse
(
eSAlertCalledService
.
initEs
());
}
/**
* 列表无分页查询
*
* @return
...
...
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 @
d2b16664
...
...
@@ -22,9 +22,10 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledRequestDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.ESAlertCalled
;
import
com.yeejoin.amos.boot.module.jcs.api.
vo.AlertCalledVo
;
import
com.yeejoin.amos.boot.module.jcs.api.
enums.AlertStatusEnum
;
import
com.yeejoin.amos.boot.module.jcs.biz.dao.ESAlertCalledRepository
;
/**
...
...
@@ -46,7 +47,8 @@ public class ESAlertCalledService {
private
ESAlertCalledRepository
esAlertCalledRepository
;
@Autowired
private
AlertCalledServiceImpl
iAlertCalledService
;
private
AlertCalledServiceImpl
alertCalledService
;
@PostConstruct
...
...
@@ -100,10 +102,16 @@ public class ESAlertCalledService {
* @return
*/
@SuppressWarnings
({
"rawtypes"
})
public
Page
<
ESAlertCalledDto
>
queryByKeys
(
AlertCalledV
o
alertCalledVo
,
int
current
,
int
size
)
public
Page
<
ESAlertCalledDto
>
queryByKeys
(
ESAlertCalledRequestDt
o
alertCalledVo
,
int
current
,
int
size
)
{
Page
<
ESAlertCalledDto
>
result
=
new
Page
<
ESAlertCalledDto
>(
current
,
size
);
String
[]
alertStatus
=
alertCalledVo
.
getAlertStatus
();
if
(
ValidationUtil
.
isEmpty
(
alertStatus
))
{
return
result
;
}
AlertCalled
alertCalled
=
alertCalledVo
.
getAlertCalled
();
if
(
ValidationUtil
.
isEmpty
(
alertCalled
))
{
...
...
@@ -113,6 +121,17 @@ public class ESAlertCalledService {
* 通用匹配规则,条件构建
*/
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
//警情状态
BoolQueryBuilder
qb0
=
QueryBuilders
.
boolQuery
();
for
(
String
status
:
alertStatus
)
{
AlertStatusEnum
alertStatusEnum
=
AlertStatusEnum
.
getEnum
(
status
);
if
(!
ValidationUtil
.
isEmpty
(
alertStatusEnum
))
{
qb0
.
should
(
QueryBuilders
.
termQuery
(
"alertStatusStr.keyword"
,
alertStatusEnum
.
getName
()));
}
}
boolMust
.
must
(
qb0
);
//接警时间,距离当前时间不超过半小时的
long
currentTime
=
System
.
currentTimeMillis
()
;
currentTime
=
currentTime
-
30
*
60
*
1000
;
...
...
@@ -243,6 +262,13 @@ public class ESAlertCalledService {
esAlertCalled
.
setAddress
(
alertCalled
.
getAddress
());
esAlertCalled
.
setAlertStage
(
alertCalled
.
getAlertStage
());
esAlertCalled
.
setAlertStatus
(
alertCalled
.
getAlertStatus
());
if
(
alertCalled
.
getAlertStatus
())
{
esAlertCalled
.
setAlertStatusStr
(
AlertStatusEnum
.
CLOSED
.
getCode
());
}
else
{
esAlertCalled
.
setAlertStatusStr
(
AlertStatusEnum
.
UNCLOSED
.
getCode
());
}
esAlertCalled
.
setResponseLevelCode
(
alertCalled
.
getResponseLevelCode
());
esAlertCalled
.
setUnitInvolved
(
alertCalled
.
getUnitInvolved
());
esAlertCalled
.
setCoordinateX
(
alertCalled
.
getCoordinateX
());
...
...
@@ -376,7 +402,7 @@ public class ESAlertCalledService {
wrapper
.
ge
(
"call_time"
,
date
);
List
<
AlertCalled
>
alertCalleds
=
iA
lertCalledService
.
list
(
wrapper
);
List
<
AlertCalled
>
alertCalleds
=
a
lertCalledService
.
list
(
wrapper
);
if
(!
ValidationUtil
.
isEmpty
(
alertCalleds
))
{
saveAlertCalledToES
(
alertCalleds
);
...
...
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