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
aa35d171
Commit
aa35d171
authored
Sep 28, 2022
by
limei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_dl_plan6' of
http://39.98.45.134:8090/moa/amos-boot-biz
into develop_dl_plan6
parents
d47b3bf7
c61b6183
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
47 deletions
+47
-47
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+47
-47
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 @
aa35d171
...
@@ -418,56 +418,56 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -418,56 +418,56 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
queryWrapper
.
ne
(
EquipmentSpecificAlarmLog:
:
getStatus
,
AlarmStatusEnum
.
HF
.
getCode
());
queryWrapper
.
ne
(
EquipmentSpecificAlarmLog:
:
getStatus
,
AlarmStatusEnum
.
HF
.
getCode
());
List
<
EquipmentSpecificAlarmLog
>
logs
=
equipmentSpecificAlarmLogService
.
getBaseMapper
()
List
<
EquipmentSpecificAlarmLog
>
logs
=
equipmentSpecificAlarmLogService
.
getBaseMapper
()
.
selectList
(
queryWrapper
);
.
selectList
(
queryWrapper
);
EquipmentSpecificAlarmLog
log
=
logs
.
get
(
0
);
if
(
0
<
logs
.
size
())
{
String
cleanType
=
equipmentSpecificMapper
.
getEquipmentBySpecificId
(
log
.
getEquipmentSpecificId
());
EquipmentSpecificAlarmLog
log
=
logs
.
get
(
0
);
EquipmentSpecific
specific
=
equipmentSpecificMapper
.
selectById
(
log
.
getEquipmentSpecificId
());
String
cleanType
=
equipmentSpecificMapper
.
getEquipmentBySpecificId
(
log
.
getEquipmentSpecificId
());
Date
date
=
new
Date
();
EquipmentSpecific
specific
=
equipmentSpecificMapper
.
selectById
(
log
.
getEquipmentSpecificId
());
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
Date
date
=
new
Date
();
String
dateString
=
formatter
.
format
(
date
);
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
logs
.
forEach
(
x
->
{
String
dateString
=
formatter
.
format
(
date
);
x
.
setCleanTime
(
new
Date
());
logs
.
forEach
(
x
->
{
x
.
setStatus
(
AlarmStatusEnum
.
HF
.
getCode
());
x
.
setCleanTime
(
new
Date
());
x
.
setEquipmentSpecificIndexValue
(
TrueOrFalseEnum
.
fake
.
value
);
x
.
setStatus
(
AlarmStatusEnum
.
HF
.
getCode
());
if
(!
StringUtils
.
isEmpty
(
traceId
))
{
x
.
setEquipmentSpecificIndexValue
(
TrueOrFalseEnum
.
fake
.
value
);
x
.
setTraceId
(
traceId
);
if
(!
StringUtils
.
isEmpty
(
traceId
))
{
}
x
.
setTraceId
(
traceId
);
// 自动确警处理
if
(
StringUtil
.
isNotEmpty
(
cleanType
)
&&
AlarmCleanTypeEnum
.
ZDXC
.
getCode
().
equals
(
cleanType
)){
x
.
setConfirmType
(
x
.
getType
());
x
.
setConfirmTypeName
(
ConfirmAlamEnum
.
getTypeByCode
(
x
.
getType
()));
String
equipmentName
=
StringUtil
.
isNotEmpty
(
specific
.
getCode
())
?
specific
.
getName
()
+
"("
+
specific
.
getCode
()
+
")"
:
specific
.
getName
();
if
(
x
.
getType
().
equals
(
AlarmTypeEnum
.
PB
.
getCode
()))
{
x
.
setAlarmReason
(
equipmentName
+
"频繁故障/误报,将设备报警信息屏蔽。"
);
}
else
{
x
.
setAlarmReason
(
equipmentName
+
"引起设备报警"
);
}
}
x
.
setResolveResult
(
dateString
+
"系统收到设备复归(已消除)信号,系统自动处理。"
);
// 自动确警处理
x
.
setConfirmUser
(
""
);
if
(
StringUtil
.
isNotEmpty
(
cleanType
)
&&
AlarmCleanTypeEnum
.
ZDXC
.
getCode
().
equals
(
cleanType
)){
x
.
setConfirmUserName
(
"系统自动处理"
);
x
.
setConfirmType
(
x
.
getType
());
x
.
setConfirmDate
(
date
);
x
.
setConfirmTypeName
(
ConfirmAlamEnum
.
getTypeByCode
(
x
.
getType
()));
}
String
equipmentName
=
StringUtil
.
isNotEmpty
(
specific
.
getCode
())
?
specific
.
getName
()
+
"("
+
specific
.
getCode
()
+
")"
:
specific
.
getName
();
});
if
(
x
.
getType
().
equals
(
AlarmTypeEnum
.
PB
.
getCode
()))
{
if
(
jcsSwitch
&&
AlarmTypeEnum
.
HZGJ
.
getCode
().
equals
(
log
.
getType
()))
{
x
.
setAlarmReason
(
equipmentName
+
"频繁故障/误报,将设备报警信息屏蔽。"
);
Token
token
=
remoteSecurityService
.
getServerToken
();
}
else
{
String
toke
=
token
.
getToke
();
x
.
setAlarmReason
(
equipmentName
+
"引起设备报警"
);
String
appKey
=
token
.
getAppKey
();
String
product
=
token
.
getProduct
();
String
userId
=
remoteSecurityService
.
getAgencyUser
().
getUserId
();
// 确警消息发送
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
userId
))
{
new
Thread
(
new
Runnable
()
{
@Override
public
void
run
()
{
try
{
ConfirmAlarmServiceImpl
.
sendIotSystemAlarm
(
log
,
userId
,
appKey
,
product
,
toke
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
}).
start
();
x
.
setResolveResult
(
dateString
+
"系统收到设备复归(已消除)信号,系统自动处理。"
);
x
.
setConfirmUser
(
""
);
x
.
setConfirmUserName
(
"系统自动处理"
);
x
.
setConfirmDate
(
date
);
}
});
if
(
jcsSwitch
&&
AlarmTypeEnum
.
HZGJ
.
getCode
().
equals
(
log
.
getType
()))
{
Token
token
=
remoteSecurityService
.
getServerToken
();
String
toke
=
token
.
getToke
();
String
appKey
=
token
.
getAppKey
();
String
product
=
token
.
getProduct
();
String
userId
=
remoteSecurityService
.
getAgencyUser
().
getUserId
();
// 确警消息发送
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
userId
))
{
new
Thread
(
new
Runnable
()
{
@Override
public
void
run
()
{
try
{
ConfirmAlarmServiceImpl
.
sendIotSystemAlarm
(
log
,
userId
,
appKey
,
product
,
toke
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}).
start
();
}
}
}
}
if
(!
logs
.
isEmpty
())
{
equipmentSpecificAlarmLogService
.
updateBatchById
(
logs
);
equipmentSpecificAlarmLogService
.
updateBatchById
(
logs
);
}
}
if
(
flag
)
{
if
(
flag
)
{
...
...
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