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
a58fd3f3
Commit
a58fd3f3
authored
Jul 07, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
ac974e93
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
5 deletions
+22
-5
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+12
-2
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+10
-3
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 @
a58fd3f3
...
...
@@ -79,8 +79,18 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"风机布置图 - 风机状态统计"
)
@GetMapping
(
"/getFanStatusStatistics"
)
public
ResponseModel
<
Map
<
String
,
Long
>>
getFanStatusStatistics
(
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
)
{
return
ResponseHelper
.
buildResponse
(
monitorFanIndicator
.
getFanStatusStatistics
(
stationId
));
public
ResponseModel
<
IPage
<
IndexDto
>>
getFanStatusStatistics
(
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
,
@RequestParam
(
value
=
"current"
,
required
=
false
)
int
current
,
@RequestParam
(
value
=
"size"
,
required
=
false
)
int
size
)
{
List
<
IndexDto
>
fanStatusStatistics
=
monitorFanIndicator
.
getFanStatusStatistics
(
stationId
);
Page
<
IndexDto
>
page
=
new
Page
<>(
current
,
size
);
List
<
IndexDto
>
collect
=
fanStatusStatistics
.
stream
()
.
skip
((
long
)
(
current
-
1
)
*
size
)
.
limit
(
size
)
.
collect
(
Collectors
.
toList
());
page
.
setTotal
(
fanStatusStatistics
.
size
());
page
.
setRecords
(
collect
);
return
ResponseHelper
.
buildResponse
(
page
);
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
...
...
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 @
a58fd3f3
...
...
@@ -251,13 +251,20 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
return
equipNumList
;
}
public
Map
<
String
,
Long
>
getFanStatusStatistics
(
String
stationId
)
{
public
List
<
IndexDto
>
getFanStatusStatistics
(
String
stationId
)
{
StationBasic
stationBasic
=
getOneByStationNumber
(
stationId
);
String
sql
=
String
.
format
(
"SELECT equipmentNumber, equipmentIndexName FROM \"indicators_%s\" WHERE equipmentIndexName =~/^正常运行|告警运行|正常停机|故障停机|限功率|待机状态|维护状态|通讯中断$/ and value = 'true'"
,
stationBasic
.
getFanGatewayId
());
List
<
IndexDto
>
influxDBList
=
influxDButils
.
getListData
(
sql
,
IndexDto
.
class
);
// key:状态 value:数量
Map
<
String
,
Long
>
collect
=
influxDBList
.
stream
().
collect
(
Collectors
.
groupingBy
(
IndexDto:
:
getEquipmentIndexName
,
Collectors
.
counting
()));
return
collect
;
List
<
String
>
list
=
Arrays
.
asList
(
"正常运行"
,
"告警运行"
,
"正常停机"
,
"故障停机"
,
"限功率"
,
"待机状态"
,
"维护状态"
,
"通讯中断"
);
List
<
IndexDto
>
resultList
=
new
ArrayList
<>();
list
.
forEach
(
item
->
{
IndexDto
indexDto
=
new
IndexDto
();
indexDto
.
setCount
(
Math
.
toIntExact
(
collect
.
getOrDefault
(
item
,
0L
)));
indexDto
.
setEquipmentIndexName
(
item
);
resultList
.
add
(
indexDto
);
});
return
resultList
;
}
public
IndexDto
getFanBasicInfoByEquipNum
(
String
equipNum
,
String
stationId
)
{
...
...
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