Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
f07f00f7
Commit
f07f00f7
authored
Jan 28, 2021
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:新增报警推送
parent
d415b1ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
46 deletions
+38
-46
HandlerMqttMessageImpl.java
...mos/fas/business/service/impl/HandlerMqttMessageImpl.java
+38
-46
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/HandlerMqttMessageImpl.java
View file @
f07f00f7
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.UUID
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.collect.Lists
;
...
...
@@ -32,13 +9,7 @@ import com.yeejoin.amos.fas.business.action.model.ContingencyRo;
import
com.yeejoin.amos.fas.business.action.model.FireEquimentDataRo
;
import
com.yeejoin.amos.fas.business.action.mq.WebMqttComponent
;
import
com.yeejoin.amos.fas.business.action.mq.WebMqttSubscribe
;
import
com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.FireEquipMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.FireEquipPointMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.FmeaEquipmentPointMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.FmeaMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.FmeaPointInputitemMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.ImpAndFireEquipMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.*
;
import
com.yeejoin.amos.fas.business.dao.repository.IContingencyOriginalDataDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IEvaluationModelDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IPreplanPictureDao
;
...
...
@@ -56,14 +27,24 @@ import com.yeejoin.amos.fas.business.vo.Toke;
import
com.yeejoin.amos.fas.business.vo.TopicEntityVo
;
import
com.yeejoin.amos.fas.client.invoke.RsDataQueue
;
import
com.yeejoin.amos.fas.common.enums.EquipmentRiskTypeEnum
;
import
com.yeejoin.amos.fas.common.enums.View3dRefreshAreaEum
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
import
com.yeejoin.amos.fas.dao.entity.EvaluationModel
;
import
com.yeejoin.amos.fas.dao.entity.Fmea
;
import
com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint
;
import
com.yeejoin.amos.fas.dao.entity.FmeaPointInputitem
;
import
com.yeejoin.amos.fas.dao.entity.PreplanPicture
;
import
com.yeejoin.amos.fas.dao.entity.*
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
/**
* @author keyong
...
...
@@ -157,6 +138,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
String
nameKey
=
equipmentSpecificIndex
.
getNameKey
();
EquipmentSpecificForRiskVo
equipmentSpecific
=
equipmentSpecificMapper
.
getOneById
(
eqSpecId
);
// 三维屏指标状态推送
String
specificIndexType
=
equipmentSpecificIndex
.
getType
();
if
(
nameKey
!=
null
&&
nameKeys
.
contains
(
nameKey
))
{
if
(
equipmentSpecific
!=
null
)
{
equipmentSpecificIndex
.
setId
(
equipmentSpecific
.
getId
());
...
...
@@ -173,14 +155,24 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
deviceData
.
setMonitor
(
equipment
!=
null
?
equipment
.
getName
()
:
""
);
deviceData
.
setId
(
String
.
valueOf
(
equipmentSpecific
.
getId
()));
deviceData
.
setCode
(
equipmentSpecific
.
getCode
());
if
(
EquipmentRiskTypeEnum
.
HZGJ
.
getCode
().
equals
(
equipmentSpecificIndex
.
getType
()))
{
//设备告警处理逻辑
log
.
info
(
"(报警)Message type is: "
+
equipmentSpecificIndex
.
getType
());
if
(
EquipmentRiskTypeEnum
.
HZGJ
.
getCode
().
equals
(
specificIndexType
))
{
//设备告警处理逻辑
log
.
info
(
"(报警)Message type is: "
+
specificIndexType
);
//通知刷新3d页面告警数据
// iDataRefreshService.refreshViewData(DataRefreshTypeEum.alarm.getCode());
/**
* 推送告警数据
* 影响区域:消防安全=>火灾告警
*/
String
title
=
String
.
format
(
"/%s/%s/%s/%s"
,
serviceName
,
stationName
,
"data/refresh"
,
"fireSafety"
);
webMqttComponent
.
publish
(
title
,
JSON
.
toJSONString
(
view3dService
.
getSafetyExecuteListTop5
(
"fire"
,
equipmentSpecific
.
getOrgCode
())));
// 报警触发调用规则服务
executeDynamicPlan
(
deviceData
,
equipment
,
equipmentSpecific
,
toke
);
}
else
if
(
EquipmentRiskTypeEnum
.
GZ
.
getCode
().
equals
(
equipmentSpecificIndex
.
getType
()))
{
// 设备故障处理逻辑
log
.
info
(
"(故障)Message type is: "
+
equipmentSpecificIndex
.
getType
());
if
(!
ObjectUtils
.
isEmpty
(
equipment
)
&&
!
ObjectUtils
.
isEmpty
(
equipment
.
getReservePlan
())){
executeDynamicPlan
(
deviceData
,
equipment
,
equipmentSpecific
,
toke
);
}
}
else
if
(
EquipmentRiskTypeEnum
.
GZ
.
getCode
().
equals
(
specificIndexType
))
{
// 设备故障处理逻辑
log
.
info
(
"(故障)Message type is: "
+
specificIndexType
);
long
equipId
=
0
;
if
(
StringUtil
.
isNotEmpty
(
equipment
))
{
equipId
=
equipment
.
getId
();
...
...
@@ -202,7 +194,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
}
}
else
{
// 向三维推送实时值修改
log
.
info
(
"(监测)Message type is: "
+
equipmentSpecificIndex
.
getType
()
);
log
.
info
(
"(监测)Message type is: "
+
specificIndexType
);
// 是否关联风险点
notifyAlarm
(
equipmentSpecificIndex
,
0
);
Map
<
String
,
Object
>
content
=
new
HashMap
<>();
...
...
@@ -213,7 +205,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
content
.
put
(
"orgCode"
,
equipmentSpecific
.
getOrgCode
());
content
.
put
(
"indexKey"
,
equipmentSpecificIndex
.
getNameKey
());
content
.
put
(
"status"
,
equipmentSpecificIndex
.
getValue
());
iDataRefreshService
.
sendRefreshDataWithArea
(
View3dRefreshAreaEum
.
monitor_data
.
getCode
(),
content
);
//
iDataRefreshService.sendRefreshDataWithArea(View3dRefreshAreaEum.monitor_data.getCode(), content);
String
title
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"data/refresh/monitorData"
);
webMqttComponent
.
publish
(
title
,
JSON
.
toJSONString
(
view3dService
.
getEquipStatusList
(
equipmentSpecific
.
getOrgCode
())));
}
...
...
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