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
ac4f08c5
Commit
ac4f08c5
authored
Jul 14, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模拟量消息开发 xiugai
parent
83e0cd3e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+3
-3
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+14
-5
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/MonitorFanIdxController.java
View file @
ac4f08c5
...
...
@@ -332,7 +332,7 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取升压站信息 通过排序等"
)
@GetMapping
(
"/getBoosterStationInfo"
)
public
ResponseModel
<
List
<
Map
<
String
,
String
>>>
getBoosterStationInfo
(
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
)
{
...
...
@@ -362,7 +362,7 @@ public class MonitorFanIdxController extends BaseController {
return
ResponseHelper
.
buildResponse
(
resultsData
);
}
@Scheduled
(
cron
=
"0/10 * * * * ? "
)
//
@Scheduled(cron = "0/10 * * * * ? ")
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"模拟量列表消息"
)
@GetMapping
(
"/getAnalogQuantityInfo"
)
...
...
@@ -370,7 +370,7 @@ public class MonitorFanIdxController extends BaseController {
LambdaQueryWrapper
<
StationBasic
>
wrapper
=
new
LambdaQueryWrapper
<>();
List
<
StationBasic
>
stationBasics
=
stationBasicMapper
.
selectList
(
wrapper
);
for
(
StationBasic
stationBasic
:
stationBasics
)
{
String
gatewayId
=
stationBasic
.
get
Fan
GatewayId
();
String
gatewayId
=
stationBasic
.
get
Booster
GatewayId
();
monitorFanIndicator
.
getAnalogQuantityInfo
(
gatewayId
,
stationBasic
.
getSequenceNbr
().
toString
());
}
return
CommonResponseUtil
.
success
();
...
...
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 @
ac4f08c5
...
...
@@ -671,7 +671,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public
List
<
Map
<
String
,
String
>>
getBoosterStationInfo
(
String
stationId
)
{
StationBasic
stationBasic
=
getOneByStationNumber
(
stationId
);
List
<
Map
<
String
,
String
>>
boosterStationInfo
=
monitorFanIndicatorregionMapper
.
getBoosterStationInfo
(
stationBasic
.
get
Fan
GatewayId
());
List
<
Map
<
String
,
String
>>
boosterStationInfo
=
monitorFanIndicatorregionMapper
.
getBoosterStationInfo
(
stationBasic
.
get
Booster
GatewayId
());
return
boosterStationInfo
;
}
...
...
@@ -713,20 +713,28 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
public
void
getAnalogQuantityInfo
(
String
gatewayId
,
String
stationId
)
{
if
(
StringUtils
.
isNotEmpty
(
gatewayId
))
{
List
<
Map
<
String
,
String
>>
boosterStationInfo
=
monitorFanIndicatorregionMapper
.
getBoosterStationInfo
(
gatewayId
);
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
);
ArrayList
<
Map
<
String
,
String
>>
resultList
=
new
ArrayList
<>();
listData
.
forEach
(
item
->
{
HashMap
<
String
,
String
>
stringStringHashMap
=
new
HashMap
<>();
stringStringHashMap
.
put
(
"title"
,
item
.
getDisplayName
());
stringStringHashMap
.
put
(
"value"
,
item
.
getValue
());
if
(
StringUtils
.
isNotEmpty
(
item
.
getUnit
()))
{
item
.
setDisplayName
(
String
.
format
(
"%s(%s)"
,
item
.
getDisplayName
(),
item
.
getUnit
()));
stringStringHashMap
.
put
(
"title"
,
String
.
format
(
"%s(%s)"
,
item
.
getDisplayName
(),
item
.
getUnit
()));
}
resultList
.
add
(
stringStringHashMap
);
});
IPage
<
IndicatorsDto
>
result
=
new
Page
<>();
result
.
setRecords
(
listData
);
IPage
<
Map
<
String
,
String
>>
result
=
new
Page
<>();
result
.
setRecords
(
resultList
);
result
.
setCurrent
(
1
);
result
.
setTotal
(
listData
.
size
());
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
);
}
catch
(
MqttException
e
)
{
log
.
info
(
"消息发送失败"
);
...
...
@@ -734,5 +742,6 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
}
}
}
}
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