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
e46ea76c
Commit
e46ea76c
authored
Jun 05, 2024
by
wujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改预警生成
parent
aebda8e7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
21 deletions
+48
-21
KafkaConsumerService.java
...mos/boot/module/jxiop/biz/kafka/KafkaConsumerService.java
+0
-1
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+0
-2
HealthStatusIndicatorServiceImpl.java
...op/biz/service/impl/HealthStatusIndicatorServiceImpl.java
+31
-18
TdengineTimeServiceImpl.java
...odule/jxiop/biz/service/impl/TdengineTimeServiceImpl.java
+17
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/kafka/KafkaConsumerService.java
View file @
e46ea76c
...
...
@@ -77,7 +77,6 @@ public class KafkaConsumerService {
// 相关性
@Value
(
"${base.url.XGX:http://10.20.1.29:8052/intelligent-analysis/correlation}"
)
private
String
baseUrlXGX
;
// 工况划分
@Value
(
"${base.url.GKHF:http://10.20.1.29:8052/intelligent-analysis/working-condition-division}"
)
private
String
baseUrlGKHF
;
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
View file @
e46ea76c
...
...
@@ -2115,8 +2115,6 @@ public class CommonServiceImpl {
"------------------------------------------调用风机健康指数计算算法结束----------------------------------------"
);
logger
.
info
(
"------------------------------------------开始计算预警----------------------------------------"
);
// healthStatusIndicatorService.healthWarningMinute(calendar, time);
// ++++++++++
healthStatusIndicatorService
.
healthWarningMinute
(
time
);
}
catch
(
Exception
e
)
{
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/HealthStatusIndicatorServiceImpl.java
View file @
e46ea76c
...
...
@@ -713,11 +713,10 @@ public class HealthStatusIndicatorServiceImpl {
/***
* 每五小时获取一次最大粒度内的指数异常数据
* 判断五小时内数据是否符合预警规则 符合则报警并在redis中缓存 同一级别的预警记录下次不生成
*
*
TdengineTimeServiceImpl计算完调用
*/
@Scheduled
(
cron
=
"0 0 0/1 * * ?"
)
// @Scheduled(cron = "0 0/5 * * * ?")
//@Scheduled(cron = "0 0 0/1 * * ?")
@Async
(
"async"
)
public
void
healthWarningHourGF
()
{
if
(!
openHealth
)
{
...
...
@@ -1093,10 +1092,10 @@ public class HealthStatusIndicatorServiceImpl {
/***
* 每三天取一次最大粒度内的指数异常数据
* 判断三天内数据是否符合预警规则 符合则报警并在redis中缓存 同一级别的预警记录下次不生成
*
*
TdengineTimeServiceImpl计算完调用
*/
@Scheduled
(
cron
=
"0 0 0 0/1 * ? "
)
//
@Scheduled(cron = "0 0 0 0/1 * ? ")
@Async
(
"async"
)
public
void
healthWarningDayGF
()
{
if
(!
openHealth
)
{
...
...
@@ -1475,7 +1474,6 @@ public class HealthStatusIndicatorServiceImpl {
// @Scheduled(cron = "0 0 */1 * * ?")
@Async
(
"async"
)
//@PostConstruct
public
void
healthWarningMinute
(
Date
time
)
{
if
(!
openHealth
)
{
return
;
...
...
@@ -1483,9 +1481,8 @@ public class HealthStatusIndicatorServiceImpl {
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// Date time=null;
// try {
// time = simpleDateFormat.parse("2024-0
3-14 13:5
0:00");
// time = simpleDateFormat.parse("2024-0
6-04 17:0
0:00");
// } catch (ParseException e1) {
// // TODO Auto-generated catch block
// e1.printStackTrace();
// }
// Calendar calendar = Calendar.getInstance();
...
...
@@ -1887,16 +1884,25 @@ public class HealthStatusIndicatorServiceImpl {
/***
* 每五小时获取一次最大粒度内的指数异常数据
* 判断五小时内数据是否符合预警规则 符合则报警并在redis中缓存 同一级别的预警记录下次不生成
*
*
TdengineTimeServiceImpl计算完调用
*/
@Scheduled
(
cron
=
"0 0 0/1 * * ?"
)
//
@Scheduled(cron = "0 0 0/1 * * ?")
@Async
(
"async"
)
@PostConstruct
public
void
healthWarningHour
()
{
if
(!
openHealth
)
{
return
;
}
Date
time
=
new
Date
();
// if (!openHealth) {
// return;
// }
// Date time = new Date();
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
Date
time
=
null
;
try
{
time
=
simpleDateFormat
.
parse
(
"2024-06-04 17:00:00"
);
}
catch
(
ParseException
e1
)
{
e1
.
printStackTrace
();
}
String
format
=
DateUtil
.
format
(
time
,
"yyyy-MM-dd HH:00:00"
);
// Date date = DateUtils.dateAddHours(time, -13);
// Calendar calendar = Calendar.getInstance();
...
...
@@ -1937,6 +1943,12 @@ public class HealthStatusIndicatorServiceImpl {
Map
<
String
,
List
<
FanHealthIndexHour
>>
healthDataMaps
=
gateWayMaps
.
get
(
gateWayId
);
for
(
String
address
:
healthDataMaps
.
keySet
())
{
//桨叶目标位置B
if
(!
"22046"
.
equals
(
address
))
{
continue
;
}
List
<
FanHealthIndexHour
>
idxBizFanHealthIndices
=
healthDataMaps
.
get
(
address
);
List
<
IdxBizFanWarningRuleSet
>
idxBizPvWarningRuleSets
=
idxBizPvWarningRules
.
stream
().
filter
(
t
->
t
.
getAnalysisPointId
().
equals
(
idxBizFanHealthIndices
.
get
(
0
).
getAnalysisObjSeq
())).
collect
(
Collectors
.
toList
());
...
...
@@ -2070,9 +2082,10 @@ public class HealthStatusIndicatorServiceImpl {
// tdengine插入
fanWaringRecordMapper
.
saveBatchWarningRecords
(
tdFanWarningRecordList
);
// 触发风险模型生成预警处置模块的预警记录
fetchDataFan
(
tdFanWarningRecordList
,
stationMap
);
}
// 触发风险模型生成预警处置模块的预警记录
fetchDataFan
(
tdFanWarningRecordList
,
stationMap
);
}
// @Scheduled(cron = "0 0 0/1 * * ?")
...
...
@@ -2270,10 +2283,10 @@ public class HealthStatusIndicatorServiceImpl {
/***
* 每三天取一次最大粒度内的指数异常数据
* 判断三天内数据是否符合预警规则 符合则报警并在redis中缓存 同一级别的预警记录下次不生成
*
*
TdengineTimeServiceImpl计算完调用
*/
@Scheduled
(
cron
=
"0 0 0 0/1 * ? "
)
//
@Scheduled(cron = "0 0 0 0/1 * ? ")
@Async
(
"async"
)
public
void
healthWarningDay
()
{
if
(!
openHealth
)
{
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/TdengineTimeServiceImpl.java
View file @
e46ea76c
...
...
@@ -50,6 +50,9 @@ public class TdengineTimeServiceImpl {
@Value
(
"${openHealth:true}"
)
Boolean
openHealth
;
@Autowired
private
HealthStatusIndicatorServiceImpl
healthStatusIndicatorServiceImpl
;
/**
* 风电 - 按时刻生成子系统、设备、场站、区域 数据
...
...
@@ -118,6 +121,9 @@ public class TdengineTimeServiceImpl {
List
<
IdxBizFanHealthLevel
>
levelListQg
=
idxBizFanHealthLevelMapper
.
selectList
(
new
LambdaQueryWrapper
<
IdxBizFanHealthLevel
>().
eq
(
IdxBizFanHealthLevel:
:
getAnalysisObjType
,
"全域"
).
last
(
"limit 4"
));
List
<
FanHealthIndex
>
fanHealthIndicesQg
=
fanHealthIndexMapper
.
getInfoListByGroupByQgFan
(
startTime
,
"fan_health_index_moment"
,
"片区"
);
saveBatchFan
(
fanHealthIndicesQg
,
"fan_health_index_hour"
,
recDate
,
WarningPeriodEnum
.
HOUR
.
getName
(),
levelListQg
);
//预警生成
healthStatusIndicatorServiceImpl
.
healthWarningHour
();
}
/**
...
...
@@ -157,6 +163,9 @@ public class TdengineTimeServiceImpl {
List
<
IdxBizFanHealthLevel
>
levelListQg
=
idxBizFanHealthLevelMapper
.
selectList
(
new
LambdaQueryWrapper
<
IdxBizFanHealthLevel
>().
eq
(
IdxBizFanHealthLevel:
:
getAnalysisObjType
,
"全域"
).
last
(
"limit 4"
));
List
<
FanHealthIndex
>
fanHealthIndicesQg
=
fanHealthIndexMapper
.
getInfoListByGroupByQgFan
(
startTime
,
"fan_health_index_hour"
,
"片区"
);
saveBatchFan
(
fanHealthIndicesQg
,
"fan_health_index_day"
,
recDate
,
WarningPeriodEnum
.
DAY
.
getName
(),
levelListQg
);
//预警生成
healthStatusIndicatorServiceImpl
.
healthWarningDay
();
}
...
...
@@ -224,6 +233,8 @@ public class TdengineTimeServiceImpl {
List
<
IdxBizPvHealthLevel
>
levelListQg
=
idxBizPvHealthLevelMapper
.
selectList
(
new
LambdaQueryWrapper
<
IdxBizPvHealthLevel
>().
eq
(
IdxBizPvHealthLevel:
:
getAnalysisObjType
,
"全域"
).
last
(
"limit 4"
));
List
<
PvHealthIndex
>
fanHealthIndicesQg
=
pvHealthIndexMapper
.
getInfoListByGroupByQgPv
(
startTime
,
"pv_health_index_moment"
,
"片区"
);
saveBatchPv
(
fanHealthIndicesQg
,
"pv_health_index_moment"
,
recDate
,
WarningPeriodEnum
.
MINUTES
.
getName
(),
levelListQg
);
}
/**
...
...
@@ -262,6 +273,9 @@ public class TdengineTimeServiceImpl {
List
<
IdxBizPvHealthLevel
>
levelListQg
=
idxBizPvHealthLevelMapper
.
selectList
(
new
LambdaQueryWrapper
<
IdxBizPvHealthLevel
>().
eq
(
IdxBizPvHealthLevel:
:
getAnalysisObjType
,
"全域"
).
last
(
"limit 4"
));
List
<
PvHealthIndex
>
fanHealthIndicesQg
=
pvHealthIndexMapper
.
getInfoListByGroupByQgPv
(
startTime
,
"pv_health_index_moment"
,
"片区"
);
saveBatchPv
(
fanHealthIndicesQg
,
"pv_health_index_hour"
,
recDate
,
WarningPeriodEnum
.
HOUR
.
getName
(),
levelListQg
);
//预警生成
healthStatusIndicatorServiceImpl
.
healthWarningHourGF
();
}
/**
...
...
@@ -300,6 +314,9 @@ public class TdengineTimeServiceImpl {
List
<
IdxBizPvHealthLevel
>
levelListQg
=
idxBizPvHealthLevelMapper
.
selectList
(
new
LambdaQueryWrapper
<
IdxBizPvHealthLevel
>().
eq
(
IdxBizPvHealthLevel:
:
getAnalysisObjType
,
"全域"
).
last
(
"limit 4"
));
List
<
PvHealthIndex
>
fanHealthIndicesQg
=
pvHealthIndexMapper
.
getInfoListByGroupByQgPv
(
startTime
,
"pv_health_index_hour"
,
"片区"
);
saveBatchPv
(
fanHealthIndicesQg
,
"pv_health_index_day"
,
recDate
,
WarningPeriodEnum
.
DAY
.
getName
(),
levelListQg
);
//预警生成
healthStatusIndicatorServiceImpl
.
healthWarningDayGF
();
}
...
...
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