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
8d99ed85
Commit
8d99ed85
authored
Mar 18, 2025
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加下发日志
parent
a5cd203a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
4 deletions
+34
-4
device-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/DeviceComsumersRegisterService.java
...on/applicationservice/DeviceComsumersRegisterService.java
+0
-3
device-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/DeviceDownMsgService.java
...s/xhx/daemon/applicationservice/DeviceDownMsgService.java
+3
-1
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
...als/xhx/module/device/service/impl/DeviceServiceImpl.java
+31
-0
No files found.
device-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/DeviceComsumersRegisterService.java
View file @
8d99ed85
...
@@ -11,7 +11,6 @@ import com.mortals.xhx.module.device.model.DeviceEntity;
...
@@ -11,7 +11,6 @@ import com.mortals.xhx.module.device.model.DeviceEntity;
import
com.mortals.xhx.module.device.service.DeviceService
;
import
com.mortals.xhx.module.device.service.DeviceService
;
import
com.mortals.xhx.module.platform.service.PlatformService
;
import
com.mortals.xhx.module.platform.service.PlatformService
;
import
com.mortals.xhx.module.product.service.ProductService
;
import
com.mortals.xhx.module.product.service.ProductService
;
import
com.mortals.xhx.thread.DeviceDownMsgThread
;
import
com.mortals.xhx.thread.DeviceUpdateComsumerThread
;
import
com.mortals.xhx.thread.DeviceUpdateComsumerThread
;
import
com.mortals.xhx.thread.SendThirdPartyThread
;
import
com.mortals.xhx.thread.SendThirdPartyThread
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -51,8 +50,6 @@ public class DeviceComsumersRegisterService implements IApplicationStartedServic
...
@@ -51,8 +50,6 @@ public class DeviceComsumersRegisterService implements IApplicationStartedServic
private
DeviceUpdateComsumerThread
deviceUpdateComsumerThread
;
private
DeviceUpdateComsumerThread
deviceUpdateComsumerThread
;
@Autowired
@Autowired
private
SendThirdPartyThread
sendThirdPartyThread
;
private
SendThirdPartyThread
sendThirdPartyThread
;
@Autowired
private
DeviceDownMsgThread
deviceDownMsgThread
;
@Value
(
"${deviceUpdateComsumerIp:}"
)
@Value
(
"${deviceUpdateComsumerIp:}"
)
public
String
deviceUpdateComsumerIp
;
public
String
deviceUpdateComsumerIp
;
...
...
device-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/DeviceDownMsgService.java
View file @
8d99ed85
...
@@ -81,6 +81,9 @@ public class DeviceDownMsgService implements IApplicationStartedService {
...
@@ -81,6 +81,9 @@ public class DeviceDownMsgService implements IApplicationStartedService {
TbQueueMsg
queueMsg
=
new
DefaultTbQueueMsg
(
IdUtil
.
fastUUID
(),
deviceMsgReq
.
getData
(),
header
);
TbQueueMsg
queueMsg
=
new
DefaultTbQueueMsg
(
IdUtil
.
fastUUID
(),
deviceMsgReq
.
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
deviceLogEntity
=
new
DeviceLogEntity
();
deviceLogEntity
.
initAttrValue
();
deviceLogEntity
.
initAttrValue
();
deviceLogEntity
.
setTraceID
(
IdUtil
.
fastSimpleUUID
());
deviceLogEntity
.
setTraceID
(
IdUtil
.
fastSimpleUUID
());
...
@@ -118,7 +121,6 @@ public class DeviceDownMsgService implements IApplicationStartedService {
...
@@ -118,7 +121,6 @@ public class DeviceDownMsgService implements IApplicationStartedService {
ThreadPool
.
getInstance
().
execute
(
sendThread
);
ThreadPool
.
getInstance
().
execute
(
sendThread
);
// sendThread.start();
}
}
@Override
@Override
...
...
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
View file @
8d99ed85
...
@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSON;
...
@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSON;
import
com.mortals.framework.ap.GlobalSysInfo
;
import
com.mortals.framework.ap.GlobalSysInfo
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.BizLogPdu
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.ErrorLogPdu
;
import
com.mortals.framework.model.ErrorLogPdu
;
import
com.mortals.framework.model.OrderCol
;
import
com.mortals.framework.model.OrderCol
;
...
@@ -742,6 +743,36 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
...
@@ -742,6 +743,36 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
correlationData
.
setId
(
deviceEntity
.
getDeviceCode
());
correlationData
.
setId
(
deviceEntity
.
getDeviceCode
());
log
.
info
(
"send rabbitmq msg:{}"
,
item
.
getDeviceCode
());
log
.
info
(
"send rabbitmq msg:{}"
,
item
.
getDeviceCode
());
messageProducer
.
sendMsg
(
QueueKey
.
DEFAULT_EXCHANGE
,
Constant
.
DOWN_TOPIC
+
deviceEntity
.
getDeviceCode
(),
JSON
.
toJSONString
(
queueMsg
),
correlationData
);
messageProducer
.
sendMsg
(
QueueKey
.
DEFAULT_EXCHANGE
,
Constant
.
DOWN_TOPIC
+
deviceEntity
.
getDeviceCode
(),
JSON
.
toJSONString
(
queueMsg
),
correlationData
);
DeviceLogEntity
deviceLogEntity
=
new
DeviceLogEntity
();
deviceLogEntity
.
initAttrValue
();
deviceLogEntity
.
setTraceID
(
IdUtil
.
fastSimpleUUID
());
deviceLogEntity
.
setSiteId
(
deviceEntity
.
getSiteId
());
deviceLogEntity
.
setDeviceId
(
deviceEntity
.
getId
());
deviceLogEntity
.
setDeviceName
(
deviceEntity
.
getDeviceName
());
deviceLogEntity
.
setDeviceCode
(
deviceEntity
.
getDeviceCode
());
deviceLogEntity
.
setMessageHead
(
item
.
getMessageType
());
deviceLogEntity
.
setContent
(
item
.
getData
());
deviceLogEntity
.
setLogType
(
LogTypeEnum
.
下发服务
.
getValue
());
deviceLogEntity
.
setCreateUserId
(
1L
);
deviceLogEntity
.
setCreateTime
(
new
Date
());
deviceLogService
.
save
(
deviceLogEntity
,
null
);
//保存业务消息为离线
BizLogPdu
bizLogPdu
=
new
BizLogPdu
();
bizLogPdu
.
initAttrValue
();
//保存为产品名称
bizLogPdu
.
setAppName
(
deviceEntity
.
getProductCode
());
bizLogPdu
.
setTraceID
(
IdUtil
.
objectId
());
bizLogPdu
.
setUserCode
(
"system"
);
bizLogPdu
.
setDeviceCode
(
deviceEntity
.
getDeviceCode
());
bizLogPdu
.
setEventTopic
(
item
.
getMessageType
());
bizLogPdu
.
setEventTopicName
(
LogTypeEnum
.
下发服务
.
name
());
bizLogPdu
.
setMsg
(
item
.
getData
());
bizLogPdu
.
setLogLevel
(
"INFO"
);
bizLogPdu
.
setLogTime
(
new
Date
());
messageProducer
.
syncBizSend
(
bizLogPdu
);
}
else
{
}
else
{
log
.
info
(
"未找到设备,deviceCode:{}"
,
item
.
getDeviceCode
());
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