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
3457cfb9
Commit
3457cfb9
authored
Nov 08, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
td相关 - 预警光伏和风电页面开发
parent
e12b3f51
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
151 additions
and
215 deletions
+151
-215
TdInfoQueryController.java
...ot/module/jxiop/biz/controller/TdInfoQueryController.java
+68
-215
FanHealthIndexDto.java
...oin/amos/boot/module/jxiop/biz/dto/FanHealthIndexDto.java
+4
-0
FanWaringRecordMapper.java
...oot/module/jxiop/biz/tdMapper2/FanWaringRecordMapper.java
+5
-0
PvWaringRecordMapper.java
...boot/module/jxiop/biz/tdMapper2/PvWaringRecordMapper.java
+6
-0
FanWarningRecord.xml
.../src/main/resources/mapper/tdengine2/FanWarningRecord.xml
+34
-0
PvWarningRecord.xml
...z/src/main/resources/mapper/tdengine2/PvWarningRecord.xml
+34
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/TdInfoQueryController.java
View file @
3457cfb9
...
...
@@ -14,9 +14,13 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthIndexMapper
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthLevelMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.ObjectUtils
;
...
...
@@ -45,6 +49,12 @@ public class TdInfoQueryController {
private
PvHealthIndexMapper
pvHealthIndexMapper
;
@Autowired
private
FanWaringRecordMapper
fanWaringRecordMapper
;
@Autowired
private
PvWaringRecordMapper
pvWaringRecordMapper
;
@Autowired
IdxBizFanHealthLevelMapper
idxBizFanHealthLevelMapper
;
@Autowired
...
...
@@ -123,230 +133,73 @@ public class TdInfoQueryController {
return
ResponseHelper
.
buildResponse
(
resultPage
);
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"全景诊断回溯"
)
@GetMapping
(
"/getFullViewRecall"
)
public
ResponseModel
<
List
<
FullViewRecallInfoDTO
>>
getFullViewRecall
(
@RequestParam
(
required
=
false
,
value
=
"analysisType"
)
String
analysisType
)
{
List
<
Map
<
String
,
Object
>>
stationIndexInfo
=
idxBizFanHealthIndexMapper
.
getStationIndexInfoByParam
(
analysisType
);
Map
<
String
,
Double
>
stationHealthIndexMap
=
stationIndexInfo
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"station"
).
toString
(),
t
->
Double
.
parseDouble
(
t
.
get
(
"healthIndex"
).
toString
())));
List
<
Map
<
String
,
Object
>>
equipmentIndexInfo
=
idxBizFanHealthIndexMapper
.
getEquipmentIndexInfoByParam
(
analysisType
);
Map
<
String
,
Double
>
equipmentIndexInfoMap
=
equipmentIndexInfo
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"equipmentName"
).
toString
(),
t
->
Double
.
parseDouble
(
t
.
get
(
"healthIndex"
).
toString
())));
List
<
Map
<
String
,
Object
>>
subSystemIndexInfo
=
idxBizFanHealthIndexMapper
.
getSubSystemIndexInfoByParam
(
analysisType
);
Map
<
String
,
Double
>
subSystemIndexInfoMap
=
subSystemIndexInfo
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"subSystem"
).
toString
(),
t
->
Double
.
parseDouble
(
t
.
get
(
"healthIndex"
).
toString
())));
List
<
Map
<
String
,
Object
>>
pointNameIndexInfo
=
idxBizFanHealthIndexMapper
.
getPointNameIndexInfoByParam
(
analysisType
);
Map
<
String
,
Double
>
pointNameIndexInfoMap
=
pointNameIndexInfo
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"gatewayIndexAddress"
).
toString
(),
t
->
Double
.
parseDouble
(
t
.
get
(
"healthIndex"
).
toString
())));
List
<
IdxBizFanHealthLevel
>
healthLevelInfoList
=
idxBizFanHealthIndexMapper
.
getHealthLevelInfoList
();
List
<
FullViewRecallDataDTO
>
list
=
idxBizFanHealthIndexMapper
.
getFullViewRecall
();
Map
<
String
,
Map
<
String
,
Map
<
String
,
Map
<
String
,
Map
<
String
,
List
<
FullViewRecallDataDTO
>>>>>>
resultMap
=
list
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
FullViewRecallDataDTO:
:
getArea
,
Collectors
.
groupingBy
(
FullViewRecallDataDTO:
:
getStation
,
Collectors
.
groupingBy
(
FullViewRecallDataDTO:
:
getEquipmentName
,
Collectors
.
groupingBy
(
FullViewRecallDataDTO:
:
getSubSystem
,
Collectors
.
groupingBy
(
FullViewRecallDataDTO:
:
getPointName
))))));
int
areaInt
=
1
;
int
pointNameInt
=
1
;
int
stationInt
=
1
;
int
equipmentInt
=
1
;
int
subSystemInt
=
1
;
Double
healthScoreInfo
=
idxBizFanHealthIndexMapper
.
getHealthScoreInfoByParam
(
null
,
null
,
analysisType
).
doubleValue
();
LambdaQueryWrapper
<
IdxBizFanHealthLevel
>
query
=
new
LambdaQueryWrapper
<>();
query
.
isNull
(
IdxBizFanHealthLevel:
:
getStatus
);
query
.
eq
(
IdxBizFanHealthLevel:
:
getAnalysisObjType
,
"全域"
);
query
.
lt
(
IdxBizFanHealthLevel:
:
getGroupLowerLimit
,
healthScoreInfo
);
query
.
ge
(
IdxBizFanHealthLevel:
:
getGroupUpperLimit
,
healthScoreInfo
);
IdxBizFanHealthLevel
idxBizFanHealthLevel
=
idxBizFanHealthLevelMapper
.
selectOne
(
query
);
FullViewRecallInfoDTO
allMapDto
=
new
FullViewRecallInfoDTO
();
allMapDto
.
setKey
(
"0"
);
allMapDto
.
setName
(
"全域设备健康状态指数"
);
allMapDto
.
setScoreRange
(
""
);
allMapDto
.
setStatus
(
idxBizFanHealthLevel
.
getHealthLevel
());
allMapDto
.
setScore
(
healthScoreInfo
);
allMapDto
.
setIsRoot
(
true
);
allMapDto
.
setCategory
(
"category"
);
allMapDto
.
setChildren
(
new
ArrayList
<>());
allMapDto
.
setParentKey
(
"0"
);
for
(
Map
.
Entry
<
String
,
Map
<
String
,
Map
<
String
,
Map
<
String
,
Map
<
String
,
List
<
FullViewRecallDataDTO
>>>>>>
areaMap
:
resultMap
.
entrySet
())
{
Double
areaLowScore
=
null
;
Double
areaHighScore
=
null
;
Double
areaHealthScoreInfo
=
idxBizFanHealthIndexMapper
.
getHealthScoreInfoByParam
(
areaMap
.
getKey
(),
null
,
analysisType
).
doubleValue
();
LambdaQueryWrapper
<
IdxBizFanHealthLevel
>
areaQuery
=
new
LambdaQueryWrapper
<>();
areaQuery
.
isNull
(
IdxBizFanHealthLevel:
:
getStatus
);
areaQuery
.
eq
(
IdxBizFanHealthLevel:
:
getAnalysisObjType
,
"片区"
);
areaQuery
.
lt
(
IdxBizFanHealthLevel:
:
getGroupLowerLimit
,
areaHealthScoreInfo
);
areaQuery
.
ge
(
IdxBizFanHealthLevel:
:
getGroupUpperLimit
,
areaHealthScoreInfo
);
IdxBizFanHealthLevel
areaIdxBizFanHealthLevel
=
idxBizFanHealthLevelMapper
.
selectOne
(
areaQuery
);
FullViewRecallInfoDTO
areaMapDto
=
new
FullViewRecallInfoDTO
();
areaMapDto
.
setKey
(
"0-"
+
areaInt
);
areaMapDto
.
setName
(
areaMap
.
getKey
());
areaMapDto
.
setStatus
(
areaIdxBizFanHealthLevel
.
getHealthLevel
());
areaMapDto
.
setScore
(
areaHealthScoreInfo
);
areaMapDto
.
setParentKey
(
allMapDto
.
getKey
());
allMapDto
.
getChildren
().
add
(
areaMapDto
);
areaInt
++;
List
<
FullViewRecallInfoDTO
>
areaMapList
=
new
ArrayList
<>();
for
(
Map
.
Entry
<
String
,
Map
<
String
,
Map
<
String
,
Map
<
String
,
List
<
FullViewRecallDataDTO
>>>>>
stationMap
:
areaMap
.
getValue
().
entrySet
())
{
Double
stationLowScore
=
null
;
Double
stationHighScore
=
null
;
if
(
areaLowScore
==
null
&&
areaHighScore
==
null
)
{
areaLowScore
=
stationHealthIndexMap
.
getOrDefault
(
stationMap
.
getKey
(),
100.0
);
areaHighScore
=
stationHealthIndexMap
.
getOrDefault
(
stationMap
.
getKey
(),
100.0
);
}
else
{
if
(
stationHealthIndexMap
.
getOrDefault
(
stationMap
.
getKey
(),
100.0
)
<
areaLowScore
)
{
areaLowScore
=
stationHealthIndexMap
.
getOrDefault
(
stationMap
.
getKey
(),
100.0
);
}
if
(
stationHealthIndexMap
.
getOrDefault
(
stationMap
.
getKey
(),
100.0
)
>
areaHighScore
)
{
areaHighScore
=
stationHealthIndexMap
.
getOrDefault
(
stationMap
.
getKey
(),
100.0
);
}
}
FullViewRecallInfoDTO
stationDto
=
new
FullViewRecallInfoDTO
();
stationDto
.
setKey
(
areaMapDto
.
getKey
()
+
"-"
+
stationInt
);
stationDto
.
setName
(
stationMap
.
getKey
());
stationDto
.
setStatus
(
""
);
stationDto
.
setScore
(
stationHealthIndexMap
.
getOrDefault
(
stationMap
.
getKey
(),
100.0
));
LambdaQueryWrapper
<
IdxBizFanHealthLevel
>
stationQuery
=
new
LambdaQueryWrapper
<>();
stationQuery
.
like
(
IdxBizFanHealthLevel:
:
getStatus
,
stationMap
.
getKey
());
stationQuery
.
eq
(
IdxBizFanHealthLevel:
:
getAnalysisObjType
,
"场站"
);
stationQuery
.
lt
(
IdxBizFanHealthLevel:
:
getGroupLowerLimit
,
stationDto
.
getScore
());
stationQuery
.
ge
(
IdxBizFanHealthLevel:
:
getGroupUpperLimit
,
stationDto
.
getScore
());
IdxBizFanHealthLevel
stationLevel
=
idxBizFanHealthLevelMapper
.
selectOne
(
stationQuery
);
stationDto
.
setStatus
(
ObjectUtils
.
isNotEmpty
(
stationLevel
)
?
stationLevel
.
getHealthLevel
()
:
""
);
if
(
ObjectUtils
.
isEmpty
(
stationLevel
))
{
LambdaQueryWrapper
<
IdxBizPvHealthLevel
>
stationPvQuery
=
new
LambdaQueryWrapper
<>();
stationPvQuery
.
like
(
IdxBizPvHealthLevel:
:
getStatus
,
stationMap
.
getKey
());
stationPvQuery
.
eq
(
IdxBizPvHealthLevel:
:
getAnalysisObjType
,
"场站"
);
stationPvQuery
.
lt
(
IdxBizPvHealthLevel:
:
getGroupLowerLimit
,
stationDto
.
getScore
());
stationPvQuery
.
ge
(
IdxBizPvHealthLevel:
:
getGroupUpperLimit
,
stationDto
.
getScore
());
IdxBizPvHealthLevel
stationPvLevel
=
idxBizPvHealthLevelMapper
.
selectOne
(
stationPvQuery
);
if
(
ObjectUtils
.
isNotEmpty
(
stationPvLevel
))
{
stationDto
.
setStatus
(
stationPvLevel
.
getHealthLevel
());
}
}
stationDto
.
setParentKey
(
areaMapDto
.
getKey
());
areaMapDto
.
getChildren
().
add
(
stationDto
);
stationInt
++;
for
(
Map
.
Entry
<
String
,
Map
<
String
,
Map
<
String
,
List
<
FullViewRecallDataDTO
>>>>
equipmentMap
:
stationMap
.
getValue
().
entrySet
())
{
if
(
stationLowScore
==
null
&&
stationHighScore
==
null
)
{
stationLowScore
=
equipmentIndexInfoMap
.
getOrDefault
(
equipmentMap
.
getKey
(),
100.0
);
stationHighScore
=
equipmentIndexInfoMap
.
getOrDefault
(
equipmentMap
.
getKey
(),
100.0
);
}
else
{
if
(
equipmentIndexInfoMap
.
getOrDefault
(
equipmentMap
.
getKey
(),
100.0
)
<
stationLowScore
)
{
stationLowScore
=
equipmentIndexInfoMap
.
getOrDefault
(
equipmentMap
.
getKey
(),
100.0
);
}
if
(
equipmentIndexInfoMap
.
getOrDefault
(
equipmentMap
.
getKey
(),
100.0
)
>
stationHighScore
)
{
stationHighScore
=
equipmentIndexInfoMap
.
getOrDefault
(
equipmentMap
.
getKey
(),
100.0
);
}
}
FullViewRecallInfoDTO
equipmentMapDto
=
new
FullViewRecallInfoDTO
();
equipmentMapDto
.
setKey
(
stationDto
.
getKey
()
+
"-"
+
equipmentInt
);
equipmentMapDto
.
setName
(
equipmentMap
.
getKey
());
equipmentMapDto
.
setScoreRange
(
""
);
IdxBizFanHealthLevel
levelInfo
=
getHealthLevelByScore
(
healthLevelInfoList
,
stationMap
.
getKey
(),
"设备"
,
equipmentIndexInfoMap
.
getOrDefault
(
equipmentMap
.
getKey
(),
100.0
));
equipmentMapDto
.
setStatus
(
levelInfo
.
getHealthLevel
());
equipmentMapDto
.
setScore
(
equipmentIndexInfoMap
.
getOrDefault
(
equipmentMap
.
getKey
(),
100.0
));
equipmentMapDto
.
setParentKey
(
stationDto
.
getKey
());
stationDto
.
getChildren
().
add
(
equipmentMapDto
);
equipmentInt
++;
for
(
Map
.
Entry
<
String
,
Map
<
String
,
List
<
FullViewRecallDataDTO
>>>
subSystemMap
:
equipmentMap
.
getValue
().
entrySet
())
{
FullViewRecallInfoDTO
subSystemMapDto
=
new
FullViewRecallInfoDTO
();
subSystemMapDto
.
setKey
(
equipmentMapDto
.
getKey
()
+
"-"
+
subSystemInt
);
subSystemMapDto
.
setName
(
subSystemMap
.
getKey
());
subSystemMapDto
.
setScoreRange
(
""
);
// subSystemMapDto.setStatus(null);
IdxBizFanHealthLevel
levelInfoZxt
=
getHealthLevelByScore
(
healthLevelInfoList
,
stationMap
.
getKey
(),
"子系统"
,
subSystemIndexInfoMap
.
getOrDefault
(
subSystemMap
.
getKey
(),
100.0
));
subSystemMapDto
.
setStatus
(
levelInfoZxt
.
getHealthLevel
());
subSystemMapDto
.
setScore
(
subSystemIndexInfoMap
.
getOrDefault
(
subSystemMap
.
getKey
(),
100.0
));
subSystemMapDto
.
setParentKey
(
equipmentMapDto
.
getKey
());
equipmentMapDto
.
getChildren
().
add
(
subSystemMapDto
);
subSystemInt
++;
for
(
Map
.
Entry
<
String
,
List
<
FullViewRecallDataDTO
>>
pointNameMap
:
subSystemMap
.
getValue
().
entrySet
())
{
FullViewRecallInfoDTO
pointNameMapDto
=
new
FullViewRecallInfoDTO
();
pointNameMapDto
.
setKey
(
subSystemMapDto
.
getKey
()
+
"-"
+
pointNameInt
);
pointNameMapDto
.
setName
(
pointNameMap
.
getKey
());
FullViewRecallDataDTO
fullViewRecallDataDTO
=
pointNameMap
.
getValue
().
get
(
0
);
pointNameMapDto
.
setScoreRange
(
""
);
IdxBizFanHealthLevel
levelInfoBL
=
getHealthLevelByScore
(
healthLevelInfoList
,
stationMap
.
getKey
(),
"测点"
,
pointNameIndexInfoMap
.
getOrDefault
(
fullViewRecallDataDTO
.
getStation
()
+
"_"
+
fullViewRecallDataDTO
.
getIndexAddress
(),
100.0
));
pointNameMapDto
.
setStatus
(
levelInfoBL
.
getHealthLevel
());
pointNameMapDto
.
setScore
(
pointNameIndexInfoMap
.
getOrDefault
(
fullViewRecallDataDTO
.
getStation
()
+
"_"
+
fullViewRecallDataDTO
.
getIndexAddress
(),
100.0
));
pointNameMapDto
.
setParentKey
(
subSystemMapDto
.
getKey
());
subSystemMapDto
.
getChildren
().
add
(
pointNameMapDto
);
pointNameInt
++;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/getFanWarningRecordInfo"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"分页查询健康指数信息 - 风电"
,
notes
=
"分页查询健康指数信息 - 风电"
)
public
ResponseModel
<
Page
<
FanWarningRecord
>>
getFanWarningRecordInfo
(
@RequestBody
FanHealthIndexDto
dto
)
throws
ParseException
{
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getStartDate
()))
{
String
startDate
=
dto
.
getStartDate
();
Date
date
=
DateUtils
.
dateParse
(
startDate
,
DATE_TIME_PATTERN
);
String
startDateString
=
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
date
,
-
8
),
DATE_TIME_PATTERN
);
dto
.
setStartDate
(
startDateString
);
}
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getEndDate
()))
{
String
endDate
=
dto
.
getEndDate
();
Date
endDateDate
=
DateUtils
.
dateParse
(
endDate
,
DATE_TIME_PATTERN
);
String
endDateString
=
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
endDateDate
,
-
8
),
DATE_TIME_PATTERN
);
dto
.
setEndDate
(
endDateString
);
}
Page
<
FanWarningRecord
>
resultPage
=
new
Page
<>(
dto
.
getCurrent
(),
dto
.
getSize
());
dto
.
setCurrent
((
dto
.
getCurrent
()
-
1
)
*
dto
.
getSize
());
List
<
Map
<
String
,
String
>>
orderWeight
=
dto
.
getSorts
().
stream
().
sorted
(
Comparator
.
comparing
(
t
->
Integer
.
parseInt
(
t
.
get
(
"orderWeight"
)))).
collect
(
Collectors
.
toList
());
List
<
String
>
orderByList
=
new
ArrayList
<>();
for
(
Map
<
String
,
String
>
map
:
orderWeight
)
{
String
replace
=
map
.
get
(
"order"
).
replace
(
"end"
,
""
);
String
columnOrder
=
map
.
get
(
"columnKey"
)
+
" "
+
replace
;
orderByList
.
add
(
columnOrder
);
}
stationDto
.
setScoreRange
(
"(最高:"
+
stationLowScore
+
"分, 最低:"
+
stationHighScore
+
"分)"
);
String
join
=
String
.
join
(
","
,
orderByList
);
dto
.
setOrderColumns
(
join
);
List
<
FanWarningRecord
>
fanWarningRecordsIPage
=
fanWaringRecordMapper
.
getInfoByPage
(
dto
);
Integer
infoByPageTotal
=
fanWaringRecordMapper
.
getInfoByPageTotal
(
dto
);
resultPage
.
setRecords
(
fanWarningRecordsIPage
);
resultPage
.
setTotal
(
infoByPageTotal
);
return
ResponseHelper
.
buildResponse
(
resultPage
);
}
areaMapDto
.
setScoreRange
(
"(最高:"
+
areaLowScore
+
"分, 最低:"
+
areaHighScore
+
"分)"
);
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/getPvWarningRecordInfo"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"分页查询健康指数信息 - 光伏"
,
notes
=
"分页查询健康指数信息 - 光伏"
)
public
ResponseModel
<
Page
<
PvWarningRecord
>>
getPvWarningRecordInfo
(
@RequestBody
FanHealthIndexDto
dto
)
throws
ParseException
{
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getStartDate
()))
{
String
startDate
=
dto
.
getStartDate
();
Date
date
=
DateUtils
.
dateParse
(
startDate
,
DATE_TIME_PATTERN
);
String
startDateString
=
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
date
,
-
8
),
DATE_TIME_PATTERN
);
dto
.
setStartDate
(
startDateString
);
}
List
<
FullViewRecallInfoDTO
>
resultList
=
new
ArrayList
<>();
resultList
.
add
(
allMapDto
);
return
ResponseHelper
.
buildResponse
(
resultList
);
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getEndDate
()))
{
String
endDate
=
dto
.
getEndDate
();
Date
endDateDate
=
DateUtils
.
dateParse
(
endDate
,
DATE_TIME_PATTERN
);
String
endDateString
=
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
endDateDate
,
-
8
),
DATE_TIME_PATTERN
);
dto
.
setEndDate
(
endDateString
);
}
private
IdxBizFanHealthLevel
getHealthLevelByScore
(
List
<
IdxBizFanHealthLevel
>
healthLevelInfoList
,
String
station
,
String
type
,
Double
score
)
{
IdxBizFanHealthLevel
resultDto
=
new
IdxBizFanHealthLevel
();
String
stationType
=
"风电站"
;
List
<
IdxBizFanHealthLevel
>
collect
=
healthLevelInfoList
.
stream
().
filter
(
item
->
item
.
getAnalysisObjType
().
contains
(
station
)).
collect
(
Collectors
.
toList
());
for
(
IdxBizFanHealthLevel
item
:
collect
)
{
if
(
item
.
getAnalysisObjType
().
contains
(
"子阵"
))
{
stationType
=
"光伏站"
;
break
;
}
}
for
(
IdxBizFanHealthLevel
item
:
collect
)
{
if
(
type
.
equals
(
"设备"
)
&&
stationType
.
equals
(
"风电站"
)
&&
item
.
getAnalysisObjType
().
contains
(
type
)
&&
score
>=
item
.
getGroupLowerLimit
()
&&
score
<=
item
.
getGroupUpperLimit
())
{
resultDto
=
item
;
break
;
}
if
(
type
.
equals
(
"子系统"
)
&&
stationType
.
equals
(
"风电站"
)
&&
item
.
getAnalysisObjType
().
contains
(
type
)
&&
score
>=
item
.
getGroupLowerLimit
()
&&
score
<=
item
.
getGroupUpperLimit
())
{
resultDto
=
item
;
break
;
}
if
(
type
.
equals
(
"测点"
)
&&
item
.
getAnalysisObjType
().
contains
(
type
)
&&
score
>=
item
.
getGroupLowerLimit
()
&&
score
<=
item
.
getGroupUpperLimit
())
{
resultDto
=
item
;
break
;
}
if
(
type
.
equals
(
"设备"
)
&&
stationType
.
equals
(
"光伏站"
)
&&
item
.
getAnalysisObjType
().
contains
(
"子阵"
)
&&
score
>=
item
.
getGroupLowerLimit
()
&&
score
<=
item
.
getGroupUpperLimit
())
{
resultDto
=
item
;
break
;
}
if
(
type
.
equals
(
"子系统"
)
&&
stationType
.
equals
(
"光伏站"
)
&&
item
.
getAnalysisObjType
().
contains
(
"设备"
)
&&
score
>=
item
.
getGroupLowerLimit
()
&&
score
<=
item
.
getGroupUpperLimit
())
{
resultDto
=
item
;
break
;
}
Page
<
PvWarningRecord
>
resultPage
=
new
Page
<>(
dto
.
getCurrent
(),
dto
.
getSize
());
dto
.
setCurrent
((
dto
.
getCurrent
()
-
1
)
*
dto
.
getSize
());
List
<
Map
<
String
,
String
>>
orderWeight
=
dto
.
getSorts
().
stream
().
sorted
(
Comparator
.
comparing
(
t
->
Integer
.
parseInt
(
t
.
get
(
"orderWeight"
)))).
collect
(
Collectors
.
toList
());
List
<
String
>
orderByList
=
new
ArrayList
<>();
for
(
Map
<
String
,
String
>
map
:
orderWeight
)
{
String
replace
=
map
.
get
(
"order"
).
replace
(
"end"
,
""
);
String
columnOrder
=
map
.
get
(
"columnKey"
)
+
" "
+
replace
;
orderByList
.
add
(
columnOrder
);
}
return
resultDto
;
String
join
=
String
.
join
(
","
,
orderByList
);
dto
.
setOrderColumns
(
join
);
List
<
PvWarningRecord
>
pvWarningRecords
=
pvWaringRecordMapper
.
getInfoByPage
(
dto
);
Integer
infoByPageTotal
=
pvWaringRecordMapper
.
getInfoByPageTotal
(
dto
);
resultPage
.
setRecords
(
pvWarningRecords
);
resultPage
.
setTotal
(
infoByPageTotal
);
return
ResponseHelper
.
buildResponse
(
resultPage
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/dto/FanHealthIndexDto.java
View file @
3457cfb9
...
...
@@ -37,4 +37,8 @@ public class FanHealthIndexDto implements Serializable {
private
Integer
current
;
private
Integer
size
;
private
String
orderColumns
;
private
String
warningName
;
private
String
warningStatus
;
private
String
disposotionState
;
private
String
subarray
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdMapper2/FanWaringRecordMapper.java
View file @
3457cfb9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
tdMapper2
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.FanHealthIndexDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -25,4 +26,8 @@ public interface FanWaringRecordMapper extends BaseMapper<FanWarningRecord> {
int
saveBatchWarningRecords
(
@Param
(
"list"
)
List
<
FanWarningRecord
>
list
);
List
<
FanWarningRecord
>
getInfoByPage
(
@Param
(
"dto"
)
FanHealthIndexDto
dto
);
Integer
getInfoByPageTotal
(
@Param
(
"dto"
)
FanHealthIndexDto
dto
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdMapper2/PvWaringRecordMapper.java
View file @
3457cfb9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
tdMapper2
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.FanHealthIndexDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -19,4 +20,9 @@ public interface PvWaringRecordMapper extends BaseMapper<PvWarningRecord> {
List
<
PvWarningRecord
>
selectWarningPoint
(
String
STATION
,
String
EQUIPMENTNAME
,
String
SUBARRAY
);
List
<
Map
<
String
,
Object
>>
selectEquipWarningTotal
(
String
STATION
,
String
EQUIPMENTNAME
,
String
SUBARRAY
);
List
<
PvWarningRecord
>
getInfoByPage
(
@Param
(
"dto"
)
FanHealthIndexDto
dto
);
Integer
getInfoByPageTotal
(
@Param
(
"dto"
)
FanHealthIndexDto
dto
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/FanWarningRecord.xml
View file @
3457cfb9
...
...
@@ -177,4 +177,38 @@
`b`.`STATION`,
`b`.`EQUIPMENT_NAME`
</select>
<select
id=
"getInfoByPage"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord"
>
SELECT * FROM fan_warning_record
<where>
<if
test=
"dto.area!= null and dto.area!= ''"
>
AND arae = #{dto.area}
</if>
<if
test=
"dto.station!= null and dto.station!= ''"
>
AND station = #{dto.station}
</if>
<if
test=
"dto.equipmentName!= null and dto.equipmentName!= ''"
>
AND equipment_name = #{dto.equipmentName}
</if>
<if
test=
"dto.subSystem!= null and dto.subSystem!= ''"
>
AND sub_system = #{dto.subSystem}
</if>
<if
test=
"dto.pointName!= null and dto.pointName!= ''"
>
AND point_name = #{dto.pointName}
</if>
<if
test=
"dto.warningName!= null and dto.warningName!= ''"
>
AND warning_name = #{dto.warningName}
</if>
<if
test=
"dto.disposotionState!= null and dto.disposotionState!= ''"
>
AND disposotion_state = #{dto.disposotionState}
</if>
<if
test=
"dto.endDate!= null and dto.endDate!= '' "
>
and ts
<
= #{dto.endDate}
</if>
<if
test=
"dto.startDate!= null and dto.startDate!= ''"
>
and ts
>
= #{dto.startDate}
</if>
</where>
<if
test=
"dto.orderColumns != null and dto.orderColumns != ''"
>
order by ${dto.orderColumns}
</if>
limit #{dto.current}, #{dto.size}
</select>
<select
id=
"getInfoByPageTotal"
resultType=
"java.lang.Integer"
>
SELECT count(1) FROM fan_warning_record
<where>
<if
test=
"dto.area!= null and dto.area!= ''"
>
AND arae = #{dto.area}
</if>
<if
test=
"dto.station!= null and dto.station!= ''"
>
AND station = #{dto.station}
</if>
<if
test=
"dto.equipmentName!= null and dto.equipmentName!= ''"
>
AND equipment_name = #{dto.equipmentName}
</if>
<if
test=
"dto.subSystem!= null and dto.subSystem!= ''"
>
AND sub_system = #{dto.subSystem}
</if>
<if
test=
"dto.pointName!= null and dto.pointName!= ''"
>
AND point_name = #{dto.pointName}
</if>
<if
test=
"dto.warningName!= null and dto.warningName!= ''"
>
AND warning_name = #{dto.warningName}
</if>
<if
test=
"dto.disposotionState!= null and dto.disposotionState!= ''"
>
AND disposotion_state = #{dto.disposotionState}
</if>
<if
test=
"dto.endDate!= null and dto.endDate!= '' "
>
and ts
<
= #{dto.endDate}
</if>
<if
test=
"dto.startDate!= null and dto.startDate!= ''"
>
and ts
>
= #{dto.startDate}
</if>
</where>
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/PvWarningRecord.xml
View file @
3457cfb9
...
...
@@ -193,4 +193,38 @@
`b`.`STATION`,
`b`.`EQUIPMENT_NAME`
</select>
<select
id=
"getInfoByPage"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord"
>
SELECT * FROM fan_warning_record
<where>
<if
test=
"dto.area!= null and dto.area!= ''"
>
AND arae = #{dto.area}
</if>
<if
test=
"dto.station!= null and dto.station!= ''"
>
AND station = #{dto.station}
</if>
<if
test=
"dto.equipmentName!= null and dto.equipmentName!= ''"
>
AND equipment_name = #{dto.equipmentName}
</if>
<if
test=
"dto.subarray!= null and dto.subarray!= ''"
>
AND subarray = #{dto.subarray}
</if>
<if
test=
"dto.pointName!= null and dto.pointName!= ''"
>
AND point_name = #{dto.pointName}
</if>
<if
test=
"dto.warningName!= null and dto.warningName!= ''"
>
AND warning_name = #{dto.warningName}
</if>
<if
test=
"dto.disposotionState!= null and dto.disposotionState!= ''"
>
AND disposotion_state = #{dto.disposotionState}
</if>
<if
test=
"dto.endDate!= null and dto.endDate!= '' "
>
and ts
<
= #{dto.endDate}
</if>
<if
test=
"dto.startDate!= null and dto.startDate!= ''"
>
and ts
>
= #{dto.startDate}
</if>
</where>
<if
test=
"dto.orderColumns != null and dto.orderColumns != ''"
>
order by ${dto.orderColumns}
</if>
limit #{dto.current}, #{dto.size}
</select>
<select
id=
"getInfoByPageTotal"
resultType=
"java.lang.Integer"
>
SELECT count(1) FROM fan_warning_record
<where>
<if
test=
"dto.area!= null and dto.area!= ''"
>
AND arae = #{dto.area}
</if>
<if
test=
"dto.station!= null and dto.station!= ''"
>
AND station = #{dto.station}
</if>
<if
test=
"dto.equipmentName!= null and dto.equipmentName!= ''"
>
AND equipment_name = #{dto.equipmentName}
</if>
<if
test=
"dto.subarray!= null and dto.subarray!= ''"
>
AND subarray = #{dto.subarray}
</if>
<if
test=
"dto.pointName!= null and dto.pointName!= ''"
>
AND point_name = #{dto.pointName}
</if>
<if
test=
"dto.warningName!= null and dto.warningName!= ''"
>
AND warning_name = #{dto.warningName}
</if>
<if
test=
"dto.disposotionState!= null and dto.disposotionState!= ''"
>
AND disposotion_state = #{dto.disposotionState}
</if>
<if
test=
"dto.endDate!= null and dto.endDate!= '' "
>
and ts
<
= #{dto.endDate}
</if>
<if
test=
"dto.startDate!= null and dto.startDate!= ''"
>
and ts
>
= #{dto.startDate}
</if>
</where>
</select>
</mapper>
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