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
85a2e835
Commit
85a2e835
authored
May 17, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改消息组件
parent
3fee1173
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
...als/xhx/module/device/service/impl/DeviceServiceImpl.java
+3
-2
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
...a/com/mortals/xhx/module/device/web/DeviceController.java
+1
-1
No files found.
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
View file @
85a2e835
...
@@ -87,10 +87,9 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
...
@@ -87,10 +87,9 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
@Override
@Override
protected
void
saveAfter
(
DeviceEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
saveAfter
(
DeviceEntity
entity
,
Context
context
)
throws
AppException
{
PlatformEntity
platformEntity
=
platformService
.
get
(
entity
.
getPlatformId
());
PlatformEntity
platformEntity
=
platformService
.
get
(
entity
.
getPlatformId
());
ProductEntity
productEntity
=
productService
.
get
(
entity
.
getProductId
());
ProductEntity
productEntity
=
productService
.
get
(
entity
.
getProductId
());
if
(!
ObjectUtils
.
isEmpty
(
platformEntity
)
&&
ObjectUtils
.
isEmpty
(
productEntity
))
{
if
(!
ObjectUtils
.
isEmpty
(
platformEntity
)
&&
!
ObjectUtils
.
isEmpty
(
productEntity
))
{
//注册rabbmit相关队列与绑定
//注册rabbmit相关队列与绑定
String
exchangeName
=
platformEntity
.
getPlatformSn
()
+
Constant
.
EXCHANGE_SPLIT
+
productEntity
.
getProductCode
();
String
exchangeName
=
platformEntity
.
getPlatformSn
()
+
Constant
.
EXCHANGE_SPLIT
+
productEntity
.
getProductCode
();
TopicPartitionInfo
info
=
TopicPartitionInfo
.
builder
().
exchangeName
(
exchangeName
).
topic
(
Constant
.
UPLOAD_TOPIC
+
entity
.
getDeviceCode
()).
build
();
TopicPartitionInfo
info
=
TopicPartitionInfo
.
builder
().
exchangeName
(
exchangeName
).
topic
(
Constant
.
UPLOAD_TOPIC
+
entity
.
getDeviceCode
()).
build
();
...
@@ -114,6 +113,8 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
...
@@ -114,6 +113,8 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
//创建下行队列
//创建下行队列
info
=
TopicPartitionInfo
.
builder
().
exchangeName
(
exchangeName
).
topic
(
Constant
.
DOWN_TOPIC
+
entity
.
getDeviceCode
()).
build
();
info
=
TopicPartitionInfo
.
builder
().
exchangeName
(
exchangeName
).
topic
(
Constant
.
DOWN_TOPIC
+
entity
.
getDeviceCode
()).
build
();
messageService
.
queueDeclare
(
info
,
callback
);
messageService
.
queueDeclare
(
info
,
callback
);
}
else
{
throw
new
AppException
(
"产品或平台不存在!"
);
}
}
...
...
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
View file @
85a2e835
...
@@ -135,7 +135,7 @@ public class DeviceController extends BaseCRUDJsonMappingController<DeviceServic
...
@@ -135,7 +135,7 @@ public class DeviceController extends BaseCRUDJsonMappingController<DeviceServic
throw
new
AppException
(
"当前设备未配置所属产品,请在后台配置后再激活!"
);
throw
new
AppException
(
"当前设备未配置所属产品,请在后台配置后再激活!"
);
}
}
String
exchangeName
=
platformEntity
.
getPlatformSn
()
+
Constant
.
EXCHANGE_SPLIT
+
productEntity
.
getProductCode
();
String
exchangeName
=
platformEntity
.
getPlatformSn
()
+
Constant
.
EXCHANGE_SPLIT
+
productEntity
.
getProductCode
();
TopicPartitionInfo
info
=
TopicPartitionInfo
.
builder
().
exchangeName
(
exchangeName
).
topic
(
Constant
.
DOWN_TOPIC
+
deviceEntity
.
getDevice
Mac
()).
build
();
TopicPartitionInfo
info
=
TopicPartitionInfo
.
builder
().
exchangeName
(
exchangeName
).
topic
(
Constant
.
DOWN_TOPIC
+
deviceEntity
.
getDevice
Code
()).
build
();
TbQueueMsgHeaders
header
=
new
DefaultTbQueueMsgHeaders
();
TbQueueMsgHeaders
header
=
new
DefaultTbQueueMsgHeaders
();
header
.
put
(
MessageHeader
.
MESSAGETYPE
,
Constant
.
MESSAGETYPE_UPGREAD
);
header
.
put
(
MessageHeader
.
MESSAGETYPE
,
Constant
.
MESSAGETYPE_UPGREAD
);
JSONObject
obj
=
new
JSONObject
();
JSONObject
obj
=
new
JSONObject
();
...
...
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