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
079bcece
Commit
079bcece
authored
Feb 01, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改设备通知刷新消息
parent
86d12663
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
+5
-2
device-manager/src/main/java/com/mortals/xhx/busiz/req/DeviceMsgReq.java
...src/main/java/com/mortals/xhx/busiz/req/DeviceMsgReq.java
+2
-0
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceApiController.java
...n/java/com/mortals/xhx/busiz/web/DeviceApiController.java
+1
-1
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceSendMsgController.java
...va/com/mortals/xhx/busiz/web/DeviceSendMsgController.java
+2
-1
No files found.
device-manager/src/main/java/com/mortals/xhx/busiz/req/DeviceMsgReq.java
View file @
079bcece
...
@@ -17,6 +17,8 @@ public class DeviceMsgReq implements Serializable {
...
@@ -17,6 +17,8 @@ public class DeviceMsgReq implements Serializable {
private
String
productCode
;
private
String
productCode
;
private
Long
siteid
;
/**
/**
* 消息类型
* 消息类型
*/
*/
...
...
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceApiController.java
View file @
079bcece
...
@@ -583,7 +583,7 @@ public class DeviceApiController {
...
@@ -583,7 +583,7 @@ public class DeviceApiController {
try
{
try
{
ProductEntity
productEntity
=
productService
.
selectOne
(
new
ProductQuery
().
productCode
(
deviceMsgReq
.
getProductCode
()));
ProductEntity
productEntity
=
productService
.
selectOne
(
new
ProductQuery
().
productCode
(
deviceMsgReq
.
getProductCode
()));
if
(!
ObjectUtils
.
isEmpty
(
productEntity
)){
if
(!
ObjectUtils
.
isEmpty
(
productEntity
)){
List
<
DeviceEntity
>
deviceEntities
=
deviceService
.
find
(
new
DeviceQuery
().
productId
(
productEntity
.
getId
()));
List
<
DeviceEntity
>
deviceEntities
=
deviceService
.
find
(
new
DeviceQuery
().
productId
(
productEntity
.
getId
())
.
siteId
(
deviceMsgReq
.
getSiteid
())
);
List
<
DeviceMsgReq
>
list
=
deviceEntities
.
stream
().
map
(
item
->
{
List
<
DeviceMsgReq
>
list
=
deviceEntities
.
stream
().
map
(
item
->
{
DeviceMsgReq
msgReq
=
new
DeviceMsgReq
();
DeviceMsgReq
msgReq
=
new
DeviceMsgReq
();
BeanUtils
.
copyProperties
(
deviceMsgReq
,
msgReq
,
BeanUtil
.
getNullPropertyNames
(
deviceMsgReq
));
BeanUtils
.
copyProperties
(
deviceMsgReq
,
msgReq
,
BeanUtil
.
getNullPropertyNames
(
deviceMsgReq
));
...
...
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceSendMsgController.java
View file @
079bcece
package
com.mortals.xhx.busiz.web
;
package
com.mortals.xhx.busiz.web
;
import
cn.hutool.core.codec.Base64
;
import
cn.hutool.core.util.IdUtil
;
import
cn.hutool.core.util.IdUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
...
@@ -55,7 +56,7 @@ public class DeviceSendMsgController {
...
@@ -55,7 +56,7 @@ public class DeviceSendMsgController {
header
.
put
(
MessageHeader
.
DEVICECODE
,
deviceEntity
.
getDeviceCode
());
header
.
put
(
MessageHeader
.
DEVICECODE
,
deviceEntity
.
getDeviceCode
());
header
.
put
(
MessageHeader
.
TIMESTAMP
,
DateUtils
.
getCurrStrDateTime
());
header
.
put
(
MessageHeader
.
TIMESTAMP
,
DateUtils
.
getCurrStrDateTime
());
TbQueueMsg
queueMsg
=
new
DefaultTbQueueMsg
(
IdUtil
.
fastUUID
(),
"=="
,
header
);
TbQueueMsg
queueMsg
=
new
DefaultTbQueueMsg
(
IdUtil
.
fastUUID
(),
Base64
.
encode
(
new
JSONObject
().
toJSONString
())
,
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
));
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
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