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
4de47ddc
Commit
4de47ddc
authored
Jul 25, 2024
by
lilongyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、风电各风机状态模块下的健康状态指数趋势查询时间改为10分钟
2、光伏场各子阵状态模块下健康状态指数趋势查询时间改为10分钟 3、风电、光伏场站设备健康状态指数与趋势折线图数据不出现修复
parent
39aaa9b3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
45 deletions
+40
-45
TDBigScreenAnalyseController.java
...le/jxiop/biz/controller/TDBigScreenAnalyseController.java
+40
-45
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 @
4de47ddc
...
...
@@ -163,9 +163,9 @@ public class TDBigScreenAnalyseController extends BaseController {
wrapper
.
eq
(
FanHealthIndex:
:
getGatewayId
,
stationCode
);
FanHealthIndex
fanHealthIndex
=
fanHealthIndexMapper
.
selectOne
(
wrapper
);
//预防空指针
if
(
Objects
.
isNull
(
fanHealthIndex
))
{
if
(
Objects
.
isNull
(
fanHealthIndex
))
{
stringBigDecimalHashMap
.
put
(
"value"
,
""
);
}
else
{
}
else
{
stringBigDecimalHashMap
.
put
(
"value"
,
BigDecimal
.
valueOf
(
fanHealthIndex
.
getHealthIndex
()).
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
));
}
...
...
@@ -177,9 +177,9 @@ public class TDBigScreenAnalyseController extends BaseController {
pvwrapper
.
last
(
"limit 1"
);
PvHealthIndex
pvHealthIndex
=
pvHealthIndexMapper
.
selectOne
(
pvwrapper
);
//预防空指针
if
(
Objects
.
isNull
(
pvHealthIndex
))
{
if
(
Objects
.
isNull
(
pvHealthIndex
))
{
stringBigDecimalHashMap
.
put
(
"value"
,
""
);
}
else
{
}
else
{
stringBigDecimalHashMap
.
put
(
"value"
,
BigDecimal
.
valueOf
(
pvHealthIndex
.
getHealthIndex
()).
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
));
}
...
...
@@ -296,25 +296,27 @@ public class TDBigScreenAnalyseController extends BaseController {
@RequestParam
(
required
=
false
)
String
station
,
@RequestParam
(
required
=
false
)
String
analysisType
,
@RequestParam
(
required
=
false
)
Date
startTime
,
@RequestParam
(
required
=
false
)
Date
endTime
)
{
String
finalStationCode
=
null
;
String
finalAreaCode
=
null
;
String
stationType
=
null
;
if
(
StrUtil
.
isNotEmpty
(
stationCode
))
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationCode
);
stationCode
=
stationBasic
.
getFanGatewayId
();
finalStationCode
=
stationBasic
.
getFanGatewayId
();
stationType
=
stationBasic
.
getStationType
();
}
else
if
(
StrUtil
.
isNotEmpty
(
station
))
{
// 由于命名不统一
StationBasic
stationBasic
=
stationBasicMapper
.
selectOne
(
new
LambdaQueryWrapper
<
StationBasic
>()
.
eq
(
StationBasic:
:
getStationName
,
station
.
substring
(
0
,
station
.
length
()
-
1
)
+
'场'
).
or
()
.
eq
(
StationBasic:
:
getStationName
,
station
.
substring
(
0
,
station
.
length
()
-
1
)
+
'站'
));
stationCode
=
stationBasic
.
getFanGatewayId
();
finalStationCode
=
stationBasic
.
getFanGatewayId
();
stationType
=
stationBasic
.
getStationType
();
}
if
(
StrUtil
.
isNotEmpty
(
areaCode
))
{
a
reaCode
=
"%"
+
areaCode
+
"%"
;
finalA
reaCode
=
"%"
+
areaCode
+
"%"
;
}
else
if
(
StrUtil
.
isNotEmpty
(
area
))
{
a
reaCode
=
"%"
+
area
+
"%"
;
finalA
reaCode
=
"%"
+
area
+
"%"
;
}
String
finalStationCode
=
stationCode
;
String
finalAreaCode
=
areaCode
;
List
<
String
>
valueList
;
List
<
String
>
dateList
;
List
<
Map
<
String
,
Object
>>
arrayList
=
new
ArrayList
<>();
...
...
@@ -327,11 +329,9 @@ public class TDBigScreenAnalyseController extends BaseController {
wrapper
.
eq
(
FanHealthIndex:
:
getAnalysisType
,
"按10分钟"
);
if
(
CharSequenceUtil
.
isNotEmpty
(
finalStationCode
))
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
finalStationCode
);
if
(
"FDZ"
.
equals
(
stationBasic
.
getStationType
()))
{
stationCode
=
stationBasic
.
getFanGatewayId
();
if
(
"FDZ"
.
equals
(
stationType
))
{
wrapper
.
eq
(
FanHealthIndex:
:
getAnalysisObjType
,
"场站"
);
wrapper
.
eq
(
FanHealthIndex:
:
getGatewayId
,
s
tationCode
);
wrapper
.
eq
(
FanHealthIndex:
:
getGatewayId
,
finalS
tationCode
);
List
<
FanHealthIndex
>
fanHealthIndexList
=
fanHealthIndexMapper
.
selectList
(
wrapper
);
valueList
=
fanHealthIndexList
.
stream
().
map
(
t
->
String
.
valueOf
(
BigDecimal
.
valueOf
(
t
.
getHealthIndex
())
.
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
))).
collect
(
Collectors
.
toList
());
...
...
@@ -456,7 +456,6 @@ public class TDBigScreenAnalyseController extends BaseController {
List
<
String
>
list
=
new
ArrayList
<>();
list
=
Arrays
.
asList
(
"华北区域"
,
"东北区域"
,
"华东区域"
,
"华南区域"
,
"西南区域"
,
"西北区域"
,
"华中区域"
);
List
<
Object
>
seriesData
=
new
ArrayList
<>();
...
...
@@ -480,21 +479,20 @@ public class TDBigScreenAnalyseController extends BaseController {
Map
<
String
,
List
<
FanHealthIndex
>>
groupedData
=
fanHealthIndexList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
FanHealthIndex:
:
getArea
));
Map
<
String
,
FanHealthIndex
>
latestData
=
groupedData
.
values
().
stream
().
map
(
list
->
list
.
stream
()
.
max
(
Comparator
.
comparing
(
FanHealthIndex:
:
getTs
))
.
get
()).
collect
(
Collectors
.
toMap
(
FanHealthIndex:
:
getArea
,
Function
.
identity
()));
.
max
(
Comparator
.
comparing
(
FanHealthIndex:
:
getTs
))
.
get
()).
collect
(
Collectors
.
toMap
(
FanHealthIndex:
:
getArea
,
Function
.
identity
()));
List
<
String
>
axisData
=
latestData
.
values
().
stream
().
map
(
t
->
t
.
getArea
()).
collect
(
Collectors
.
toList
());
List
<
String
>
list
=
Arrays
.
asList
(
"华北区域"
,
"东北区域"
,
"华东区域"
,
"华南区域"
,
"西南区域"
,
"西北区域"
,
"华中区域"
);
List
<
String
>
finalList
=
Stream
.
concat
(
list
.
stream
(),
axisData
.
stream
()).
distinct
().
collect
(
Collectors
.
toList
());
List
<
String
>
finalList
=
Stream
.
concat
(
list
.
stream
(),
axisData
.
stream
()).
distinct
().
collect
(
Collectors
.
toList
());
List
<
Object
>
seriesData
=
new
ArrayList
<>();
finalList
.
forEach
(
item
->
seriesData
.
add
(
latestData
.
get
(
item
)
==
null
?
"100.0"
:
String
.
valueOf
(
BigDecimal
.
valueOf
(
latestData
.
get
(
item
).
getHealthIndex
()).
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
))));
seriesData
.
add
(
latestData
.
get
(
item
)
==
null
?
"100.0"
:
String
.
valueOf
(
BigDecimal
.
valueOf
(
latestData
.
get
(
item
).
getHealthIndex
()).
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
))));
resultMap
.
put
(
"axisData"
,
finalList
);
resultMap
.
put
(
"seriesData"
,
seriesData
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"片区场站设备健康状态指数 "
,
notes
=
"片区场站设备健康状态指数 "
)
@GetMapping
(
value
=
"/getStationHealthInfoByMinute"
)
...
...
@@ -1584,24 +1582,23 @@ public class TDBigScreenAnalyseController extends BaseController {
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
String
startTime
=
DateUtils
.
convertDateToString
(
DateUtils
.
dateAddMinutes
(
new
Date
(),
-
10
),
DateUtils
.
DATE_TIME_PATTERN
);
String
endTime
=
DateUtils
.
convertDateToString
(
new
Date
(),
DateUtils
.
DATE_TIME_PATTERN
);
LambdaQueryWrapper
<
FanHealthIndex
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
lambdaQueryWrapper
.
eq
(
FanHealthIndex:
:
getIndexAddress
,
indexAddress
);
lambdaQueryWrapper
.
eq
(
FanHealthIndex:
:
getGatewayId
,
stationBasic
.
getFanGatewayId
());
lambdaQueryWrapper
.
eq
(
FanHealthIndex:
:
getAnalysisObjType
,
"测点"
);
LambdaQueryWrapper
<
FanHealthIndexDay
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>(
);
lambdaQueryWrapper
.
eq
(
FanHealthIndex
Day:
:
getIndexAddress
,
indexAddress
);
lambdaQueryWrapper
.
eq
(
FanHealthIndexDay:
:
getGatewayId
,
stationBasic
.
getFanGatewayId
()
);
lambdaQueryWrapper
.
eq
(
FanHealthIndexDay:
:
getAnalysisObjType
,
"测点"
);
lambdaQueryWrapper
.
le
(
FanHealthIndexDay:
:
getRecDate
,
endTime
);
lambdaQueryWrapper
.
ge
(
FanHealthIndexDay:
:
getRecDate
,
startTime
);
lambdaQueryWrapper
.
orderByDesc
(
FanHealthIndex:
:
getTs
);
lambdaQueryWrapper
.
eq
(
FanHealthIndex
:
:
getAnalysisType
,
"按10分钟"
);
lambdaQueryWrapper
.
last
(
"limit 15"
);
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>(
);
List
<
FanHealthIndex
>
fanHealthIndexList
=
fanHealthIndexMapper
.
selectList
(
lambdaQueryWrapper
);
List
<
FanHealthIndexDay
>
fanHealthIndexDayList
=
fanHealthIndexDayMapper
.
selectList
(
lambdaQueryWrapper
);
// List<IndicatorData> indicatorData = indicatorDataMapper.selectDataByAddressAndtime(indexAddress, startTime, endTime, stationBasic.getFanGatewayId());
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
String
>
time
=
new
ArrayList
<>();
List
<
Object
>
valueList
=
new
ArrayList
<>();
fanHealthIndex
Day
List
.
forEach
(
item
->
{
time
.
add
(
item
.
getRecDate
()
.
substring
(
0
,
10
)
);
fanHealthIndexList
.
forEach
(
item
->
{
time
.
add
(
item
.
getRecDate
());
String
format
=
df
.
format
(
item
.
getHealthIndex
());
valueList
.
add
(
format
);
});
...
...
@@ -1623,24 +1620,22 @@ public class TDBigScreenAnalyseController extends BaseController {
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
String
startTime
=
DateUtils
.
convertDateToString
(
DateUtils
.
dateAddMinutes
(
new
Date
(),
-
10
),
DateUtils
.
DATE_TIME_PATTERN
);
String
endTime
=
DateUtils
.
convertDateToString
(
new
Date
(),
DateUtils
.
DATE_TIME_PATTERN
);
LambdaQueryWrapper
<
PvHealthIndexDay
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
lambdaQueryWrapper
.
eq
(
PvHealthIndexDay:
:
getIndexAddress
,
indexAddress
);
lambdaQueryWrapper
.
eq
(
PvHealthIndexDay:
:
getGatewayId
,
stationBasic
.
getFanGatewayId
());
lambdaQueryWrapper
.
eq
(
PvHealthIndexDay:
:
getAnalysisObjType
,
"测点"
);
lambdaQueryWrapper
.
le
(
PvHealthIndexDay:
:
getRecDate
,
endTime
);
lambdaQueryWrapper
.
ge
(
PvHealthIndexDay:
:
getRecDate
,
startTime
);
LambdaQueryWrapper
<
PvHealthIndex
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
lambdaQueryWrapper
.
eq
(
PvHealthIndex:
:
getIndexAddress
,
indexAddress
);
lambdaQueryWrapper
.
eq
(
PvHealthIndex:
:
getGatewayId
,
stationBasic
.
getFanGatewayId
());
lambdaQueryWrapper
.
eq
(
PvHealthIndex:
:
getAnalysisObjType
,
"测点"
);
lambdaQueryWrapper
.
orderByDesc
(
PvHealthIndex:
:
getTs
);
lambdaQueryWrapper
.
eq
(
PvHealthIndex:
:
getAnalysisType
,
"按10分钟"
);
lambdaQueryWrapper
.
last
(
"limit 15"
);
List
<
PvHealthIndexDay
>
fanHealthIndexDayList
=
pvHealthIndexDayMapper
.
selectList
(
lambdaQueryWrapper
);
// List<IndicatorData> indicatorData = indicatorDataMapper.selectDataByAddressAndtime(indexAddress, startTime, endTime, stationBasic.getFanGatewayId());
List
<
PvHealthIndex
>
fanHealthIndexDayList
=
pvHealthIndexMapper
.
selectList
(
lambdaQueryWrapper
);
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
String
>
time
=
new
ArrayList
<>();
List
<
Object
>
valueList
=
new
ArrayList
<>();
fanHealthIndexDayList
.
forEach
(
item
->
{
time
.
add
(
item
.
getRecDate
()
.
substring
(
0
,
10
)
);
time
.
add
(
item
.
getRecDate
());
String
format
=
df
.
format
(
item
.
getHealthIndex
());
valueList
.
add
(
format
);
});
...
...
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