Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
902a7a75
Commit
902a7a75
authored
Jul 24, 2024
by
yangyang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
7b14214e
12d9a54d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
14 deletions
+11
-14
TDBigScreenAnalyseController.java
...le/jxiop/biz/controller/TDBigScreenAnalyseController.java
+11
-14
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/TDBigScreenAnalyseController.java
View file @
902a7a75
...
@@ -17,7 +17,6 @@ import java.util.List;
...
@@ -17,7 +17,6 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Objects
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.function.Predicate
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
...
@@ -461,7 +460,7 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -461,7 +460,7 @@ public class TDBigScreenAnalyseController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"全域片区设备健康状态指数 "
,
notes
=
"全域片区设备健康状态指数 "
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"全域片区设备健康状态指数 "
,
notes
=
"全域片区设备健康状态指数 "
)
@GetMapping
(
value
=
"/getAreaHealthInfoByMinute"
)
@GetMapping
(
value
=
"/getAreaHealthInfoByMinute"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
get
HealthInfoByAreaAnd
Minute
()
{
public
ResponseModel
<
Map
<
String
,
Object
>>
get
AreaHealthInfoBy
Minute
()
{
LambdaQueryWrapper
<
FanHealthIndex
>
wrapper
=
new
LambdaQueryWrapper
<
FanHealthIndex
>();
LambdaQueryWrapper
<
FanHealthIndex
>
wrapper
=
new
LambdaQueryWrapper
<
FanHealthIndex
>();
wrapper
.
orderByDesc
(
FanHealthIndex:
:
getTs
);
wrapper
.
orderByDesc
(
FanHealthIndex:
:
getTs
);
wrapper
.
eq
(
FanHealthIndex:
:
getAnalysisType
,
"按10分钟"
);
wrapper
.
eq
(
FanHealthIndex:
:
getAnalysisType
,
"按10分钟"
);
...
@@ -475,12 +474,10 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -475,12 +474,10 @@ public class TDBigScreenAnalyseController extends BaseController {
.
get
()).
collect
(
Collectors
.
toMap
(
FanHealthIndex:
:
getArea
,
Function
.
identity
()));
.
get
()).
collect
(
Collectors
.
toMap
(
FanHealthIndex:
:
getArea
,
Function
.
identity
()));
List
<
String
>
axisData
=
latestData
.
values
().
stream
().
map
(
t
->
t
.
getArea
()).
collect
(
Collectors
.
toList
());
List
<
String
>
axisData
=
latestData
.
values
().
stream
().
map
(
t
->
t
.
getArea
()).
collect
(
Collectors
.
toList
());
List
<
String
>
list
=
Arrays
.
asList
(
"华北区域"
,
"东北区域"
,
"华东区域"
,
"华南区域"
,
"西南区域"
,
"西北区域"
,
"华中区域"
);
List
<
String
>
list
=
Arrays
.
asList
(
"华北区域"
,
"东北区域"
,
"华东区域"
,
"华南区域"
,
"西南区域"
,
"西北区域"
,
"华中区域"
);
List
<
String
>
finalList
=
Stream
.
concat
(
axisData
.
stream
(),
list
.
stream
()).
distinct
().
collect
(
Collectors
.
toList
());
List
<
String
>
finalList
=
Stream
.
concat
(
list
.
stream
(),
axisData
.
stream
()).
distinct
().
collect
(
Collectors
.
toList
());
List
<
Object
>
seriesData
=
new
ArrayList
<>();
List
<
Object
>
seriesData
=
new
ArrayList
<>();
latestData
.
values
().
forEach
(
item
->
{
finalList
.
forEach
(
item
->
Predicate
<
String
>
condition
=
finalList:
:
contains
;
seriesData
.
add
(
latestData
.
get
(
item
)
==
null
?
"100.0"
:
String
.
valueOf
(
BigDecimal
.
valueOf
(
latestData
.
get
(
item
).
getHealthIndex
()).
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
))));
seriesData
.
add
(
condition
.
test
(
item
.
getArea
())
?
String
.
valueOf
(
BigDecimal
.
valueOf
(
item
.
getHealthIndex
()))
:
"100.0"
);
});
resultMap
.
put
(
"axisData"
,
finalList
);
resultMap
.
put
(
"axisData"
,
finalList
);
resultMap
.
put
(
"seriesData"
,
seriesData
);
resultMap
.
put
(
"seriesData"
,
seriesData
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
...
@@ -491,7 +488,7 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -491,7 +488,7 @@ public class TDBigScreenAnalyseController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"片区场站设备健康状态指数 "
,
notes
=
"片区场站设备健康状态指数 "
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"片区场站设备健康状态指数 "
,
notes
=
"片区场站设备健康状态指数 "
)
@GetMapping
(
value
=
"/getStationHealthInfoByMinute"
)
@GetMapping
(
value
=
"/getStationHealthInfoByMinute"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
get
HealthInfoByStationAnd
Minute
(
@RequestParam
(
required
=
false
)
String
areaCode
)
{
public
ResponseModel
<
Map
<
String
,
Object
>>
get
StationHealthInfoBy
Minute
(
@RequestParam
(
required
=
false
)
String
areaCode
)
{
LambdaQueryWrapper
<
FanHealthIndex
>
wrapper
=
new
LambdaQueryWrapper
<
FanHealthIndex
>();
LambdaQueryWrapper
<
FanHealthIndex
>
wrapper
=
new
LambdaQueryWrapper
<
FanHealthIndex
>();
wrapper
.
orderByDesc
(
FanHealthIndex:
:
getTs
);
wrapper
.
orderByDesc
(
FanHealthIndex:
:
getTs
);
wrapper
.
eq
(
FanHealthIndex:
:
getAnalysisType
,
"按10分钟"
);
wrapper
.
eq
(
FanHealthIndex:
:
getAnalysisType
,
"按10分钟"
);
...
@@ -509,10 +506,10 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -509,10 +506,10 @@ public class TDBigScreenAnalyseController extends BaseController {
List
<
PvHealthIndex
>
pvHealthIndexList
=
pvHealthIndexMapper
.
selectList
(
pvWrapper
);
List
<
PvHealthIndex
>
pvHealthIndexList
=
pvHealthIndexMapper
.
selectList
(
pvWrapper
);
Map
<
String
,
List
<
FanHealthIndex
>>
fanHealthGroupedData
=
fanHealthIndexList
.
stream
()
Map
<
String
,
List
<
FanHealthIndex
>>
fanHealthGroupedData
=
fanHealthIndexList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
FanHealthIndex:
:
get
Area
));
.
collect
(
Collectors
.
groupingBy
(
FanHealthIndex:
:
get
Station
));
Map
<
String
,
FanHealthIndex
>
fanHealthLatestData
=
fanHealthGroupedData
.
values
().
stream
().
map
(
list
->
list
.
stream
()
Map
<
String
,
FanHealthIndex
>
fanHealthLatestData
=
fanHealthGroupedData
.
values
().
stream
().
map
(
list
->
list
.
stream
()
.
max
(
Comparator
.
comparing
(
FanHealthIndex:
:
getTs
))
.
max
(
Comparator
.
comparing
(
FanHealthIndex:
:
getTs
))
.
get
()).
collect
(
Collectors
.
toMap
(
FanHealthIndex:
:
get
Area
,
Function
.
identity
()));
.
get
()).
collect
(
Collectors
.
toMap
(
FanHealthIndex:
:
get
Station
,
Function
.
identity
()));
Map
<
String
,
List
<
PvHealthIndex
>>
pvHealthGroupedData
=
pvHealthIndexList
.
stream
()
Map
<
String
,
List
<
PvHealthIndex
>>
pvHealthGroupedData
=
pvHealthIndexList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
PvHealthIndex:
:
getStation
));
.
collect
(
Collectors
.
groupingBy
(
PvHealthIndex:
:
getStation
));
...
@@ -522,10 +519,10 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -522,10 +519,10 @@ public class TDBigScreenAnalyseController extends BaseController {
List
<
String
>
finalAxisData
=
new
ArrayList
<>();
List
<
String
>
finalAxisData
=
new
ArrayList
<>();
List
<
Object
>
finaleSeriesData
=
new
ArrayList
<>();
List
<
Object
>
finaleSeriesData
=
new
ArrayList
<>();
finalAxisData
.
addAll
(
fanHealthLatestData
.
values
().
stream
().
map
(
t
->
t
.
get
Area
()).
collect
(
Collectors
.
toList
()));
finalAxisData
.
addAll
(
fanHealthLatestData
.
values
().
stream
().
map
(
t
->
t
.
get
Station
()).
collect
(
Collectors
.
toList
()));
finalAxisData
.
addAll
(
pvHealthLatestData
.
values
().
stream
().
map
(
t
->
t
.
get
Area
()).
collect
(
Collectors
.
toList
()));
finalAxisData
.
addAll
(
pvHealthLatestData
.
values
().
stream
().
map
(
t
->
t
.
get
Station
()).
collect
(
Collectors
.
toList
()));
finaleSeriesData
.
addAll
(
fanHealthLatestData
.
values
().
stream
().
map
(
t
->
String
.
valueOf
(
BigDecimal
.
valueOf
(
t
.
getHealthIndex
()))).
collect
(
Collectors
.
toList
()));
finaleSeriesData
.
addAll
(
fanHealthLatestData
.
values
().
stream
().
map
(
t
->
String
.
valueOf
(
BigDecimal
.
valueOf
(
t
.
getHealthIndex
())
.
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
)
)).
collect
(
Collectors
.
toList
()));
finaleSeriesData
.
addAll
(
pvHealthLatestData
.
values
().
stream
().
map
(
t
->
String
.
valueOf
(
BigDecimal
.
valueOf
(
t
.
getHealthIndex
()))).
collect
(
Collectors
.
toList
()));
finaleSeriesData
.
addAll
(
pvHealthLatestData
.
values
().
stream
().
map
(
t
->
String
.
valueOf
(
BigDecimal
.
valueOf
(
t
.
getHealthIndex
())
.
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
)
)).
collect
(
Collectors
.
toList
()));
resultMap
.
put
(
"axisData"
,
finalAxisData
);
resultMap
.
put
(
"axisData"
,
finalAxisData
);
resultMap
.
put
(
"seriesData"
,
finaleSeriesData
);
resultMap
.
put
(
"seriesData"
,
finaleSeriesData
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
...
...
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