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
b441b439
Commit
b441b439
authored
Jul 20, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加开启与关闭消费队列
parent
139a89e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
17 deletions
+2
-17
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
...als/xhx/module/device/service/impl/DeviceServiceImpl.java
+2
-17
No files found.
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
View file @
b441b439
...
@@ -134,18 +134,6 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
...
@@ -134,18 +134,6 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
ApiResp
<
String
>
resp
=
new
ApiResp
<>();
ApiResp
<
String
>
resp
=
new
ApiResp
<>();
resp
.
setCode
(
ApiRespCodeEnum
.
SUCCESS
.
getValue
());
resp
.
setCode
(
ApiRespCodeEnum
.
SUCCESS
.
getValue
());
resp
.
setMsg
(
ApiRespCodeEnum
.
SUCCESS
.
getLabel
());
resp
.
setMsg
(
ApiRespCodeEnum
.
SUCCESS
.
getLabel
());
// TbQueueCallback callback = new TbQueueCallback() {
// @Override
// public void onSuccess(TbQueueMsgMetadata metadata) {
//
// log.info("消息投递成功,设备通道编码:" + deviceEntity.getDeviceMac());
// }
//
// @Override
// public void onFailure(Throwable t) {
// log.error("消息投递成功,设备通道编码:" + deviceEntity.getDeviceMac(), t);
// }
// };
messageService
.
send
(
info
,
header
,
message
,
callback
);
messageService
.
send
(
info
,
header
,
message
,
callback
);
return
resp
;
return
resp
;
}
}
...
@@ -169,7 +157,7 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
...
@@ -169,7 +157,7 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
if
(
deviceEntity
.
getDeviceStatus
()
!=
DeviceStatusEnum
.
未激活
.
getValue
())
throw
new
AppException
(
"当前设备已激活!"
);
if
(
deviceEntity
.
getDeviceStatus
()
!=
DeviceStatusEnum
.
未激活
.
getValue
())
throw
new
AppException
(
"当前设备已激活!"
);
deviceEntity
.
setDeviceStatus
(
DeviceStatusEnum
.
离线
.
getValue
());
deviceEntity
.
setDeviceStatus
(
DeviceStatusEnum
.
离线
.
getValue
());
deviceEntity
.
setEnabled
(
EnabledEnum
.
启用
.
getValue
());
deviceEntity
.
setEnabled
(
EnabledEnum
.
启用
.
getValue
());
this
.
update
(
deviceEntity
,
context
);
this
.
getDeviceDao
().
update
(
deviceEntity
);
PlatformEntity
platformEntity
=
platformService
.
get
(
deviceEntity
.
getPlatformId
());
PlatformEntity
platformEntity
=
platformService
.
get
(
deviceEntity
.
getPlatformId
());
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
))
{
...
@@ -196,10 +184,9 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
...
@@ -196,10 +184,9 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
deviceEntity
.
setEnabled
(
enabled
);
deviceEntity
.
setEnabled
(
enabled
);
deviceEntity
.
setUpdateTime
(
new
Date
());
deviceEntity
.
setUpdateTime
(
new
Date
());
deviceEntity
.
setUpdateUserId
(
getContextUserId
(
context
));
deviceEntity
.
setUpdateUserId
(
getContextUserId
(
context
));
this
.
update
(
deviceEntity
,
context
);
this
.
getDeviceDao
().
update
(
deviceEntity
);
ProductEntity
productEntity
=
productService
.
get
(
deviceEntity
.
getProductId
());
ProductEntity
productEntity
=
productService
.
get
(
deviceEntity
.
getProductId
());
PlatformEntity
platformEntity
=
platformService
.
get
(
deviceEntity
.
getPlatformId
());
PlatformEntity
platformEntity
=
platformService
.
get
(
deviceEntity
.
getPlatformId
());
if
(
enabled
==
YesNoEnum
.
YES
.
getValue
())
{
if
(
enabled
==
YesNoEnum
.
YES
.
getValue
())
{
this
.
sendThirdParty
(
deviceEntity
,
productEntity
,
platformEntity
,
DeviceMethodEnum
.
ENABLED
);
this
.
sendThirdParty
(
deviceEntity
,
productEntity
,
platformEntity
,
DeviceMethodEnum
.
ENABLED
);
}
else
{
}
else
{
...
@@ -236,8 +223,6 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
...
@@ -236,8 +223,6 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
if
(!
ObjectUtils
.
isEmpty
(
platformEntity
)
&&
!
ObjectUtils
.
isEmpty
(
productEntity
))
{
if
(!
ObjectUtils
.
isEmpty
(
platformEntity
)
&&
!
ObjectUtils
.
isEmpty
(
productEntity
))
{
//注册rabbmit相关队列与绑定
//注册rabbmit相关队列与绑定
registerRabbitQueue
(
entity
,
platformEntity
,
productEntity
);
registerRabbitQueue
(
entity
,
platformEntity
,
productEntity
);
//新增设备通知第三方平台
// sendThirdParty(entity, productEntity, platformEntity, DeviceMethodEnum.ADD);
}
else
{
}
else
{
throw
new
AppException
(
"产品或平台不存在!"
);
throw
new
AppException
(
"产品或平台不存在!"
);
}
}
...
...
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