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
7a551c95
Commit
7a551c95
authored
Dec 08, 2021
by
chenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交预案匹配的异步方式
parent
227f6697
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
AlertCalledServiceImpl.java
...t/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
+17
-4
application.properties
...boot-system-jcs/src/main/resources/application.properties
+1
-1
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/AlertCalledServiceImpl.java
View file @
7a551c95
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
static
org
.
hamcrest
.
CoreMatchers
.
nullValue
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
...
...
@@ -18,6 +16,7 @@ import org.apache.logging.log4j.Logger;
import
org.joda.time.DateTime
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
...
...
@@ -122,6 +121,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
@Autowired
private
EmqKeeper
emqKeeper
;
@Value
(
"${mqtt.topic.command.alert.notice}"
)
private
String
topic
;
@Value
(
"${redis.cache.failure.time}"
)
...
...
@@ -399,13 +399,26 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
*/
eSAlertCalledService
.
saveAlertCalledToES
(
alertCalled
);
}
toSendCompletePoliceSituationMatch
(
alertCalled
.
getSequenceNbr
());
return
alertCalledObjsDto
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"报送失败,系统异常!"
);
}
}
@Async
public
void
toSendCompletePoliceSituationMatch
(
Long
id
)
throws
Exception
{
Object
result
=
toCompletePoliceSituationMatch
(
id
);
try
{
List
<
Object
>
list
=
(
List
<
Object
>)
result
;
if
(
list
.
size
()>
0
)
{
emqKeeper
.
getMqttClient
().
publish
(
topicMatch
,
result
.
toString
().
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"报送失败,系统异常!"
);
}
}
/**
* 根据id 修改警情 type:警情相关 操作类型 0警情续报 1非警情确认 2 警情结案
*/
...
...
@@ -1006,7 +1019,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
String
condition1
=
alertCalled
.
getAlertType
();
result
=
getIdsList1
(
alertCalled
.
getAlertTypeCode
(),
AlertStageEnums
.
救援预案警情类型
.
getValue
()
+
","
+
condition1
,
null
,
null
);
}
emqKeeper
.
getMqttClient
().
publish
(
topicMatch
,
result
.
toString
().
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
return
result
;
}
...
...
amos-boot-system-jcs/src/main/resources/application.properties
View file @
7a551c95
...
...
@@ -66,7 +66,7 @@ mqtt.topic.command.power.deployment=power
mqtt.topic.alert.iot
=
iot-system-alarm
mqtt.topic.alert.iot.web
=
iot-system-alarm-web
#警情预案匹配的消息topic名称
mqtt.topic.command.knowledgebase.alert.match
=
knowledge
base
AlertMatch
mqtt.topic.command.knowledgebase.alert.match
=
knowledgeAlertMatch
security.systemctl.name
=
AMOS-API-SYSTEMCTL
...
...
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