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
238fc039
Commit
238fc039
authored
Jul 17, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模拟量消息
parent
83c95ead
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
1 deletion
+49
-1
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+49
-1
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
View file @
238fc039
...
...
@@ -868,9 +868,29 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public
void
getAnalogQuantityInfo
(
String
gatewayId
,
String
stationId
)
{
if
(
StringUtils
.
isNotEmpty
(
gatewayId
))
{
List
<
Map
<
String
,
String
>>
boosterStationInfo
=
monitorFanIndicatorregionMapper
.
getBoosterStationInfo
(
gatewayId
);
List
<
Map
<
String
,
String
>>
zbList
=
new
ArrayList
<>();
// 主变高压侧
Map
<
String
,
String
>
zbGYC
=
new
HashMap
<>();
for
(
Map
<
String
,
String
>
map
:
boosterStationInfo
)
{
String
sql
=
String
.
format
(
"SELECT equipmentIndexName, value, frontModule, unit, displayName FROM \"indicators_%s\" WHERE systemType = '%s' and frontModule =~/%s/ "
,
gatewayId
,
"模拟量"
,
map
.
get
(
"boosterName"
));
List
<
IndicatorsDto
>
listData
=
influxDButils
.
getListData
(
sql
,
IndicatorsDto
.
class
);
if
(
"1主变高压侧"
.
equals
(
map
.
get
(
"boosterName"
)))
{
zbGYC
=
listData
.
stream
().
collect
(
Collectors
.
toMap
(
IndicatorsDto:
:
getDisplayName
,
IndicatorsDto:
:
getValue
));
continue
;
}
if
(
"1主变低压侧"
.
equals
(
map
.
get
(
"boosterName"
)))
{
listData
.
forEach
(
item
->
{
HashMap
<
String
,
String
>
zbMap
=
new
HashMap
<>();
zbMap
.
put
(
"title"
,
item
.
getDisplayName
());
zbMap
.
put
(
"grade2"
,
item
.
getValue
());
if
(
StringUtils
.
isNotEmpty
(
item
.
getUnit
()))
{
zbMap
.
put
(
"title"
,
String
.
format
(
"%s(%s)"
,
item
.
getDisplayName
(),
item
.
getUnit
()));
}
zbMap
.
put
(
"titleYuanShi"
,
item
.
getDisplayName
());
zbList
.
add
(
zbMap
);
});
continue
;
}
ArrayList
<
Map
<
String
,
String
>>
resultList
=
new
ArrayList
<>();
listData
.
forEach
(
item
->
{
HashMap
<
String
,
String
>
stringStringHashMap
=
new
HashMap
<>();
...
...
@@ -888,12 +908,25 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
result
.
setTotal
(
resultList
.
size
());
try
{
log
.
info
(
"消息内容:{}"
,
JSON
.
toJSONString
(
result
));
emqKeeper
.
getMqttClient
().
publish
(
String
.
format
(
"%s/%s/%s"
,
stationId
,
map
.
get
(
"
boosterCode"
),
"mnl"
),
JSON
.
toJSONString
(
result
).
getBytes
(),
0
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
String
.
format
(
"%s/%s/%s"
,
stationId
,
map
.
get
(
"
value"
),
"mnl"
),
JSON
.
toJSONString
(
result
).
getBytes
(),
2
,
false
);
}
catch
(
MqttException
e
)
{
log
.
info
(
"消息发送失败"
);
e
.
printStackTrace
();
}
}
Map
<
String
,
String
>
finalZbGYC
=
zbGYC
;
zbList
.
forEach
(
item
->
item
.
put
(
"grade1"
,
finalZbGYC
.
getOrDefault
(
item
.
get
(
"titleYuanShi"
),
"0.0"
)));
IPage
<
Map
<
String
,
String
>>
zbResult
=
new
Page
<>();
zbResult
.
setRecords
(
zbList
);
zbResult
.
setCurrent
(
1
);
zbResult
.
setTotal
(
zbList
.
size
());
try
{
log
.
info
(
"主变消息内容:{}"
,
JSON
.
toJSONString
(
zbResult
));
emqKeeper
.
getMqttClient
().
publish
(
String
.
format
(
"%s/%s/%s"
,
stationId
,
2
,
"mnl"
),
JSON
.
toJSONString
(
zbResult
).
getBytes
(),
2
,
false
);
}
catch
(
MqttException
e
)
{
log
.
info
(
"消息发送失败"
);
e
.
printStackTrace
();
}
}
}
...
...
@@ -945,6 +978,21 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
});
// 主线路图上各个路线名称
resultMap
.
put
(
"xyx"
,
"夏雩线"
);
resultMap
.
put
(
"zbgy"
,
"1主变高压侧"
);
resultMap
.
put
(
"220mpt"
,
"220kVⅠ母PT"
);
resultMap
.
put
(
"jd1"
,
"集电Ⅰ线"
);
resultMap
.
put
(
"jd2"
,
"集电Ⅱ线"
);
resultMap
.
put
(
"jd3"
,
"集电Ⅲ线"
);
resultMap
.
put
(
"jd4"
,
"集电Ⅳ线"
);
resultMap
.
put
(
"zbdy"
,
"1主变低压侧"
);
resultMap
.
put
(
"dy1"
,
"待用Ⅰ线"
);
resultMap
.
put
(
"35mpt"
,
"35kVⅠ母PT"
);
resultMap
.
put
(
"1jdb"
,
"1接地变"
);
resultMap
.
put
(
"1svg"
,
"1SVG"
);
resultMap
.
put
(
"2svg"
,
"2SVG"
);
//下方重复列表数据
List
<
Map
<
String
,
String
>>
boosterStationInfo
=
monitorFanIndicatorregionMapper
.
getMajorBoosterStationInfo
(
gatewayId
,
"ASC"
,
10
);
ArrayList
<
Map
<
String
,
String
>>
resultList
=
new
ArrayList
<>();
...
...
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