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
d7963502
Commit
d7963502
authored
Dec 16, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分组更新设备
parent
56e31553
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
device-manager/src/main/java/com/mortals/xhx/base/framework/listener/DirectDynamicListener.java
...ls/xhx/base/framework/listener/DirectDynamicListener.java
+6
-7
No files found.
device-manager/src/main/java/com/mortals/xhx/base/framework/listener/DirectDynamicListener.java
View file @
d7963502
...
@@ -7,11 +7,12 @@ import com.mortals.framework.ap.GlobalSysInfo;
...
@@ -7,11 +7,12 @@ import com.mortals.framework.ap.GlobalSysInfo;
import
com.mortals.framework.model.BizLogPdu
;
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.service.IMessageProduceService
;
import
com.mortals.xhx.common.code.*
;
import
com.mortals.xhx.common.code.DeviceMethodEnum
;
import
com.mortals.xhx.common.code.DeviceStatusEnum
;
import
com.mortals.xhx.common.code.LogTypeEnum
;
import
com.mortals.xhx.common.key.Constant
;
import
com.mortals.xhx.common.key.Constant
;
import
com.mortals.xhx.common.key.RedisKey
;
import
com.mortals.xhx.common.key.RedisKey
;
import
com.mortals.xhx.common.pdu.DefaultQueueMsg
;
import
com.mortals.xhx.common.pdu.DefaultQueueMsg
;
import
com.mortals.xhx.common.utils.SendTask
;
import
com.mortals.xhx.common.utils.SendTaskThreadPool
;
import
com.mortals.xhx.common.utils.SendTaskThreadPool
;
import
com.mortals.xhx.module.device.model.DeviceEntity
;
import
com.mortals.xhx.module.device.model.DeviceEntity
;
import
com.mortals.xhx.module.device.model.DeviceLogEntity
;
import
com.mortals.xhx.module.device.model.DeviceLogEntity
;
...
@@ -30,7 +31,6 @@ import org.springframework.util.ObjectUtils;
...
@@ -30,7 +31,6 @@ import org.springframework.util.ObjectUtils;
import
java.util.Date
;
import
java.util.Date
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
Constant
.
PARAM_SERVER_PHP_IN_HTTP_URL
;
import
static
com
.
mortals
.
xhx
.
common
.
model
.
MessageHeader
.
DEVICECODE
;
import
static
com
.
mortals
.
xhx
.
common
.
model
.
MessageHeader
.
DEVICECODE
;
import
static
com
.
mortals
.
xhx
.
common
.
model
.
MessageHeader
.
MESSAGETYPE
;
import
static
com
.
mortals
.
xhx
.
common
.
model
.
MessageHeader
.
MESSAGETYPE
;
...
@@ -78,7 +78,7 @@ public class DirectDynamicListener implements MessageListener {
...
@@ -78,7 +78,7 @@ public class DirectDynamicListener implements MessageListener {
DeviceEntity
deviceEntity
=
deviceService
.
getExtCache
(
deviceCode
);
DeviceEntity
deviceEntity
=
deviceService
.
getExtCache
(
deviceCode
);
if
(!
ObjectUtils
.
isEmpty
(
deviceEntity
))
{
if
(!
ObjectUtils
.
isEmpty
(
deviceEntity
))
{
cacheService
.
set
(
RedisKey
.
KEY_DEVICE_ONLINE_CACHE
+
deviceEntity
.
getDeviceCode
(),
""
,
GlobalSysInfo
.
getParamIntValue
(
Constant
.
HEARTBEAT_TIMEOUT
,
1
2
0
));
cacheService
.
set
(
RedisKey
.
KEY_DEVICE_ONLINE_CACHE
+
deviceEntity
.
getDeviceCode
(),
""
,
GlobalSysInfo
.
getParamIntValue
(
Constant
.
HEARTBEAT_TIMEOUT
,
1
8
0
));
if
(
deviceEntity
.
getDeviceStatus
()
==
DeviceStatusEnum
.
离线
.
getValue
())
{
if
(
deviceEntity
.
getDeviceStatus
()
==
DeviceStatusEnum
.
离线
.
getValue
())
{
deviceEntity
.
setOnlineTime
(
new
Date
());
deviceEntity
.
setOnlineTime
(
new
Date
());
deviceEntity
.
setDeviceStatus
(
DeviceStatusEnum
.
在线
.
getValue
());
deviceEntity
.
setDeviceStatus
(
DeviceStatusEnum
.
在线
.
getValue
());
...
@@ -96,7 +96,6 @@ public class DirectDynamicListener implements MessageListener {
...
@@ -96,7 +96,6 @@ public class DirectDynamicListener implements MessageListener {
PlatformEntity
platformEntity
=
platformService
.
getCache
(
deviceEntity
.
getPlatformId
().
toString
());
PlatformEntity
platformEntity
=
platformService
.
getCache
(
deviceEntity
.
getPlatformId
().
toString
());
ProductEntity
productEntity
=
productService
.
get
(
deviceEntity
.
getProductId
());
ProductEntity
productEntity
=
productService
.
get
(
deviceEntity
.
getProductId
());
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
bizLogPdu
=
new
BizLogPdu
();
...
@@ -130,7 +129,7 @@ public class DirectDynamicListener implements MessageListener {
...
@@ -130,7 +129,7 @@ public class DirectDynamicListener implements MessageListener {
deviceLogEntity
.
setCreateTime
(
new
Date
());
deviceLogEntity
.
setCreateTime
(
new
Date
());
deviceLogService
.
save
(
deviceLogEntity
);
deviceLogService
.
save
(
deviceLogEntity
);
}
}
//获取exchange,
/*
//获取exchange,
PlatformEntity platformEntity = platformService.getCache(deviceEntity.getPlatformId().toString());
PlatformEntity platformEntity = platformService.getCache(deviceEntity.getPlatformId().toString());
String phpInUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_IN_HTTP_URL, "http://172.15.28.116:8090");
String phpInUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_IN_HTTP_URL, "http://172.15.28.116:8090");
...
@@ -141,7 +140,7 @@ public class DirectDynamicListener implements MessageListener {
...
@@ -141,7 +140,7 @@ public class DirectDynamicListener implements MessageListener {
SendTask sendTask = new SendTask(phpInUrl, queueMsg.getData());
SendTask sendTask = new SendTask(phpInUrl, queueMsg.getData());
sendTaskThreadPool.execute(sendTask);
sendTaskThreadPool.execute(sendTask);
}
}
}
}
*/
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"消费消息异常"
,
e
);
log
.
error
(
"消费消息异常"
,
e
);
...
...
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