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
dd5a553f
Commit
dd5a553f
authored
Jun 19, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加设备上线和下线的业务日志记录
parent
266f2b47
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
+23
-2
device-manager/src/main/java/com/mortals/xhx/base/framework/listener/DirectDynamicListener.java
...ls/xhx/base/framework/listener/DirectDynamicListener.java
+1
-1
device-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/DeviceMsgComsumerStartedService.java
...n/applicationservice/DeviceMsgComsumerStartedService.java
+21
-0
device-manager/src/main/java/com/mortals/xhx/daemon/task/DeviceStatTaskImpl.java
.../java/com/mortals/xhx/daemon/task/DeviceStatTaskImpl.java
+1
-1
No files found.
device-manager/src/main/java/com/mortals/xhx/base/framework/listener/DirectDynamicListener.java
View file @
dd5a553f
...
@@ -99,7 +99,7 @@ public class DirectDynamicListener implements MessageListener {
...
@@ -99,7 +99,7 @@ public class DirectDynamicListener implements MessageListener {
BizLogPdu
bizLogPdu
=
new
BizLogPdu
();
BizLogPdu
bizLogPdu
=
new
BizLogPdu
();
bizLogPdu
.
initAttrValue
();
bizLogPdu
.
initAttrValue
();
//保存为产品名称
//保存为产品名称
bizLogPdu
.
setAppName
(
productEntity
.
getProduct
Nam
e
());
bizLogPdu
.
setAppName
(
productEntity
.
getProduct
Cod
e
());
bizLogPdu
.
setTraceID
(
IdUtil
.
objectId
());
bizLogPdu
.
setTraceID
(
IdUtil
.
objectId
());
bizLogPdu
.
setUserCode
(
"system"
);
bizLogPdu
.
setUserCode
(
"system"
);
bizLogPdu
.
setDeviceCode
(
deviceEntity
.
getDeviceCode
());
bizLogPdu
.
setDeviceCode
(
deviceEntity
.
getDeviceCode
());
...
...
device-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/DeviceMsgComsumerStartedService.java
View file @
dd5a553f
...
@@ -3,7 +3,9 @@ package com.mortals.xhx.daemon.applicationservice;
...
@@ -3,7 +3,9 @@ package com.mortals.xhx.daemon.applicationservice;
import
cn.hutool.core.util.IdUtil
;
import
cn.hutool.core.util.IdUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.mortals.framework.ap.GlobalSysInfo
;
import
com.mortals.framework.ap.GlobalSysInfo
;
import
com.mortals.framework.model.BizLogPdu
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.framework.service.IMessageProduceService
;
import
com.mortals.framework.springcloud.service.IApplicationStartedService
;
import
com.mortals.framework.springcloud.service.IApplicationStartedService
;
import
com.mortals.xhx.common.code.*
;
import
com.mortals.xhx.common.code.*
;
import
com.mortals.xhx.common.key.Constant
;
import
com.mortals.xhx.common.key.Constant
;
...
@@ -56,6 +58,9 @@ public class DeviceMsgComsumerStartedService implements IApplicationStartedServi
...
@@ -56,6 +58,9 @@ public class DeviceMsgComsumerStartedService implements IApplicationStartedServi
private
SendTaskThreadPool
sendTaskThreadPool
;
private
SendTaskThreadPool
sendTaskThreadPool
;
@Autowired
@Autowired
private
ICacheService
cacheService
;
private
ICacheService
cacheService
;
@Autowired
private
IMessageProduceService
messageProducer
;
protected
volatile
ExecutorService
consumersExecutor
;
protected
volatile
ExecutorService
consumersExecutor
;
...
@@ -174,6 +179,22 @@ public class DeviceMsgComsumerStartedService implements IApplicationStartedServi
...
@@ -174,6 +179,22 @@ public class DeviceMsgComsumerStartedService implements IApplicationStartedServi
if
(!
ObjectUtils
.
isEmpty
(
platformEntity
)
&&
!
ObjectUtils
.
isEmpty
(
productEntity
))
{
if
(!
ObjectUtils
.
isEmpty
(
platformEntity
)
&&
!
ObjectUtils
.
isEmpty
(
productEntity
))
{
//新增设备通知第三方平台
//新增设备通知第三方平台
deviceService
.
sendThirdParty
(
deviceEntity
,
productEntity
,
platformEntity
,
DeviceMethodEnum
.
ONLINE
);
deviceService
.
sendThirdParty
(
deviceEntity
,
productEntity
,
platformEntity
,
DeviceMethodEnum
.
ONLINE
);
//保存业务消息为离线
BizLogPdu
bizLogPdu
=
new
BizLogPdu
();
bizLogPdu
.
initAttrValue
();
//保存为产品名称
bizLogPdu
.
setAppName
(
productEntity
.
getProductCode
());
bizLogPdu
.
setTraceID
(
IdUtil
.
objectId
());
bizLogPdu
.
setUserCode
(
"system"
);
bizLogPdu
.
setDeviceCode
(
deviceEntity
.
getDeviceCode
());
bizLogPdu
.
setEventTopic
(
"online"
);
bizLogPdu
.
setEventTopicName
(
LogTypeEnum
.
上报事件
.
name
());
bizLogPdu
.
setMsg
(
"设备上线"
);
bizLogPdu
.
setLogLevel
(
"INFO"
);
bizLogPdu
.
setLogTime
(
new
Date
());
messageProducer
.
syncBizSend
(
bizLogPdu
);
}
}
}
}
if
(!
Constant
.
MESSAGETYPE_HEARTBEAT
.
equalsIgnoreCase
(
messageType
))
{
if
(!
Constant
.
MESSAGETYPE_HEARTBEAT
.
equalsIgnoreCase
(
messageType
))
{
...
...
device-manager/src/main/java/com/mortals/xhx/daemon/task/DeviceStatTaskImpl.java
View file @
dd5a553f
...
@@ -91,7 +91,7 @@ public class DeviceStatTaskImpl implements ITaskExcuteService {
...
@@ -91,7 +91,7 @@ public class DeviceStatTaskImpl implements ITaskExcuteService {
BizLogPdu
bizLogPdu
=
new
BizLogPdu
();
BizLogPdu
bizLogPdu
=
new
BizLogPdu
();
bizLogPdu
.
initAttrValue
();
bizLogPdu
.
initAttrValue
();
//保存为产品名称
//保存为产品名称
bizLogPdu
.
setAppName
(
productEntity
.
getProduct
Nam
e
());
bizLogPdu
.
setAppName
(
productEntity
.
getProduct
Cod
e
());
bizLogPdu
.
setTraceID
(
IdUtil
.
objectId
());
bizLogPdu
.
setTraceID
(
IdUtil
.
objectId
());
bizLogPdu
.
setUserCode
(
"system"
);
bizLogPdu
.
setUserCode
(
"system"
);
bizLogPdu
.
setDeviceCode
(
deviceEntity
.
getDeviceCode
());
bizLogPdu
.
setDeviceCode
(
deviceEntity
.
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