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
0d7d9a5a
Commit
0d7d9a5a
authored
Dec 09, 2021
by
chenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决方法内添加异步注解导致循环引用的问题
parent
f7050a53
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
16 deletions
+28
-16
AlertCalledController.java
...boot/module/jcs/biz/controller/AlertCalledController.java
+26
-2
AlertCalledServiceImpl.java
...t/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
+2
-14
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/controller/AlertCalledController.java
View file @
0d7d9a5a
...
@@ -8,8 +8,11 @@ import java.util.stream.Collectors;
...
@@ -8,8 +8,11 @@ import java.util.stream.Collectors;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
@@ -21,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -21,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.event.RestEventTrigger
;
import
org.typroject.tyboot.component.event.RestEventTrigger
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
...
@@ -54,6 +58,7 @@ import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStatusEnum;
...
@@ -54,6 +58,7 @@ import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStatusEnum;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertCalledServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertCalledServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.ESAlertCalledService
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.ESAlertCalledService
;
import
com.yeejoin.amos.component.rule.config.RuleConfig
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -69,7 +74,7 @@ import io.swagger.annotations.ApiOperation;
...
@@ -69,7 +74,7 @@ import io.swagger.annotations.ApiOperation;
@Api
(
tags
=
"警情接警记录Api"
)
@Api
(
tags
=
"警情接警记录Api"
)
@RequestMapping
(
value
=
"/alert-called"
)
@RequestMapping
(
value
=
"/alert-called"
)
public
class
AlertCalledController
extends
BaseController
{
public
class
AlertCalledController
extends
BaseController
{
private
final
Logger
logger
=
LogManager
.
getLogger
(
AlertCalledController
.
class
);
@Autowired
@Autowired
LatentDangerFeignClient
latentDangerFeignClient
;
LatentDangerFeignClient
latentDangerFeignClient
;
@Autowired
@Autowired
...
@@ -92,6 +97,12 @@ public class AlertCalledController extends BaseController {
...
@@ -92,6 +97,12 @@ public class AlertCalledController extends BaseController {
private
static
String
ALETR_TYPE_AID
=
"1214"
;
private
static
String
ALETR_TYPE_AID
=
"1214"
;
private
static
String
ALETR_TYPE_AID_STATUS
=
"patientStatus"
;
private
static
String
ALETR_TYPE_AID_STATUS
=
"patientStatus"
;
@Autowired
private
EmqKeeper
emqKeeper
;
@Value
(
"${mqtt.topic.command.knowledgebase.alert.match}"
)
private
String
topicMatch
;
/**
/**
* 新增警情接警记录
* 新增警情接警记录
*
*
...
@@ -135,9 +146,22 @@ public class AlertCalledController extends BaseController {
...
@@ -135,9 +146,22 @@ public class AlertCalledController extends BaseController {
}
}
alertCalledObjsDto
.
setAlertCalled
(
alertCalled
);
alertCalledObjsDto
.
setAlertCalled
(
alertCalled
);
alertCalledObjsDto
=
iAlertCalledService
.
createAlertCalled
(
alertCalledObjsDto
);
alertCalledObjsDto
=
iAlertCalledService
.
createAlertCalled
(
alertCalledObjsDto
);
toSendCompletePoliceSituationMatch
(
alertCalledObjsDto
.
getAlertCalled
().
getSequenceNbr
());
return
ResponseHelper
.
buildResponse
(
alertCalledObjsDto
.
getAlertCalled
());
return
ResponseHelper
.
buildResponse
(
alertCalledObjsDto
.
getAlertCalled
());
}
}
@Async
public
void
toSendCompletePoliceSituationMatch
(
Long
id
){
try
{
Object
result
=
iAlertCalledService
.
toCompletePoliceSituationMatch
(
id
);
List
<
Object
>
list
=
(
List
<
Object
>)
result
;
if
(
list
.
size
()>
0
)
{
emqKeeper
.
getMqttClient
().
publish
(
topicMatch
,
result
.
toString
().
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
}
}
catch
(
Exception
e
)
{
logger
.
info
(
topicMatch
+
":警情id"
+
id
+
"获取匹配的预案失败------------"
+
e
.
getMessage
());
}
}
/**
/**
* 根据id删除
* 根据id删除
*
*
...
...
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 @
0d7d9a5a
...
@@ -16,7 +16,6 @@ import org.apache.logging.log4j.Logger;
...
@@ -16,7 +16,6 @@ import org.apache.logging.log4j.Logger;
import
org.joda.time.DateTime
;
import
org.joda.time.DateTime
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
...
@@ -399,25 +398,14 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
...
@@ -399,25 +398,14 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
*/
*/
eSAlertCalledService
.
saveAlertCalledToES
(
alertCalled
);
eSAlertCalledService
.
saveAlertCalledToES
(
alertCalled
);
}
}
toSendCompletePoliceSituationMatch
(
alertCalled
.
getSequenceNbr
());
//
toSendCompletePoliceSituationMatch(alertCalled.getSequenceNbr());
return
alertCalledObjsDto
;
return
alertCalledObjsDto
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
throw
new
RuntimeException
(
"报送失败,系统异常!"
);
throw
new
RuntimeException
(
"报送失败,系统异常!"
);
}
}
}
}
//@Async
public
void
toSendCompletePoliceSituationMatch
(
Long
id
){
try
{
Object
result
=
toCompletePoliceSituationMatch
(
id
);
List
<
Object
>
list
=
(
List
<
Object
>)
result
;
if
(
list
.
size
()>
0
)
{
emqKeeper
.
getMqttClient
().
publish
(
topicMatch
,
result
.
toString
().
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
}
}
catch
(
Exception
e
)
{
logger
.
info
(
topicMatch
+
":警情id"
+
id
+
"获取匹配的预案失败------------"
+
e
.
getMessage
());
}
}
/**
/**
* 根据id 修改警情 type:警情相关 操作类型 0警情续报 1非警情确认 2 警情结案
* 根据id 修改警情 type:警情相关 操作类型 0警情续报 1非警情确认 2 警情结案
*/
*/
...
...
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