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
d7cbfb80
Commit
d7cbfb80
authored
Mar 28, 2022
by
maoying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改消防报警后修改拓扑图数据
parent
d0ea5c09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
523 deletions
+75
-523
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+75
-523
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
d7cbfb80
...
@@ -29,19 +29,16 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -29,19 +29,16 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.feign.systemctl.model.MessageModel
;
import
com.yeejoin.amos.feign.systemctl.model.MessageModel
;
import
com.yeejoin.equipmanage.common.datasync.entity.FireEquipment
;
import
com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentDefectAlarm
;
import
com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentDefectAlarm
;
import
com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFaultAlarm
;
import
com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFaultAlarm
;
import
com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFireAlarm
;
import
com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFireAlarm
;
import
com.yeejoin.equipmanage.common.dto.TemperatureAlarmDto
;
import
com.yeejoin.equipmanage.common.dto.TemperatureAlarmDto
;
import
com.yeejoin.equipmanage.common.entity.CarProperty
;
import
com.yeejoin.equipmanage.common.entity.CarProperty
;
import
com.yeejoin.equipmanage.common.entity.EquipmentAlarmReportDay
;
import
com.yeejoin.equipmanage.common.entity.EquipmentAlarmReportDay
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecific
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex
;
import
com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity
;
import
com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity
;
import
com.yeejoin.equipmanage.common.entity.vo.CarIndexVo
;
import
com.yeejoin.equipmanage.common.entity.vo.CarPropertyVo
;
import
com.yeejoin.equipmanage.common.entity.vo.CarPropertyVo
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo
;
...
@@ -62,6 +59,7 @@ import com.yeejoin.equipmanage.common.utils.DateUtils;
...
@@ -62,6 +59,7 @@ import com.yeejoin.equipmanage.common.utils.DateUtils;
import
com.yeejoin.equipmanage.common.utils.StringUtil
;
import
com.yeejoin.equipmanage.common.utils.StringUtil
;
import
com.yeejoin.equipmanage.common.vo.CarIndexGisVo
;
import
com.yeejoin.equipmanage.common.vo.CarIndexGisVo
;
import
com.yeejoin.equipmanage.common.vo.EquipmentIndexLabelsVo
;
import
com.yeejoin.equipmanage.common.vo.EquipmentIndexLabelsVo
;
import
com.yeejoin.equipmanage.common.vo.EquipmentVo
;
import
com.yeejoin.equipmanage.common.vo.IotDataVO
;
import
com.yeejoin.equipmanage.common.vo.IotDataVO
;
import
com.yeejoin.equipmanage.common.vo.Token
;
import
com.yeejoin.equipmanage.common.vo.Token
;
import
com.yeejoin.equipmanage.common.vo.TopicEntityVo
;
import
com.yeejoin.equipmanage.common.vo.TopicEntityVo
;
...
@@ -76,6 +74,7 @@ import com.yeejoin.equipmanage.remote.RemoteSecurityService;
...
@@ -76,6 +74,7 @@ import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import
com.yeejoin.equipmanage.service.ICarPropertyService
;
import
com.yeejoin.equipmanage.service.ICarPropertyService
;
import
com.yeejoin.equipmanage.service.IEquipmentAlarmReportDayService
;
import
com.yeejoin.equipmanage.service.IEquipmentAlarmReportDayService
;
import
com.yeejoin.equipmanage.service.IEquipmentIndexService
;
import
com.yeejoin.equipmanage.service.IEquipmentIndexService
;
import
com.yeejoin.equipmanage.service.IEquipmentService
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmLogService
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmLogService
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce
;
...
@@ -172,7 +171,13 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -172,7 +171,13 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Autowired
@Autowired
private
RemoteSecurityService
remoteSecurityService
;
private
RemoteSecurityService
remoteSecurityService
;
@Autowired
private
TopographyService
topographyService
;
@Autowired
private
IEquipmentService
equipmentService
;
@Value
(
"${equipManage.name}"
)
@Value
(
"${equipManage.name}"
)
private
String
serverName
;
private
String
serverName
;
...
@@ -196,6 +201,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -196,6 +201,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Value
(
"${isSendApp}"
)
@Value
(
"${isSendApp}"
)
private
Boolean
isSendApp
;
private
Boolean
isSendApp
;
private
final
static
Map
staticMap
=
new
HashMap
();
private
final
static
Map
staticMap
=
new
HashMap
();
...
@@ -247,486 +254,34 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -247,486 +254,34 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
return
;
return
;
}
}
log
.
info
(
String
.
format
(
"收到mqtt消息:%s"
,
message
));
log
.
info
(
String
.
format
(
"收到mqtt消息:%s"
,
message
));
// saveDataToDB(topicEntity, iotDatalist);
realTimeDateProcessing
(
topicEntity
,
iotDatalist
);
realTimeDateProcessing
(
topicEntity
,
iotDatalist
);
}
}
/**
/**
* <pre>
* 物联数据处理
* @Description: 持久化数据
* @param topicEntity
* </pre>
* @param iotDatalist
*
* @MethodName:
* @Param:
* @Return:
* @Throws
* @Author keyong
* @Date 2021/1/7 18:17
*/
*/
public
void
saveDataToDB
(
TopicEntityVo
topicEntity
,
List
<
IotDataVO
>
iotDatalist
)
{
public
void
realTimeDateProcessing
(
TopicEntityVo
topicEntity
,
List
<
IotDataVO
>
iotDatalist
){
String
iotCode
=
topicEntity
.
getIotCode
();
String
iotCode
=
topicEntity
.
getIotCode
();
List
<
EquipmentSpecificIndex
>
indexList
=
equipmentSpecificIndexService
.
getEquipmentSpeIndexBySpeIotCode
(
iotCode
);
List
<
CarProperty
>
carProperties
=
carPropertyService
.
getCarPropListByIotCode
(
iotCode
);
if
(
EquipAndCarEnum
.
equip
.
type
.
equals
(
topicEntity
.
getType
())){
if
(
ObjectUtils
.
isEmpty
(
indexList
)
&&
ObjectUtils
.
isEmpty
(
carProperties
))
{
List
<
EquipmentSpecificIndex
>
indexList
=
equipmentSpecificIndexService
.
getEquipmentSpeIndexBySpeIotCode
(
iotCode
);
return
;
if
(
ObjectUtils
.
isEmpty
(
indexList
)){
}
return
;
}
// 存储温度告警(火眼)
equipRealTimeDate
(
iotDatalist
,
indexList
,
topicEntity
);
iotDataListToCacheMap
(
iotDatalist
);
}
else
{
List
<
CarProperty
>
carProperties
=
carPropertyService
.
getCarPropListByIotCode
(
iotCode
);
iotDatalist
.
forEach
(
iotDataVO
->
{
if
(
ObjectUtils
.
isEmpty
(
carProperties
)){
if
(
EquipAndCarEnum
.
equip
.
type
.
equals
(
topicEntity
.
getType
()))
{
return
;
// 装备指标信息存储,装备信息系统不存在的指标不做更新处理也不添加
}
List
<
EquipmentSpecificIndex
>
equipmentSpecificIndexList
=
new
ArrayList
<>();
carRealTimeDate
(
iotDatalist
,
carProperties
);
List
<
EquipmentSpecificAlarm
>
equipmentSpecificAlarms
=
new
ArrayList
<>();
}
List
<
EquipmentAlarmReportDay
>
equipmentAlarmReports
=
new
ArrayList
<>();
List
<
EquipmentSpecificAlarmLog
>
equipmentAlarmLogs
=
new
ArrayList
<>();
}
List
<
IndexStateVo
>
indexStateList
=
new
ArrayList
<>();
// EquipmentStateVo equipmentStateVo = new EquipmentStateVo();
List
<
EquipmentSpecificIndex
>
newIndexList
=
new
ArrayList
<>();
for
(
EquipmentSpecificIndex
equipmentSpecificIndex
:
indexList
)
{
EquipmentSpecificIndex
equipmentSpeIndex
=
new
EquipmentSpecificIndex
();
IndexStateVo
indexStateVo
=
new
IndexStateVo
();
newIndexList
.
add
(
equipmentSpecificIndex
);
if
(
equipmentSpecificIndex
.
getNameKey
()
!=
null
&&
equipmentSpecificIndex
.
getNameKey
().
toLowerCase
().
equals
(
iotDataVO
.
getKey
().
toLowerCase
()))
{
BeanUtils
.
copyProperties
(
equipmentSpecificIndex
,
equipmentSpeIndex
);
String
value
=
iotDataVO
.
getValue
().
toString
();
equipmentSpeIndex
.
setValue
(
value
);
equipmentSpeIndex
.
setUpdateDate
(
new
Date
());
equipmentSpecificIndex
.
setValue
(
value
);
String
enumStr
=
equipmentSpecificIndex
.
getValueEnum
();
if
(!
ObjectUtils
.
isEmpty
(
enumStr
))
{
try
{
JSONArray
jsonArray
=
JSONArray
.
parseArray
(
enumStr
);
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
JSONObject
jsonObject
=
jsonArray
.
getJSONObject
(
i
);
if
(
jsonObject
.
get
(
"key"
).
equals
(
value
))
{
equipmentSpeIndex
.
setValueLabel
(
jsonObject
.
getString
(
"label"
));
equipmentSpecificIndex
.
setValueLabel
(
jsonObject
.
getString
(
"label"
));
}
}
}
catch
(
Exception
e
)
{
}
}
equipmentSpecificIndexList
.
add
(
equipmentSpeIndex
);
equipmentSpecificAlarms
.
addAll
(
addIndexAlarmRecord
(
equipmentSpeIndex
,
iotDatalist
));
equipmentAlarmReports
.
add
(
addEquipAlarmReportRecord
(
equipmentSpeIndex
));
// 封装用于性能指标状态变化的实体
indexStateVo
.
setId
(
iotCode
+
"_"
+
equipmentSpecificIndex
.
getNameKey
());
indexStateVo
.
setData
((
String
.
valueOf
(
iotDataVO
.
getValue
())));
indexStateVo
.
setIndexKey
(
equipmentSpecificIndex
.
getNameKey
());
indexStateVo
.
setIndexName
(
equipmentSpecificIndex
.
getIndexName
());
indexStateVo
.
setTypeCode
(
equipmentSpecificIndex
.
getTypeCode
());
indexStateVo
.
setTypeName
(
equipmentSpecificIndex
.
getTypeName
());
indexStateList
.
add
(
indexStateVo
);
// 发送数据至换流站
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
@Override
public
void
afterCommit
()
{
String
topic
=
""
;
if
(
TrueOrFalseEnum
.
real
.
value
.
equals
(
value
)
&&
EquipmentRiskTypeEnum
.
HZGJ
.
getCode
().
equals
(
equipmentSpecificIndex
.
getTypeCode
()))
{
equipmentSpeIndex
.
setType
(
EquipmentRiskTypeEnum
.
HZGJ
.
getCode
());
topic
=
String
.
format
(
"%s.%s%s"
,
serverName
,
"equipment/"
,
RiskLeverForAutoSys
.
BJ
.
getCode
());
}
else
if
(
TrueOrFalseEnum
.
real
.
value
.
equals
(
value
)
&&
EquipmentRiskTypeEnum
.
GZ
.
getCode
().
equals
(
equipmentSpecificIndex
.
getTypeCode
()))
{
equipmentSpeIndex
.
setType
(
EquipmentRiskTypeEnum
.
GZ
.
getCode
());
topic
=
String
.
format
(
"%s.%s%s"
,
serverName
,
"equipment/"
,
RiskLeverForAutoSys
.
GZ
.
getCode
());
}
else
{
equipmentSpeIndex
.
setType
(
EquipmentRiskTypeEnum
.
QT
.
getCode
());
topic
=
String
.
format
(
"%s.%s%s"
,
serverName
,
"equipment/"
,
RiskLeverForAutoSys
.
JC
.
getCode
());
}
TopicEntityVo
topicEntityVo
=
new
TopicEntityVo
();
BeanUtils
.
copyProperties
(
topicEntity
,
topicEntityVo
);
topicEntityVo
.
setTopic
(
topic
);
topicEntityVo
.
setMessage
(
JSON
.
toJSONString
(
equipmentSpeIndex
));
mqttSendGateway
.
sendToMqtt
(
topic
,
JSON
.
toJSONString
(
topicEntityVo
));
}
});
// equipmentStateVo.setEquipName(equipmentSpecificIndex.getEquipmentSpecificName());
// equipmentStateVo.setOrgCode(equipmentSpecificIndex.getOrgCode());
// equipmentStateVo.setSpecificId(equipmentSpecificIndex.getEquipmentSpecificId());
// equipmentStateVo.setEquipCode(equipmentSpecificIndex.getQrCode());
// equipmentStateVo.setEquipIotCode(iotCode);
List
<
EquipmentSpecificIndex
>
tempIndexList
=
new
ArrayList
<>();
tempIndexList
=
newIndexList
.
stream
().
filter
(
x
->
x
.
getEquipmentIndexId
().
equals
(
equipmentSpeIndex
.
getEquipmentIndexId
())).
collect
(
Collectors
.
toList
());
tempIndexList
.
get
(
0
).
setValue
(
value
);
tempIndexList
.
get
(
0
).
setUpdateDate
(
new
Date
());
}
}
if
(
equipmentSpecificIndexList
.
size
()
>
0
)
{
boolean
updateBatchById
=
equipmentSpecificIndexService
.
updateBatchById
(
equipmentSpecificIndexList
);
if
(
updateBatchById
&&
syncSwitch
)
{
// 数据同步
List
<
Long
>
specificIndexIds
=
new
ArrayList
<>();
equipmentSpecificIndexList
.
forEach
(
x
->
specificIndexIds
.
add
(
x
.
getId
()));
List
<
EquipmentIndexVO
>
specificIndexList
=
equipmentSpecificIndexSerivce
.
getEquipIndexByIdIn
(
specificIndexIds
);
List
<
EquipmentIndexVO
>
fireEquipmentInfoCollect
=
specificIndexList
.
stream
().
filter
(
vo
->
0
==
vo
.
getIsIot
()).
collect
(
Collectors
.
toList
());
List
<
EquipmentIndexVO
>
fireEquipMeasurementCollect
=
specificIndexList
.
stream
().
filter
(
vo
->
1
==
vo
.
getIsIot
()).
collect
(
Collectors
.
toList
());
if
(
0
<
fireEquipmentInfoCollect
.
size
())
{
syncDataService
.
syncCreatedEquipmentSpecificInfo
(
fireEquipmentInfoCollect
);
}
if
(
0
<
fireEquipMeasurementCollect
.
size
())
{
syncDataService
.
syncCreatedFireEquipMeasurement
(
fireEquipMeasurementCollect
);
}
}
// 发送数据到画布
publishDataToCanvas
(
newIndexList
);
}
// 设备报警日报表数据储存更新
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
DateUtils
.
DATE_PATTERN
);
if
(!
equipmentAlarmReports
.
isEmpty
())
{
equipmentAlarmReports
.
forEach
(
x
->
{
LambdaQueryWrapper
<
EquipmentAlarmReportDay
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
EquipmentAlarmReportDay:
:
getReportDate
,
sdf
.
format
(
x
.
getReportDate
())).
eq
(
EquipmentAlarmReportDay:
:
getIndexId
,
x
.
getIndexId
())
.
eq
(
EquipmentAlarmReportDay:
:
getEquipmentSpecificId
,
x
.
getEquipmentSpecificId
());
List
<
EquipmentAlarmReportDay
>
reportDayList
=
iEquipmentAlarmReportDayService
.
list
(
wrapper
);
if
(
1
==
x
.
getIsAlarm
())
{
if
(
reportDayList
.
isEmpty
())
{
x
.
setReportDate
(
new
Date
());
x
.
setFrequency
(
1
);
iEquipmentAlarmReportDayService
.
save
(
x
);
}
else
{
EquipmentAlarmReportDay
reportDay
=
reportDayList
.
get
(
0
);
reportDay
.
setLastReportDate
(
new
Date
());
reportDay
.
setValue
(
x
.
getValue
());
reportDay
.
setFrequency
(
reportDay
.
getFrequency
()
+
1
);
reportDay
.
setIndexTrueNum
(
reportDay
.
getIndexTrueNum
()
==
null
?
x
.
getIndexTrueNum
()
:
reportDay
.
getIndexTrueNum
()
+
x
.
getIndexTrueNum
());
iEquipmentAlarmReportDayService
.
updateById
(
reportDay
);
}
}
});
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQXXTJ
.
getTopic
(),
""
);
}
Long
alarmId
=
0L
;
if
(!
ObjectUtils
.
isEmpty
(
equipmentSpecificAlarms
))
{
List
<
Long
>
specificAlarmIds
=
new
ArrayList
<>();
List
<
Long
>
equipIndexIds
=
new
ArrayList
<>();
for
(
EquipmentSpecificAlarm
action
:
equipmentSpecificAlarms
)
{
// 通过设备ID,查询设备位置
EquipmentSpecific
specific
=
new
EquipmentSpecific
();
specific
.
setId
(
action
.
getEquipmentSpecificId
());
FireEquipment
fireEquipment
=
iEquipmentSpecificSerivce
.
getEquipSpecificDetail
(
specific
);
if
(!
ObjectUtils
.
isEmpty
(
fireEquipment
))
{
action
.
setLocation
(
fireEquipment
.
getPosition
());
action
.
setEquipmentSpecificCode
(
fireEquipment
.
getCode
());
action
.
setBuildId
(
fireEquipment
.
getBuildId
());
}
equipmentSpecificAlarmService
.
saveOrUpdate
(
action
);
if
(
AlarmStatusEnum
.
BJ
.
getCode
()
==
action
.
getStatus
())
{
equipmentAlarmLogs
.
add
(
addEquipAlarmLogRecord
(
action
));
if
(
ValidationUtil
.
isEmpty
(
action
.
getAlamContent
()))
{
action
.
setAlamContent
(
action
.
getEquipmentSpecificName
()
+
action
.
getEquipmentSpecificIndexName
());
}
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQDQR
.
getTopic
(),
JSONArray
.
toJSON
(
action
).
toString
());
}
else
{
upAlarmLogStatus
(
action
.
getIotCode
(),
action
.
getEquipmentSpecificIndexKey
(),
equipmentSpecificAlarmLogService
);
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQYQR
.
getTopic
(),
JSONArray
.
toJSON
(
action
).
toString
());
bool
=
Boolean
.
TRUE
;
}
specificAlarmIds
.
add
(
action
.
getId
());
equipIndexIds
.
add
(
action
.
getEquipmentIndexId
());
}
if
(
syncSwitch
)
{
List
<
FireEquipmentFireAlarm
>
alarmList
=
equipmentSpecificAlarmService
.
getFireEquipAlarmDetailsByAlarmId
(
specificAlarmIds
,
equipIndexIds
);
if
(!
CollectionUtils
.
isEmpty
(
alarmList
))
{
Map
<
String
,
List
<
FireEquipmentFireAlarm
>>
collect
=
alarmList
.
stream
().
collect
(
Collectors
.
groupingBy
(
FireEquipmentFireAlarm:
:
getType
));
for
(
String
key
:
collect
.
keySet
())
{
List
<
FireEquipmentFireAlarm
>
list
=
collect
.
get
(
key
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
if
(
"FIREALARM"
.
equalsIgnoreCase
(
key
))
{
syncDataService
.
syncCreatedFireEquipAlarm
(
list
);
}
else
if
(
"BREAKDOWN"
.
equalsIgnoreCase
(
key
))
{
List
<
FireEquipmentFaultAlarm
>
faultAlarms
=
list
.
stream
().
map
(
x
->
{
FireEquipmentFaultAlarm
fireEquipmentFaultAlarm
=
new
FireEquipmentFaultAlarm
();
BeanUtils
.
copyProperties
(
x
,
fireEquipmentFaultAlarm
);
return
fireEquipmentFaultAlarm
;
}).
collect
(
Collectors
.
toList
());
syncDataService
.
syncCreatedFireEquiptFaultAlarm
(
faultAlarms
);
}
else
if
(
"SHIELD"
.
equalsIgnoreCase
(
key
))
{
List
<
FireEquipmentDefectAlarm
>
defectAlarms
=
list
.
stream
().
map
(
x
->
{
FireEquipmentDefectAlarm
fireEquipmentFaultAlarm
=
new
FireEquipmentDefectAlarm
();
BeanUtils
.
copyProperties
(
x
,
fireEquipmentFaultAlarm
);
return
fireEquipmentFaultAlarm
;
}).
collect
(
Collectors
.
toList
());
syncDataService
.
syncCreatedFireEquipDefectAlarm
(
defectAlarms
);
}
}
}
}
syncDataService
.
syncCreatedSendAlarm
(
equipmentAlarmLogs
);
}
}
// 首页性能指标数据订阅
mqttSendGateway
.
sendToMqtt
(
indexTopic
,
JSON
.
toJSONString
(
indexStateList
));
//TODO 数字化换流站组态屏数据推送,需要在事务提交之后,否侧事务隔离查询不出数据
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
@Override
public
void
afterCommit
()
{
iEquipmentSpecificSerivce
.
integrationPageSysDataRefresh
(
topicEntity
.
getCode
());
iEquipmentSpecificSerivce
.
updateEquipmentSpecIndexRealtimeData
(
equipmentSpecificIndexList
);
//数字换流站站使用
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQZXDT
.
getTopic
(),
""
);
if
(!
equipmentAlarmLogs
.
isEmpty
()
||
bool
)
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"seqNo"
,
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
).
toLowerCase
());
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
ALARM_LOG_INSERT
.
getTopic
(),
jsonObject
.
toString
());
if
(
syncSwitch
)
{
syncDataService
.
syncCreatedSendAlarm
(
equipmentAlarmLogs
);
}
}
}
});
}
else
{
// 对指标key为labels的数据处理
if
(
EquipmentIndexLabelsEnum
.
labels
.
name
.
equals
(
iotDataVO
.
getKey
()))
{
StringBuilder
sb
=
new
StringBuilder
(
"equipmentOnCar_"
);
EquipmentIndexLabelsVo
labelsVo
=
new
EquipmentIndexLabelsVo
();
Object
obj
=
iotDataVO
.
getValue
();
if
(
obj
instanceof
JSONArray
)
{
List
<
String
>
labelList
=
(
List
<
String
>)
obj
;
labelList
.
forEach
(
code
->
{
String
key
=
sb
.
append
(
code
).
toString
();
labelsVo
.
setEquipmentIotCode
(
code
);
labelsVo
.
setTime
(
new
Date
());
redisUtils
.
set
(
key
,
com
.
alibaba
.
fastjson
.
JSONObject
.
toJSONString
(
labelsVo
),
redisExpireTime
);
});
}
}
// 车辆指标信息存储
List
<
CarProperty
>
carPropList
=
carPropertyService
.
getCarPropListByIotCode
(
iotCode
);
List
<
CarProperty
>
carList
=
new
ArrayList
<>();
List
<
CarIndexVo
>
cars
=
carMapper
.
getCarsIotInfoByIotCode
(
iotCode
);
List
<
CarIndexGisVo
>
list
=
new
ArrayList
<>();
long
id
=
0
;
boolean
bool
=
cars
.
size
()
>
0
;
if
(
bool
)
{
id
=
cars
.
get
(
0
).
getId
();
}
if
(
carPropList
.
size
()
>
0
)
{
for
(
CarProperty
carProperty
:
carPropList
)
{
CarProperty
property
=
new
CarProperty
();
if
(
iotDataVO
.
getKey
().
equals
(
carProperty
.
getNameKey
()))
{
BeanUtils
.
copyProperties
(
carProperty
,
property
);
property
.
setValue
(
iotDataVO
.
getValue
().
toString
());
carProperty
.
setValue
(
iotDataVO
.
getValue
().
toString
());
carList
.
add
(
property
);
}
if
(
bool
)
{
CarIndexGisVo
carIndexGisVo
=
new
CarIndexGisVo
();
for
(
CarIndexVo
carIndexVo
:
cars
)
{
carIndexGisVo
.
setId
(
carIndexVo
.
getId
());
carIndexGisVo
.
setIotCode
(
iotCode
);
if
(
CarForGisEnum
.
JD
.
getNameKey
().
equals
(
carProperty
.
getNameKey
())
&&
CarForGisEnum
.
JD
.
getNameKey
().
equals
(
carIndexVo
.
getNameKey
()))
{
if
(
StringUtil
.
isNotEmpty
(
carProperty
.
getValue
()))
{
carIndexGisVo
.
setNameKey
(
carProperty
.
getNameKey
());
carIndexGisVo
.
setValue
(
carProperty
.
getValue
());
}
else
{
carIndexGisVo
.
setNameKey
(
carProperty
.
getNameKey
());
carIndexGisVo
.
setValue
(
staticMap
.
get
(
CarForGisEnum
.
JD
.
getNameKey
()).
toString
());
}
}
else
if
(
CarForGisEnum
.
WD
.
getNameKey
().
equals
(
carProperty
.
getNameKey
())
&&
CarForGisEnum
.
WD
.
getNameKey
().
equals
(
carIndexVo
.
getNameKey
()))
{
if
(
StringUtil
.
isNotEmpty
(
carProperty
.
getValue
()))
{
carIndexGisVo
.
setNameKey
(
carProperty
.
getNameKey
());
carIndexGisVo
.
setValue
(
carProperty
.
getValue
());
}
else
{
carIndexGisVo
.
setNameKey
(
carProperty
.
getNameKey
());
carIndexGisVo
.
setValue
(
staticMap
.
get
(
CarForGisEnum
.
WD
.
getNameKey
()).
toString
());
}
}
else
if
(
CarForGisEnum
.
SD
.
getNameKey
().
equals
(
carProperty
.
getNameKey
())
&&
CarForGisEnum
.
SD
.
getNameKey
().
equals
(
carIndexVo
.
getNameKey
()))
{
if
(
StringUtil
.
isNotEmpty
(
carProperty
.
getValue
()))
{
carIndexGisVo
.
setNameKey
(
carProperty
.
getNameKey
());
carIndexGisVo
.
setValue
(
carProperty
.
getValue
());
}
else
{
carIndexGisVo
.
setNameKey
(
carProperty
.
getNameKey
());
carIndexGisVo
.
setValue
(
staticMap
.
get
(
CarForGisEnum
.
SD
.
getNameKey
()).
toString
());
}
}
else
if
(
CarForGisEnum
.
DL
.
getNameKey
().
equals
(
carProperty
.
getNameKey
())
&&
CarForGisEnum
.
DL
.
getNameKey
().
equals
(
carIndexVo
.
getNameKey
()))
{
if
(
StringUtil
.
isNotEmpty
(
carProperty
.
getValue
()))
{
carIndexGisVo
.
setNameKey
(
carProperty
.
getNameKey
());
carIndexGisVo
.
setValue
(
carProperty
.
getValue
());
}
else
{
carIndexGisVo
.
setNameKey
(
carProperty
.
getNameKey
());
carIndexGisVo
.
setValue
(
staticMap
.
get
(
CarForGisEnum
.
DL
.
getNameKey
()).
toString
());
}
}
else
if
(
CarForGisEnum
.
DDHX
.
getNameKey
().
equals
(
carProperty
.
getNameKey
())
&&
CarForGisEnum
.
DDHX
.
getNameKey
().
equals
(
carIndexVo
.
getNameKey
()))
{
if
(
StringUtil
.
isNotEmpty
(
carProperty
.
getValue
()))
{
carIndexGisVo
.
setNameKey
(
carProperty
.
getNameKey
());
carIndexGisVo
.
setValue
(
carProperty
.
getValue
());
}
else
{
carIndexGisVo
.
setNameKey
(
carProperty
.
getNameKey
());
carIndexGisVo
.
setValue
(
staticMap
.
get
(
CarForGisEnum
.
DDHX
.
getNameKey
()).
toString
());
}
}
else
if
(
CarForGisEnum
.
SJ
.
getNameKey
().
equals
(
carProperty
.
getNameKey
())
&&
CarForGisEnum
.
SJ
.
getNameKey
().
equals
(
carIndexVo
.
getNameKey
()))
{
if
(
StringUtil
.
isNotEmpty
(
carProperty
.
getValue
()))
{
carIndexGisVo
.
setNameKey
(
carProperty
.
getNameKey
());
carIndexGisVo
.
setValue
(
carProperty
.
getValue
());
}
else
{
carIndexGisVo
.
setNameKey
(
carProperty
.
getNameKey
());
carIndexGisVo
.
setValue
(
staticMap
.
get
(
CarForGisEnum
.
SJ
.
getNameKey
()).
toString
());
}
}
else
if
(
CarForGisEnum
.
QT
.
getNameKey
().
equals
(
carProperty
.
getNameKey
())
&&
CarForGisEnum
.
QT
.
getNameKey
().
equals
(
carIndexVo
.
getNameKey
()))
{
if
(
StringUtil
.
isNotEmpty
(
carProperty
.
getValue
()))
{
carIndexGisVo
.
setNameKey
(
carProperty
.
getNameKey
());
carIndexGisVo
.
setValue
(
carProperty
.
getValue
());
}
else
{
carIndexGisVo
.
setNameKey
(
carProperty
.
getNameKey
());
carIndexGisVo
.
setValue
(
staticMap
.
get
(
CarForGisEnum
.
QT
.
getNameKey
()).
toString
());
}
}
}
list
.
add
(
carIndexGisVo
);
}
}
}
if
(
list
.
size
()
>
0
)
{
if
(
0
==
list
.
stream
().
filter
(
index
->
CarForGisEnum
.
JD
.
getNameKey
().
equals
(
index
.
getNameKey
())).
collect
(
Collectors
.
toList
()).
size
())
{
CarIndexGisVo
indexGisVo
=
new
CarIndexGisVo
();
indexGisVo
.
setId
(
id
);
indexGisVo
.
setIotCode
(
iotCode
);
indexGisVo
.
setNameKey
(
CarForGisEnum
.
JD
.
getNameKey
());
indexGisVo
.
setValue
(
staticMap
.
get
(
CarForGisEnum
.
JD
.
getNameKey
()).
toString
());
list
.
add
(
indexGisVo
);
}
if
(
0
==
list
.
stream
().
filter
(
index
->
CarForGisEnum
.
WD
.
getNameKey
().
equals
(
index
.
getNameKey
())).
collect
(
Collectors
.
toList
()).
size
())
{
CarIndexGisVo
indexGisVo
=
new
CarIndexGisVo
();
indexGisVo
.
setId
(
id
);
indexGisVo
.
setIotCode
(
iotCode
);
indexGisVo
.
setNameKey
(
CarForGisEnum
.
WD
.
getNameKey
());
indexGisVo
.
setValue
(
staticMap
.
get
(
CarForGisEnum
.
WD
.
getNameKey
()).
toString
());
list
.
add
(
indexGisVo
);
}
if
(
0
==
list
.
stream
().
filter
(
index
->
CarForGisEnum
.
SD
.
getNameKey
().
equals
(
index
.
getNameKey
())).
collect
(
Collectors
.
toList
()).
size
())
{
CarIndexGisVo
indexGisVo
=
new
CarIndexGisVo
();
indexGisVo
.
setId
(
id
);
indexGisVo
.
setIotCode
(
iotCode
);
indexGisVo
.
setNameKey
(
CarForGisEnum
.
SD
.
getNameKey
());
indexGisVo
.
setValue
(
staticMap
.
get
(
CarForGisEnum
.
SD
.
getNameKey
()).
toString
());
list
.
add
(
indexGisVo
);
}
if
(
0
==
list
.
stream
().
filter
(
index
->
CarForGisEnum
.
DL
.
getNameKey
().
equals
(
index
.
getNameKey
())).
collect
(
Collectors
.
toList
()).
size
())
{
CarIndexGisVo
indexGisVo
=
new
CarIndexGisVo
();
indexGisVo
.
setId
(
id
);
indexGisVo
.
setIotCode
(
iotCode
);
indexGisVo
.
setNameKey
(
CarForGisEnum
.
DL
.
getNameKey
());
indexGisVo
.
setValue
(
staticMap
.
get
(
CarForGisEnum
.
DL
.
getNameKey
()).
toString
());
list
.
add
(
indexGisVo
);
}
if
(
0
==
list
.
stream
().
filter
(
index
->
CarForGisEnum
.
DDHX
.
getNameKey
().
equals
(
index
.
getNameKey
())).
collect
(
Collectors
.
toList
()).
size
())
{
CarIndexGisVo
indexGisVo
=
new
CarIndexGisVo
();
indexGisVo
.
setId
(
id
);
indexGisVo
.
setIotCode
(
iotCode
);
indexGisVo
.
setNameKey
(
CarForGisEnum
.
DDHX
.
getNameKey
());
indexGisVo
.
setValue
(
staticMap
.
get
(
CarForGisEnum
.
DDHX
.
getNameKey
()).
toString
());
list
.
add
(
indexGisVo
);
}
if
(
0
==
list
.
stream
().
filter
(
index
->
CarForGisEnum
.
SJ
.
getNameKey
().
equals
(
index
.
getNameKey
())).
collect
(
Collectors
.
toList
()).
size
())
{
CarIndexGisVo
indexGisVo
=
new
CarIndexGisVo
();
indexGisVo
.
setId
(
id
);
indexGisVo
.
setIotCode
(
iotCode
);
indexGisVo
.
setNameKey
(
CarForGisEnum
.
SJ
.
getNameKey
());
indexGisVo
.
setValue
(
staticMap
.
get
(
CarForGisEnum
.
SJ
.
getNameKey
()).
toString
());
list
.
add
(
indexGisVo
);
}
if
(
0
==
list
.
stream
().
filter
(
index
->
CarForGisEnum
.
QT
.
getNameKey
().
equals
(
index
.
getNameKey
())).
collect
(
Collectors
.
toList
()).
size
())
{
CarIndexGisVo
indexGisVo
=
new
CarIndexGisVo
();
indexGisVo
.
setId
(
id
);
indexGisVo
.
setIotCode
(
iotCode
);
indexGisVo
.
setNameKey
(
CarForGisEnum
.
QT
.
getNameKey
());
indexGisVo
.
setValue
(
staticMap
.
get
(
CarForGisEnum
.
QT
.
getNameKey
()).
toString
());
list
.
add
(
indexGisVo
);
}
}
else
{
CarIndexGisVo
gisVo1
=
new
CarIndexGisVo
();
gisVo1
.
setId
(
id
);
gisVo1
.
setIotCode
(
iotCode
);
gisVo1
.
setNameKey
(
CarForGisEnum
.
JD
.
getNameKey
());
gisVo1
.
setValue
(
staticMap
.
get
(
CarForGisEnum
.
JD
.
getNameKey
()).
toString
());
list
.
add
(
gisVo1
);
CarIndexGisVo
gisVo2
=
new
CarIndexGisVo
();
gisVo2
.
setId
(
id
);
gisVo2
.
setIotCode
(
iotCode
);
gisVo2
.
setNameKey
(
CarForGisEnum
.
WD
.
getNameKey
());
gisVo2
.
setValue
(
staticMap
.
get
(
CarForGisEnum
.
WD
.
getNameKey
()).
toString
());
list
.
add
(
gisVo2
);
CarIndexGisVo
gisVo3
=
new
CarIndexGisVo
();
gisVo3
.
setId
(
id
);
gisVo3
.
setIotCode
(
iotCode
);
gisVo3
.
setNameKey
(
CarForGisEnum
.
SD
.
getNameKey
());
gisVo3
.
setValue
(
staticMap
.
get
(
CarForGisEnum
.
SD
.
getNameKey
()).
toString
());
list
.
add
(
gisVo3
);
CarIndexGisVo
gisVo4
=
new
CarIndexGisVo
();
gisVo4
.
setId
(
id
);
gisVo4
.
setIotCode
(
iotCode
);
gisVo4
.
setNameKey
(
CarForGisEnum
.
DL
.
getNameKey
());
gisVo4
.
setValue
(
staticMap
.
get
(
CarForGisEnum
.
DL
.
getNameKey
()).
toString
());
list
.
add
(
gisVo4
);
CarIndexGisVo
gisVo5
=
new
CarIndexGisVo
();
gisVo5
.
setId
(
id
);
gisVo5
.
setIotCode
(
iotCode
);
gisVo5
.
setNameKey
(
CarForGisEnum
.
DDHX
.
getNameKey
());
gisVo5
.
setValue
(
staticMap
.
get
(
CarForGisEnum
.
DDHX
.
getNameKey
()).
toString
());
list
.
add
(
gisVo5
);
CarIndexGisVo
gisVo6
=
new
CarIndexGisVo
();
gisVo6
.
setId
(
id
);
gisVo6
.
setIotCode
(
iotCode
);
gisVo6
.
setNameKey
(
CarForGisEnum
.
SJ
.
getNameKey
());
gisVo6
.
setValue
(
staticMap
.
get
(
CarForGisEnum
.
SJ
.
getNameKey
()).
toString
());
list
.
add
(
gisVo6
);
CarIndexGisVo
gisVo7
=
new
CarIndexGisVo
();
gisVo7
.
setId
(
id
);
gisVo7
.
setIotCode
(
iotCode
);
gisVo7
.
setNameKey
(
CarForGisEnum
.
QT
.
getNameKey
());
gisVo7
.
setValue
(
staticMap
.
get
(
CarForGisEnum
.
QT
.
getNameKey
()).
toString
());
list
.
add
(
gisVo7
);
}
boolean
flag
=
ifSendToGis
(
list
);
if
(
flag
)
{
mqttSendGateway
.
sendToMqtt
(
carTopic
,
JSON
.
toJSONString
(
list
));
}
if
(
carList
.
size
()
>
0
)
{
boolean
updateBatchById
=
carPropertyService
.
updateBatchById
(
carList
);
if
(
updateBatchById
&&
syncSwitch
)
{
List
<
Long
>
carIds
=
new
ArrayList
<>();
carList
.
forEach
(
x
->
carIds
.
add
(
x
.
getCarId
()));
List
<
CarPropertyVo
>
propertyList
=
carPropertyService
.
getCarPropertyListByCarIds
(
carIds
);
List
<
CarPropertyVo
>
fireVehicleInfoList
=
propertyList
.
stream
().
filter
(
propertyVo
->
propertyVo
.
getIsIot
()
==
null
||
0
==
propertyVo
.
getIsIot
()).
collect
(
Collectors
.
toList
());
List
<
CarPropertyVo
>
fireVehicleMeasurementList
=
propertyList
.
stream
().
filter
(
propertyVo
->
propertyVo
.
getIsIot
()
!=
null
&&
1
==
propertyVo
.
getIsIot
()).
collect
(
Collectors
.
toList
());
syncDataService
.
syncCreatedFireVehicleInfo
(
fireVehicleInfoList
);
syncDataService
.
syncCreatedFireVehicleMeasurement
(
fireVehicleMeasurementList
);
}
}
}
});
//若为物联设备,则更新拓扑节点数据及告警状态
// if (!ObjectUtils.isEmpty(indexList)) {
// EquipmentVo equipmentVo = equipmentService.getEquipBySpecific(indexList.get(0).getEquipmentSpecificId());
// if (equipmentVo.getIsIot().equals("1")) {
// List<EquipmentSpecificAlarm> alarmList = equipmentSpecificAlarmService.getEquipListBySpecific(true, indexList.get(0).getEquipmentSpecificId());
// topographyService.updateNodeDateByEquipId(indexList.get(0).getEquipmentSpecificId(), indexList, alarmList);
// }
// }
}
static
void
upAlarmLogStatus
(
String
iotCode
,
String
equipmentSpecificIndexKey
,
IEquipmentSpecificAlarmLogService
equipmentSpecificAlarmLogService
)
{
static
void
upAlarmLogStatus
(
String
iotCode
,
String
equipmentSpecificIndexKey
,
IEquipmentSpecificAlarmLogService
equipmentSpecificAlarmLogService
)
{
LambdaQueryWrapper
<
EquipmentSpecificAlarmLog
>
queryWrapper
=
new
LambdaQueryWrapper
();
LambdaQueryWrapper
<
EquipmentSpecificAlarmLog
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
eq
(
EquipmentSpecificAlarmLog:
:
getIotCode
,
iotCode
);
queryWrapper
.
eq
(
EquipmentSpecificAlarmLog:
:
getIotCode
,
iotCode
);
...
@@ -1075,25 +630,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -1075,25 +630,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
}
}
return
flag
;
return
flag
;
}
}
public
void
realTimeDateProcessing
(
TopicEntityVo
topicEntity
,
List
<
IotDataVO
>
iotDatalist
){
String
iotCode
=
topicEntity
.
getIotCode
();
if
(
EquipAndCarEnum
.
equip
.
type
.
equals
(
topicEntity
.
getType
())){
List
<
EquipmentSpecificIndex
>
indexList
=
equipmentSpecificIndexService
.
getEquipmentSpeIndexBySpeIotCode
(
iotCode
);
if
(
ObjectUtils
.
isEmpty
(
indexList
)){
return
;
}
equipRealTimeDate
(
iotDatalist
,
indexList
,
topicEntity
);
}
else
{
List
<
CarProperty
>
carProperties
=
carPropertyService
.
getCarPropListByIotCode
(
iotCode
);
if
(
ObjectUtils
.
isEmpty
(
carProperties
)){
return
;
}
carRealTimeDate
(
iotDatalist
,
carProperties
);
}
}
/**
/**
* 装备实时数据处理
* 装备实时数据处理
...
@@ -1114,30 +651,30 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -1114,30 +651,30 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
&&
equipmentSpecificIndex
.
getNameKey
().
toLowerCase
().
equals
(
iotDataVO
.
getKey
().
toLowerCase
()))
{
&&
equipmentSpecificIndex
.
getNameKey
().
toLowerCase
().
equals
(
iotDataVO
.
getKey
().
toLowerCase
()))
{
EquipmentSpecificIndex
equipmentSpeIndex
=
new
EquipmentSpecificIndex
();
EquipmentSpecificIndex
equipmentSpeIndex
=
new
EquipmentSpecificIndex
();
BeanUtils
.
copyProperties
(
equipmentSpecificIndex
,
equipmentSpeIndex
);
BeanUtils
.
copyProperties
(
equipmentSpecificIndex
,
equipmentSpeIndex
);
String
value
=
iotDataVO
.
getValue
().
toString
();
String
value
=
iotDataVO
.
getValue
().
toString
();
equipmentSpeIndex
.
setValue
(
value
);
equipmentSpeIndex
.
setValue
(
value
);
equipmentSpeIndex
.
setValueLabel
(
valueTranslate
(
value
,
equipmentSpecificIndex
.
getValueEnum
()));
equipmentSpeIndex
.
setValueLabel
(
valueTranslate
(
value
,
equipmentSpecificIndex
.
getValueEnum
()));
equipmentSpeIndex
.
setUpdateDate
(
new
Date
());
equipmentSpeIndex
.
setUpdateDate
(
new
Date
());
equipmentSpecificIndexService
.
updateById
(
equipmentSpeIndex
);
equipmentSpecificIndexService
.
updateById
(
equipmentSpeIndex
);
equipmentSpecificIndexList
.
add
(
equipmentSpeIndex
);
equipmentSpecificIndexList
.
add
(
equipmentSpeIndex
);
indexStateList
.
add
(
createIndexStateVo
(
equipmentSpeIndex
));
indexStateList
.
add
(
createIndexStateVo
(
equipmentSpeIndex
));
// 向预控系统发送消息
// 向预控系统发送消息
sendEquipSpecIndexToAutosysTopic
(
equipmentSpeIndex
);
sendEquipSpecIndexToAutosysTopic
(
equipmentSpeIndex
);
// 添加指标报告
// 添加指标报告
saveEquipmentAlarmReportDay
(
equipmentSpeIndex
);
saveEquipmentAlarmReportDay
(
equipmentSpeIndex
);
//火眼数据构造告警指标逻辑
//火眼数据构造告警指标逻辑
equipmentSpecificIndex
=
handleTemperatureAlarm
(
equipmentSpeIndex
,
iotDatalist
);
equipmentSpecificIndex
=
handleTemperatureAlarm
(
equipmentSpeIndex
,
iotDatalist
);
//指标告警处理
//指标告警处理
if
(
equipmentSpecificIndex
.
getIsAlarm
()
!=
null
&&
1
==
equipmentSpecificIndex
.
getIsAlarm
()){
if
(
equipmentSpecificIndex
.
getIsAlarm
()
!=
null
&&
1
==
equipmentSpecificIndex
.
getIsAlarm
()){
equipmentSpecificAlarms
.
addAll
(
createIndexAlarmRecord
(
equipmentSpecificIndex
));
equipmentSpecificAlarms
.
addAll
(
createIndexAlarmRecord
(
equipmentSpecificIndex
));
}
}
}
}
}
}
...
@@ -1157,6 +694,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -1157,6 +694,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
// 报警数据保存
// 报警数据保存
saveOrUpdateEquipAlarm
(
equipmentSpecificAlarms
);
saveOrUpdateEquipAlarm
(
equipmentSpecificAlarms
);
//则更新拓扑节点数据及告警状态
updateNodeDateByEquipId
(
equipmentSpecificIndexList
);
}
}
...
@@ -1527,6 +1067,18 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -1527,6 +1067,18 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
return
list
;
return
list
;
}
}
/**
* //若为物联设备,则更新拓扑节点数据及告警状态
* @param indexList
*/
public
void
updateNodeDateByEquipId
(
List
<
EquipmentSpecificIndex
>
indexList
){
if
(!
ObjectUtils
.
isEmpty
(
indexList
))
{
EquipmentVo
equipmentVo
=
equipmentService
.
getEquipBySpecific
(
indexList
.
get
(
0
).
getEquipmentSpecificId
());
if
(
equipmentVo
.
getIsIot
().
equals
(
"1"
))
{
List
<
EquipmentSpecificAlarm
>
alarmList
=
equipmentSpecificAlarmService
.
getEquipListBySpecific
(
true
,
indexList
.
get
(
0
).
getEquipmentSpecificId
());
topographyService
.
updateNodeDateByEquipId
(
indexList
.
get
(
0
).
getEquipmentSpecificId
(),
indexList
,
alarmList
);
}
}
}
}
}
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