Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
device-new-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
device-new-platform
Commits
79cf29e2
Commit
79cf29e2
authored
May 07, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加告警统计信息
parent
fa751a60
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
device-manager/src/main/java/com/mortals/xhx/common/utils/DownMsgTask.java
...c/main/java/com/mortals/xhx/common/utils/DownMsgTask.java
+10
-3
No files found.
device-manager/src/main/java/com/mortals/xhx/common/utils/DownMsgTask.java
View file @
79cf29e2
...
...
@@ -54,7 +54,14 @@ public class DownMsgTask implements Runnable {
for
(
List
<
DeviceMsgReq
>
deviceMsgReqs
:
partition
)
{
for
(
DeviceMsgReq
item
:
deviceMsgReqs
)
{
//根据设备编码查询设备
DeviceEntity
deviceEntity
=
deviceService
.
getExtCache
(
item
.
getDeviceCode
());
DeviceEntity
deviceEntity
=
null
;
try
{
deviceEntity
=
deviceService
.
getExtCache
(
item
.
getDeviceCode
());
}
catch
(
Exception
e
)
{
log
.
info
(
"deviceCode:{}"
,
item
.
getDeviceCode
());
log
.
error
(
"redis 获取设备异常!"
,
e
);
continue
;
}
if
(!
ObjectUtils
.
isEmpty
(
deviceEntity
))
{
TbQueueMsgHeaders
header
=
new
DefaultTbQueueMsgHeaders
();
header
.
put
(
MessageHeader
.
MESSAGETYPE
,
item
.
getMessageType
());
...
...
@@ -62,7 +69,7 @@ public class DownMsgTask implements Runnable {
header
.
put
(
MessageHeader
.
TIMESTAMP
,
item
.
getTimestamp
().
toString
());
TbQueueMsg
queueMsg
=
new
DefaultTbQueueMsg
(
IdUtil
.
fastUUID
(),
item
.
getData
(),
header
);
messageProducer
.
sendMsg
(
QueueKey
.
DEFAULT_EXCHANGE
,
Constant
.
DOWN_TOPIC
+
deviceEntity
.
getDeviceCode
(),
JSON
.
toJSONString
(
queueMsg
));
messageProducer
.
sendMsg
(
QueueKey
.
DEFAULT_EXCHANGE
,
Constant
.
DOWN_TOPIC
+
deviceEntity
.
getDeviceCode
(),
JSON
.
toJSONString
(
queueMsg
));
DeviceLogEntity
deviceLogEntity
=
new
DeviceLogEntity
();
deviceLogEntity
.
initAttrValue
();
...
...
@@ -76,7 +83,7 @@ public class DownMsgTask implements Runnable {
deviceLogEntity
.
setLogType
(
LogTypeEnum
.
下发服务
.
getValue
());
deviceLogEntity
.
setCreateUserId
(
1L
);
deviceLogEntity
.
setCreateTime
(
new
Date
());
deviceLogService
.
save
(
deviceLogEntity
,
null
);
deviceLogService
.
save
(
deviceLogEntity
,
null
);
}
else
{
log
.
info
(
"未找到设备,deviceCode:{}"
,
item
.
getDeviceCode
());
}
...
...
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