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
70ed9d94
Commit
70ed9d94
authored
Dec 14, 2021
by
李腾威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
警情报送事发单位保存进ES 查询时加去重
parent
cb98676c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
15 deletions
+23
-15
OrgUsrController.java
...s/boot/module/common/biz/controller/OrgUsrController.java
+2
-13
ESOrgUsrService.java
.../boot/module/common/biz/service/impl/ESOrgUsrService.java
+4
-2
AlertCalledServiceImpl.java
...t/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
+17
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/OrgUsrController.java
View file @
70ed9d94
...
...
@@ -50,6 +50,7 @@ import javax.servlet.http.HttpServletRequest;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
...
...
@@ -350,18 +351,6 @@ public class OrgUsrController extends BaseController {
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
selectCompanyUsers
(
orgUnitId
));
}
/**
* 根据名称模糊匹配
*
* @param name
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/getList"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据名称模糊匹配"
,
notes
=
"根据名称模糊匹配"
)
public
ResponseModel
<
List
<
ESOrgUsrDto
>>
selectById
(
HttpServletRequest
request
,
String
name
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
eSOrgUsrService
.
queryByKeys
(
name
));
}
/**
* 根据名称模糊匹配
...
...
@@ -372,7 +361,7 @@ public class OrgUsrController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/getdataList/unit"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据名称模糊匹配单位"
,
notes
=
"根据名称模糊匹配单位"
)
public
ResponseModel
<
Lis
t
<
ESOrgUsrDto
>>
selectByIddata
(
HttpServletRequest
request
,
String
name
)
throws
Exception
{
public
ResponseModel
<
Se
t
<
ESOrgUsrDto
>>
selectByIddata
(
HttpServletRequest
request
,
String
name
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
eSOrgUsrService
.
queryByKeys
(
name
));
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/ESOrgUsrService.java
View file @
70ed9d94
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
java.util.LinkedHashSet
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Set
;
import
javax.annotation.PostConstruct
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
...
...
@@ -125,7 +127,7 @@ public class ESOrgUsrService {
*
*/
@SuppressWarnings
({
"rawtypes"
})
public
Lis
t
<
ESOrgUsrDto
>
queryByKeys
(
String
name
)
public
Se
t
<
ESOrgUsrDto
>
queryByKeys
(
String
name
)
{
//创建builder
FuzzyQueryBuilder
queryBuilder
=
null
;
...
...
@@ -135,7 +137,7 @@ public class ESOrgUsrService {
queryBuilder
=
QueryBuilders
.
fuzzyQuery
(
"bizOrgName"
,
name
);
}
Iterable
<
ESOrgUsrDto
>
search
=
esOrgUsrDtoRepository
.
search
(
queryBuilder
);
List
<
ESOrgUsrDto
>
list
=
new
LinkedLis
t
<>();
Set
<
ESOrgUsrDto
>
list
=
new
LinkedHashSe
t
<>();
search
.
forEach
(
esOrgUsrDto
->{
list
.
add
(
esOrgUsrDto
);
});
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
View file @
70ed9d94
...
...
@@ -10,6 +10,9 @@ import java.util.function.Function;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESOrgUsrDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.ESOrgUsrService
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -121,6 +124,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
@Autowired
private
EmqKeeper
emqKeeper
;
@Autowired
ESOrgUsrService
eSOrgUsrService
;
@Value
(
"${mqtt.topic.command.alert.notice}"
)
private
String
topic
;
...
...
@@ -424,6 +430,17 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
* 同步保存ES
*/
eSAlertCalledService
.
saveAlertCalledToES
(
alertCalled
);
// 事发单位保存进ES
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getUnitInvolved
()))
{
OrgUsr
orgUsr
=
new
OrgUsr
();
orgUsr
.
setSequenceNbr
(-
1L
);
orgUsr
.
setBizOrgName
(
alertCalled
.
getUnitInvolved
());
eSOrgUsrService
.
saveAlertCalledToES
(
orgUsr
);
}
}
// toSendCompletePoliceSituationMatch(alertCalled.getSequenceNbr());
return
alertCalledObjsDto
;
...
...
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