Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
5620cc23
Commit
5620cc23
authored
Jun 24, 2022
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:【装备】修改iot指标解析,traceId赋值
parent
a0260da6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
10 deletions
+26
-10
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+19
-3
application-dev.properties
...ystem-equip/src/main/resources/application-dev.properties
+7
-7
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
5620cc23
...
...
@@ -228,18 +228,34 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
JSONObject
json
=
JSONObject
.
parseObject
(
message
);
Iterator
it
=
json
.
entrySet
().
iterator
();
List
<
IotDataVO
>
iotDatalist
=
new
ArrayList
<
IotDataVO
>();
String
traceId
=
""
;
while
(
it
.
hasNext
())
{
IotDataVO
iotDataVO
=
new
IotDataVO
();
Map
.
Entry
<
String
,
Object
>
entry
=
(
Map
.
Entry
<
String
,
Object
>)
it
.
next
();
iotDataVO
.
setKey
(
entry
.
getKey
());
iotDataVO
.
setValue
(
entry
.
getValue
());
String
key
=
entry
.
getKey
();
Object
value
=
entry
.
getValue
();
iotDataVO
.
setKey
(
key
);
iotDataVO
.
setValue
(
value
);
if
(
"traceId"
.
equalsIgnoreCase
(
key
))
{
traceId
=
value
.
toString
();
continue
;
}
iotDatalist
.
add
(
iotDataVO
);
}
if
(
ObjectUtils
.
isEmpty
(
iotDatalist
))
{
return
;
}
log
.
info
(
String
.
format
(
"收到mqtt消息:%s"
,
message
));
realTimeDateProcessing
(
topicEntity
,
iotDatalist
);
if
(!
StringUtils
.
isEmpty
(
traceId
))
{
String
finalTraceId
=
traceId
;
List
<
IotDataVO
>
collect
=
iotDatalist
.
stream
().
map
(
x
->
{
x
.
setTraceId
(
finalTraceId
);
return
x
;
}).
collect
(
Collectors
.
toList
());
realTimeDateProcessing
(
topicEntity
,
collect
);
}
else
{
realTimeDateProcessing
(
topicEntity
,
iotDatalist
);
}
}
/**
...
...
amos-boot-system-equip/src/main/resources/application-dev.properties
View file @
5620cc23
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.url
=
jdbc:mysql://
39.98.246.3
1/dl_business_v3.0.1.3?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.url
=
jdbc:mysql://
172.16.11.20
1/dl_business_v3.0.1.3?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username
=
root
spring.datasource.password
=
Yeejoin@2020
spring.datasource.type
=
com.zaxxer.hikari.HikariDataSource
...
...
@@ -14,10 +14,10 @@ spring.datasource.hikari.connection-test-query= SELECT 1
# \u6587\u4EF6\u670D\u52A1\u5668\u5730\u5740
fileserver_domain
=
http://
39.98.45.134
:9000/
fileserver_domain
=
http://
172.16.11.201
:9000/
#eureka.instance.ip-address= 172.16.3.135
eureka.instance.hostname
=
39.98.246.3
1
eureka.instance.hostname
=
172.16.11.20
1
eureka.instance.prefer-ip-address
=
true
eureka.client.serviceUrl.defaultZone
:
http://${eureka.instance.hostname}:10001/eureka/
...
...
@@ -33,9 +33,9 @@ security.appKeyApp=studio_normalapp_3056965
spring.redis.database
=
1
spring.redis.host
=
39.98.246.3
1
spring.redis.host
=
172.16.11.20
1
spring.redis.port
=
6379
spring.redis.password
=
yeejoin@202
0
spring.redis.password
=
123456
0
spring.redis.lettuce.pool.max-active
=
200
spring.redis.lettuce.pool.max-wait
=
-1
spring.redis.lettuce.pool.max-idle
=
10
...
...
@@ -45,10 +45,10 @@ spring.redis.expire.time=30000
## emqx
emqx.clean-session
=
true
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}
emqx.broker
=
tcp://
39.98.246.3
1:1883
emqx.broker
=
tcp://
172.16.11.20
1:1883
emqx.user-name
=
admin
emqx.password
=
public
mqtt.scene.host
=
mqtt://
39.98.246.3
1:8083/mqtt
mqtt.scene.host
=
mqtt://
172.16.11.20
1:8083/mqtt
mqtt.client.product.id
=
mqtt
mqtt.topic
=
topic_mqtt
spring.mqtt.completionTimeout
=
3000
...
...
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