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
779ac0bc
Commit
779ac0bc
authored
Aug 13, 2024
by
朱晨阳
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
3062c920
cd0d13a5
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
202 additions
and
76 deletions
+202
-76
TdInfoQueryController.java
...ot/module/jxiop/biz/controller/TdInfoQueryController.java
+50
-35
IdxBizFanPointVarCorrelation.java
...module/jxiop/biz/entity/IdxBizFanPointVarCorrelation.java
+3
-0
IdxBizPvPointVarCorrelation.java
.../module/jxiop/biz/entity/IdxBizPvPointVarCorrelation.java
+4
-0
Constant.java
...om/yeejoin/amos/boot/module/jxiop/biz/kafka/Constant.java
+6
-6
FanConditionVariablesMessage.java
.../module/jxiop/biz/kafka/FanConditionVariablesMessage.java
+90
-10
KafkaConsumerService.java
...mos/boot/module/jxiop/biz/kafka/KafkaConsumerService.java
+2
-0
SyncESDataToTdengineMqttListener.java
.../jxiop/biz/listener/SyncESDataToTdengineMqttListener.java
+40
-18
TdengineTimeServiceImpl.java
...odule/jxiop/biz/service/impl/TdengineTimeServiceImpl.java
+2
-2
PvHealthIndexMapper.java
.../boot/module/jxiop/biz/tdMapper2/PvHealthIndexMapper.java
+1
-1
application-kingbase8.properties
...e-biz/src/main/resources/application-kingbase8.properties
+3
-3
FanHealthIndex.xml
...iz/src/main/resources/mapper/tdengine2/FanHealthIndex.xml
+1
-1
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 @
779ac0bc
...
@@ -88,9 +88,11 @@ public class TdInfoQueryController extends BaseController {
...
@@ -88,9 +88,11 @@ public class TdInfoQueryController extends BaseController {
@PostMapping
(
value
=
"/getFanHealthIndexInfo"
)
@PostMapping
(
value
=
"/getFanHealthIndexInfo"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"分页查询健康指数信息 - 风电"
,
notes
=
"分页查询健康指数信息 - 风电"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"分页查询健康指数信息 - 风电"
,
notes
=
"分页查询健康指数信息 - 风电"
)
@GatewayIdAutowired
@GatewayIdAutowired
public
ResponseModel
<
Page
<
FanHealthIndex
>>
getFanHealthIndexInfo
(
@RequestBody
FanHealthIndexDto
dto
)
throws
ParseException
{
public
ResponseModel
<
Page
<
FanHealthIndex
>>
getFanHealthIndexInfo
(
@RequestBody
FanHealthIndexDto
dto
)
throws
Exception
{
if
(
dto
.
getEndDate
()==
null
||
dto
.
getStartDate
()==
null
)
{
throw
new
Exception
(
"请选择开始时间和结束时间"
);
}
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
userId
=
reginParams
.
getUserModel
().
getUserId
();
String
userId
=
reginParams
.
getUserModel
().
getUserId
();
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
new
QueryWrapper
<
StdUserEmpower
>().
eq
(
"amos_user_id"
,
userId
).
eq
(
"permission_type"
,
"YTH"
));
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
new
QueryWrapper
<
StdUserEmpower
>().
eq
(
"amos_user_id"
,
userId
).
eq
(
"permission_type"
,
"YTH"
));
...
@@ -102,24 +104,20 @@ public class TdInfoQueryController extends BaseController {
...
@@ -102,24 +104,20 @@ public class TdInfoQueryController extends BaseController {
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getStartDate
()))
{
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getStartDate
()))
{
String
startDate
=
dto
.
getStartDate
();
String
startDate
=
dto
.
getStartDate
();
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
startDate
.
length
()
==
10
)
{
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
startDate
.
length
()
==
10
)
{
l
ong
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_day"
,
startDate
,
"Asc "
);
L
ong
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_day"
,
startDate
,
"Asc "
);
dto
.
setStartDateTs
(
startTs
);
dto
.
setStartDateTs
(
startTs
);
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
startDate
.
length
()
==
13
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
startDate
.
length
()
==
13
)
{
l
ong
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_hour"
,
startDate
+
":00:00"
,
"Asc "
);
L
ong
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_hour"
,
startDate
+
":00:00"
,
"Asc "
);
dto
.
setStartDateTs
(
startTs
);
dto
.
setStartDateTs
(
startTs
);
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
startDate
.
length
()
==
16
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
startDate
.
length
()
==
16
)
{
String
nextWholeMinute
=
DateUtils
.
getNextWholeMinute
(
dto
.
getStartDate
()+
":00"
);
String
nextWholeMinute
=
DateUtils
.
getNextWholeMinute
(
dto
.
getStartDate
()+
":00"
);
l
ong
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_moment"
,
nextWholeMinute
,
"Asc "
);
L
ong
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_moment"
,
nextWholeMinute
,
"Asc "
);
dto
.
setStartDateTs
(
startTs
);
dto
.
setStartDateTs
(
startTs
);
}
else
{
}
else
{
l
ong
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_data"
,
startDate
+
" 00:00:00"
,
"Asc "
);
L
ong
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_data"
,
startDate
+
" 00:00:00"
,
"Asc "
);
dto
.
setStartDateTs
(
startTs
);
dto
.
setStartDateTs
(
startTs
);
}
}
}
}
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getEndDate
()))
{
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getEndDate
()))
{
String
dateNowShortStr
=
DateUtils
.
getDateNowShortStr
();
String
dateNowShortStr
=
DateUtils
.
getDateNowShortStr
();
...
@@ -129,22 +127,21 @@ public class TdInfoQueryController extends BaseController {
...
@@ -129,22 +127,21 @@ public class TdInfoQueryController extends BaseController {
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
DateUtils
.
DATE_PATTERN
);
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
DateUtils
.
DATE_PATTERN
);
endDate
=
formatter
.
format
(
date
);
endDate
=
formatter
.
format
(
date
);
}
}
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
endDate
.
length
()
==
10
)
{
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
endDate
.
length
()
==
10
)
{
l
ong
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_day"
,
endDate
,
"desc "
);
L
ong
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_day"
,
endDate
,
"desc "
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setTableName
(
"fan_health_index_day"
);
dto
.
setTableName
(
"fan_health_index_day"
);
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
endDate
.
length
()
==
13
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
endDate
.
length
()
==
13
)
{
l
ong
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_hour"
,
endDate
+
":00:00"
,
"desc "
);
L
ong
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_hour"
,
endDate
+
":00:00"
,
"desc "
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setTableName
(
"fan_health_index_hour"
);
dto
.
setTableName
(
"fan_health_index_hour"
);
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
endDate
.
length
()
==
16
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
endDate
.
length
()
==
16
)
{
String
nextWholeMinute
=
DateUtils
.
getBeforeWholeMinute
(
endDate
+
":00"
);
String
nextWholeMinute
=
DateUtils
.
getBeforeWholeMinute
(
endDate
+
":00"
);
l
ong
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_moment"
,
nextWholeMinute
,
"desc "
);
L
ong
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_moment"
,
nextWholeMinute
,
"desc "
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setTableName
(
"fan_health_index_moment"
);
dto
.
setTableName
(
"fan_health_index_moment"
);
}
else
{
}
else
{
l
ong
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_data"
,
endDate
+
" 00:00:00"
,
"desc "
);
L
ong
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_data"
,
endDate
+
" 00:00:00"
,
"desc "
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setTableName
(
"fan_health_index_data"
);
dto
.
setTableName
(
"fan_health_index_data"
);
}
}
...
@@ -175,9 +172,17 @@ public class TdInfoQueryController extends BaseController {
...
@@ -175,9 +172,17 @@ public class TdInfoQueryController extends BaseController {
String
orderColumn
=
convert
(
split
[
0
])
+
" "
+
replace
;
String
orderColumn
=
convert
(
split
[
0
])
+
" "
+
replace
;
dto
.
setSortOne
(
orderColumn
);
dto
.
setSortOne
(
orderColumn
);
}
}
if
(
dto
.
getEndDateTs
()==
null
&&
dto
.
getStartDateTs
()==
null
)
{
return
ResponseHelper
.
buildResponse
(
resultPage
);
}
List
<
FanHealthIndex
>
fanHealthIndexIPage
=
fanHealthIndexMapper
.
getInfoByPage
(
dto
);
List
<
FanHealthIndex
>
fanHealthIndexIPage
=
fanHealthIndexMapper
.
getInfoByPage
(
dto
);
fanHealthIndexIPage
.
forEach
(
item
->
item
.
setHealthIndex
(
Double
.
valueOf
(
df
.
format
(
item
.
getHealthIndex
()))));
fanHealthIndexIPage
.
forEach
(
item
->
{
item
.
setHealthIndex
(
Double
.
valueOf
(
df
.
format
(
item
.
getHealthIndex
())));
if
(
null
!=
dto
.
getAnalysisType
()){
item
.
setAnalysisType
(
dto
.
getAnalysisType
());
}
});
Integer
infoByPageTotal
=
fanHealthIndexMapper
.
getInfoByPageTotal
(
dto
);
Integer
infoByPageTotal
=
fanHealthIndexMapper
.
getInfoByPageTotal
(
dto
);
resultPage
.
setRecords
(
fanHealthIndexIPage
);
resultPage
.
setRecords
(
fanHealthIndexIPage
);
resultPage
.
setTotal
(
infoByPageTotal
);
resultPage
.
setTotal
(
infoByPageTotal
);
...
@@ -186,9 +191,9 @@ public class TdInfoQueryController extends BaseController {
...
@@ -186,9 +191,9 @@ public class TdInfoQueryController extends BaseController {
public
static
String
convert
(
String
camelCase
)
{
public
static
String
convert
(
String
camelCase
)
{
StringBuilder
result
=
new
StringBuilder
();
StringBuilder
result
=
new
StringBuilder
();
if
(
camelCase
.
equals
(
"analysisTime"
))
{
//
if (camelCase.equals("analysisTime")) {
return
"ts"
;
//
return "ts";
}
//
}
for
(
int
i
=
0
;
i
<
camelCase
.
length
();
i
++)
{
for
(
int
i
=
0
;
i
<
camelCase
.
length
();
i
++)
{
char
currentChar
=
camelCase
.
charAt
(
i
);
char
currentChar
=
camelCase
.
charAt
(
i
);
if
(
Character
.
isUpperCase
(
currentChar
))
{
if
(
Character
.
isUpperCase
(
currentChar
))
{
...
@@ -204,7 +209,11 @@ public class TdInfoQueryController extends BaseController {
...
@@ -204,7 +209,11 @@ public class TdInfoQueryController extends BaseController {
@PostMapping
(
value
=
"/getPvHealthIndexInfo"
)
@PostMapping
(
value
=
"/getPvHealthIndexInfo"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"分页查询健康指数信息 - 光伏"
,
notes
=
"分页查询健康指数信息 - 光伏"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"分页查询健康指数信息 - 光伏"
,
notes
=
"分页查询健康指数信息 - 光伏"
)
@GatewayIdAutowired
@GatewayIdAutowired
public
ResponseModel
<
Page
<
PvHealthIndex
>>
getPvHealthIndexInfo
(
@RequestBody
PvHealthIndexDto
dto
)
throws
ParseException
{
public
ResponseModel
<
Page
<
PvHealthIndex
>>
getPvHealthIndexInfo
(
@RequestBody
PvHealthIndexDto
dto
)
throws
Exception
{
if
(
dto
.
getEndDate
()==
null
||
dto
.
getStartDate
()==
null
)
{
throw
new
Exception
(
"请选择开始时间和结束时间"
);
}
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
userId
=
reginParams
.
getUserModel
().
getUserId
();
String
userId
=
reginParams
.
getUserModel
().
getUserId
();
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
new
QueryWrapper
<
StdUserEmpower
>().
eq
(
"amos_user_id"
,
userId
).
eq
(
"permission_type"
,
"YTH"
));
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
new
QueryWrapper
<
StdUserEmpower
>().
eq
(
"amos_user_id"
,
userId
).
eq
(
"permission_type"
,
"YTH"
));
...
@@ -218,22 +227,19 @@ public class TdInfoQueryController extends BaseController {
...
@@ -218,22 +227,19 @@ public class TdInfoQueryController extends BaseController {
String
startDate
=
dto
.
getStartDate
();
String
startDate
=
dto
.
getStartDate
();
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
startDate
.
length
()
==
10
)
{
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
startDate
.
length
()
==
10
)
{
l
ong
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_day"
,
startDate
,
"Asc "
);
L
ong
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_day"
,
startDate
,
"Asc "
);
dto
.
setStartDateTs
(
startTs
);
dto
.
setStartDateTs
(
startTs
);
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
startDate
.
length
()
==
13
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
startDate
.
length
()
==
13
)
{
l
ong
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_hour"
,
startDate
+
":00:00"
,
"Asc "
);
L
ong
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_hour"
,
startDate
+
":00:00"
,
"Asc "
);
dto
.
setStartDateTs
(
startTs
);
dto
.
setStartDateTs
(
startTs
);
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
startDate
.
length
()
==
16
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
startDate
.
length
()
==
16
)
{
String
nextWholeMinute
=
DateUtils
.
getNextWholeMinute
(
dto
.
getStartDate
()+
":00"
);
String
nextWholeMinute
=
DateUtils
.
getNextWholeMinute
(
dto
.
getStartDate
()+
":00"
);
l
ong
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_moment"
,
nextWholeMinute
,
"Asc "
);
L
ong
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_moment"
,
nextWholeMinute
,
"Asc "
);
dto
.
setStartDateTs
(
startTs
);
dto
.
setStartDateTs
(
startTs
);
}
else
{
}
else
{
l
ong
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_data"
,
startDate
+
" 00:00:00"
,
"Asc "
);
L
ong
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_data"
,
startDate
+
" 00:00:00"
,
"Asc "
);
dto
.
setStartDateTs
(
startTs
);
dto
.
setStartDateTs
(
startTs
);
}
}
}
}
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getEndDate
()))
{
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getEndDate
()))
{
String
dateNowShortStr
=
DateUtils
.
getDateNowShortStr
();
String
dateNowShortStr
=
DateUtils
.
getDateNowShortStr
();
...
@@ -244,20 +250,20 @@ public class TdInfoQueryController extends BaseController {
...
@@ -244,20 +250,20 @@ public class TdInfoQueryController extends BaseController {
endDate
=
formatter
.
format
(
date
);
endDate
=
formatter
.
format
(
date
);
}
}
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
endDate
.
length
()
==
10
)
{
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
endDate
.
length
()
==
10
)
{
l
ong
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_day"
,
endDate
,
"desc "
);
L
ong
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_day"
,
endDate
,
"desc "
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setTableName
(
"pv_health_index_day"
);
dto
.
setTableName
(
"pv_health_index_day"
);
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
endDate
.
length
()
==
13
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
endDate
.
length
()
==
13
)
{
l
ong
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_hour"
,
endDate
+
":00:00"
,
"desc "
);
L
ong
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_hour"
,
endDate
+
":00:00"
,
"desc "
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setTableName
(
"pv_health_index_hour"
);
dto
.
setTableName
(
"pv_health_index_hour"
);
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
endDate
.
length
()
==
16
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
endDate
.
length
()
==
16
)
{
String
nextWholeMinute
=
DateUtils
.
getBeforeWholeMinute
(
endDate
);
String
nextWholeMinute
=
DateUtils
.
getBeforeWholeMinute
(
endDate
+
":00"
);
l
ong
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_moment"
,
nextWholeMinute
,
"desc "
);
L
ong
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_moment"
,
nextWholeMinute
,
"desc "
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setTableName
(
"pv_health_index_moment"
);
dto
.
setTableName
(
"pv_health_index_moment"
);
}
else
{
}
else
{
l
ong
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_data"
,
endDate
+
" 00:00:00"
,
"desc "
);
L
ong
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_data"
,
endDate
+
" 00:00:00"
,
"desc "
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setTableName
(
"pv_health_index_data"
);
dto
.
setTableName
(
"pv_health_index_data"
);
}
}
...
@@ -288,8 +294,17 @@ public class TdInfoQueryController extends BaseController {
...
@@ -288,8 +294,17 @@ public class TdInfoQueryController extends BaseController {
}
}
String
join
=
String
.
join
(
","
,
orderByList
);
String
join
=
String
.
join
(
","
,
orderByList
);
dto
.
setOrderColumns
(
join
);
dto
.
setOrderColumns
(
join
);
if
(
dto
.
getEndDateTs
()==
null
&&
dto
.
getStartDateTs
()==
null
)
{
return
ResponseHelper
.
buildResponse
(
resultPage
);
}
List
<
PvHealthIndex
>
pvHealthIndexIPage
=
pvHealthIndexMapper
.
getInfoByPage
(
dto
);
List
<
PvHealthIndex
>
pvHealthIndexIPage
=
pvHealthIndexMapper
.
getInfoByPage
(
dto
);
pvHealthIndexIPage
.
forEach
(
item
->
item
.
setHealthIndex
(
Double
.
valueOf
(
df
.
format
(
item
.
getHealthIndex
()))));
pvHealthIndexIPage
.
forEach
(
item
->
{
item
.
setHealthIndex
(
Double
.
valueOf
(
df
.
format
(
item
.
getHealthIndex
())));
if
(
null
!=
dto
.
getAnalysisType
()){
item
.
setAnalysisType
(
dto
.
getAnalysisType
());
}
});
Integer
infoByPageTotal
=
pvHealthIndexMapper
.
getInfoByPageTotal
(
dto
);
Integer
infoByPageTotal
=
pvHealthIndexMapper
.
getInfoByPageTotal
(
dto
);
resultPage
.
setRecords
(
pvHealthIndexIPage
);
resultPage
.
setRecords
(
pvHealthIndexIPage
);
resultPage
.
setTotal
(
infoByPageTotal
);
resultPage
.
setTotal
(
infoByPageTotal
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/entity/IdxBizFanPointVarCorrelation.java
View file @
779ac0bc
...
@@ -152,6 +152,9 @@ public class IdxBizFanPointVarCorrelation{
...
@@ -152,6 +152,9 @@ public class IdxBizFanPointVarCorrelation{
/**
/**
* 匹配工况变量
* 匹配工况变量
*/
*/
@TableField
(
"ORG_CODE"
)
private
String
orgCode
;
@TableField
(
"MATCH_PROCESS_PONIT"
)
@TableField
(
"MATCH_PROCESS_PONIT"
)
private
String
matchProcessPoint
;
private
String
matchProcessPoint
;
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/entity/IdxBizPvPointVarCorrelation.java
View file @
779ac0bc
...
@@ -152,6 +152,10 @@ public class IdxBizPvPointVarCorrelation{
...
@@ -152,6 +152,10 @@ public class IdxBizPvPointVarCorrelation{
@TableField
(
"PROCESS_POINT_NAME"
)
@TableField
(
"PROCESS_POINT_NAME"
)
private
String
processPointName
;
private
String
processPointName
;
@TableField
(
"ORG_CODE"
)
private
String
orgCode
;
@TableField
(
"MATCH_PROCESS_POINT"
)
@TableField
(
"MATCH_PROCESS_POINT"
)
private
String
matchProcessPoint
;
private
String
matchProcessPoint
;
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/kafka/Constant.java
View file @
779ac0bc
...
@@ -13,21 +13,21 @@ import java.util.Date;
...
@@ -13,21 +13,21 @@ import java.util.Date;
public
interface
Constant
{
public
interface
Constant
{
// 风电相关性消费者
// 风电相关性消费者
String
kafkaTopicConsumer
=
"FAN_XGX"
;
String
kafkaTopicConsumer
=
"FAN_XGX
_NEW
"
;
// 光伏相关性消费者
// 光伏相关性消费者
String
kafkaTopicConsumerPv
=
"PV_XGX"
;
String
kafkaTopicConsumerPv
=
"PV_XGX
_NEW
"
;
// 风电 工况区间划分
// 风电 工况区间划分
String
kafkaTopicConsumerGKHFFan
=
"FAN_QJHF"
;
String
kafkaTopicConsumerGKHFFan
=
"FAN_QJHF
_NEW
"
;
// 光伏 工况区间划分
// 光伏 工况区间划分
String
kafkaTopicConsumerGKHFPv
=
"PV_QJHF"
;
String
kafkaTopicConsumerGKHFPv
=
"PV_QJHF
_NEW
"
;
// 风电 中心值计算
// 风电 中心值计算
String
kafkaTopicConsumerZXZFan
=
"FAN_ZXZ"
;
String
kafkaTopicConsumerZXZFan
=
"FAN_ZXZ
_NEW
"
;
// 光伏 中心值计算
// 光伏 中心值计算
String
kafkaTopicConsumerZXZPv
=
"PV_ZXZ"
;
String
kafkaTopicConsumerZXZPv
=
"PV_ZXZ
_NEW
"
;
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/kafka/FanConditionVariablesMessage.java
View file @
779ac0bc
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
kafka
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
kafka
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanPointProcessVariableClassification
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanPointProcessVariableClassification
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanPointVarCorrelation
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanPointVarCorrelation
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvPointProcessVariableClassification
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvPointProcessVariableClassification
;
...
@@ -16,7 +18,11 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -16,7 +18,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
kafka
.
Constant
.*;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
kafka
.
Constant
.*;
...
@@ -37,11 +43,6 @@ public class FanConditionVariablesMessage {
...
@@ -37,11 +43,6 @@ public class FanConditionVariablesMessage {
@Autowired
@Autowired
private
IdxBizPvPointProcessVariableClassificationMapper
classificationMapperPv
;
private
IdxBizPvPointProcessVariableClassificationMapper
classificationMapperPv
;
@Autowired
private
IdxBizFanPointProcessVariableClassificationMapper
idxBizFanPointProcessVariableClassificationMapper
;
@Autowired
private
IdxBizPvPointProcessVariableClassificationMapper
idxBizPvPointProcessVariableClassificationMapper
;
@Autowired
@Autowired
private
KafkaProducerService
kafkaProducerService
;
private
KafkaProducerService
kafkaProducerService
;
...
@@ -49,17 +50,96 @@ public class FanConditionVariablesMessage {
...
@@ -49,17 +50,96 @@ public class FanConditionVariablesMessage {
// 相关性分析-风机入口
// 相关性分析-风机入口
@Async
@Async
public
void
getFanConditionVariables
()
{
public
void
getFanConditionVariables
()
{
List
<
IdxBizFanPointVarCorrelation
>
pointVarCorrelationsList
=
pointVarCorrelationMapper
.
selectList
(
new
LambdaQueryWrapper
<
IdxBizFanPointVarCorrelation
>());
List
<
IdxBizFanPointVarCorrelation
>
pointVarCorrelationsList
=
initFanPointVar
();
log
.
debug
(
"==================初始化了{}条数据=============================="
,
pointVarCorrelationsList
.
size
());
pointVarCorrelationsList
.
forEach
(
item
->
kafkaProducerService
.
sendMessageAsync
(
kafkaTopicConsumer
,
JSON
.
toJSONString
(
item
)));
pointVarCorrelationsList
.
forEach
(
item
->
kafkaProducerService
.
sendMessageAsync
(
kafkaTopicConsumer
,
JSON
.
toJSONString
(
item
)));
}
}
/**
* 初始化风机的相关性分析
* @return
*/
private
List
<
IdxBizFanPointVarCorrelation
>
initFanPointVar
()
{
//清空表
pointVarCorrelationMapper
.
delete
(
null
);
Date
recDate
=
new
Date
();
Sequence
sequence
=
new
Sequence
();
List
<
IdxBizFanPointProcessVariableClassification
>
gkblList
=
classificationMapperFan
.
selectList
(
new
QueryWrapper
<
IdxBizFanPointProcessVariableClassification
>().
isNotNull
(
"SEQUENCE_NBR"
).
eq
(
"TAG_CODE"
,
"工况变量"
));
List
<
IdxBizFanPointProcessVariableClassification
>
fxblList
=
classificationMapperFan
.
selectList
(
new
QueryWrapper
<
IdxBizFanPointProcessVariableClassification
>().
isNotNull
(
"SEQUENCE_NBR"
).
eq
(
"TAG_CODE"
,
"分析变量"
));
List
<
IdxBizFanPointVarCorrelation
>
fanPointVarCorrelations
=
new
ArrayList
<>();
//工况变量和分析变量不为空 进行计算 总数值=同一设备的工况变量*分析变量
if
(
CollectionUtil
.
isNotEmpty
(
gkblList
)
&&
CollectionUtil
.
isNotEmpty
(
fxblList
)){
//聚合同一设备
Map
<
String
,
List
<
IdxBizFanPointProcessVariableClassification
>>
fxblMap
=
fxblList
.
stream
().
collect
(
Collectors
.
groupingBy
(
IdxBizFanPointProcessVariableClassification:
:
getEquipmentName
));
gkblList
.
forEach
(
item
->{
fxblMap
.
get
(
item
.
getEquipmentName
()).
forEach
(
item1
->{
IdxBizFanPointVarCorrelation
idxBizFanPointVarCorrelation
=
BeanUtil
.
copyProperties
(
item
,
IdxBizFanPointVarCorrelation
.
class
);
idxBizFanPointVarCorrelation
.
setSequenceNbr
(
String
.
valueOf
(
sequence
.
nextId
()));
idxBizFanPointVarCorrelation
.
setRecDate
(
recDate
);
idxBizFanPointVarCorrelation
.
setCorrelationCoefficient
(
0.0
);
idxBizFanPointVarCorrelation
.
setAnalysisPointId
(
Long
.
valueOf
(
item1
.
getSequenceNbr
()));
idxBizFanPointVarCorrelation
.
setProcessPointId
(
Long
.
valueOf
(
item
.
getSequenceNbr
()));
idxBizFanPointVarCorrelation
.
setDeviceType
(
null
);
idxBizFanPointVarCorrelation
.
setAnalysisGatewayId
(
item1
.
getGatewayId
());
idxBizFanPointVarCorrelation
.
setAnalysisIndexAddress
(
item1
.
getIndexAddress
());
idxBizFanPointVarCorrelation
.
setProcessGatewayId
(
item
.
getGatewayId
());
idxBizFanPointVarCorrelation
.
setProcessIndexAddress
(
item
.
getIndexAddress
());
idxBizFanPointVarCorrelation
.
setAnalysisPointName
(
item1
.
getPointName
());
idxBizFanPointVarCorrelation
.
setProcessPointName
(
item
.
getPointName
());
idxBizFanPointVarCorrelation
.
setMatchProcessPoint
(
"匹配"
);
fanPointVarCorrelations
.
add
(
idxBizFanPointVarCorrelation
);
});
});
}
return
fanPointVarCorrelations
;
}
// 相关性分析-光伏入口
// 相关性分析-光伏入口
@Async
@Async
public
void
getPvConditionVariables
()
{
public
void
getPvConditionVariables
()
{
List
<
IdxBizPvPointVarCorrelation
>
pointVarCorrelationsList
=
pointVarCorrelationMapperPv
.
selectList
(
null
);
List
<
IdxBizPvPointVarCorrelation
>
pointVarCorrelationsList
=
initPvPointVar
();
log
.
debug
(
"==============初始化了光伏{}条数据==============="
,
pointVarCorrelationsList
.
size
());
pointVarCorrelationsList
.
forEach
(
item
->
kafkaProducerService
.
sendMessageAsync
(
kafkaTopicConsumerPv
,
JSON
.
toJSONString
(
item
)));
pointVarCorrelationsList
.
forEach
(
item
->
kafkaProducerService
.
sendMessageAsync
(
kafkaTopicConsumerPv
,
JSON
.
toJSONString
(
item
)));
}
}
/**
* 初始化光伏的相关性分析
*/
private
List
<
IdxBizPvPointVarCorrelation
>
initPvPointVar
()
{
//清空表
pointVarCorrelationMapper
.
delete
(
null
);
Date
recDate
=
new
Date
();
Sequence
sequence
=
new
Sequence
();
List
<
IdxBizPvPointProcessVariableClassification
>
gkblList
=
classificationMapperPv
.
selectList
(
new
QueryWrapper
<
IdxBizPvPointProcessVariableClassification
>().
isNotNull
(
"SEQUENCE_NBR"
).
eq
(
"TAG_CODE"
,
"工况变量"
));
List
<
IdxBizPvPointProcessVariableClassification
>
fxblList
=
classificationMapperPv
.
selectList
(
new
QueryWrapper
<
IdxBizPvPointProcessVariableClassification
>().
isNotNull
(
"SEQUENCE_NBR"
).
eq
(
"TAG_CODE"
,
"分析变量"
));
List
<
IdxBizPvPointVarCorrelation
>
pvPointVarCorrelations
=
new
ArrayList
<>();
//工况变量和分析变量不为空 进行计算 总数值=同一设备的工况变量*分析变量
if
(
CollectionUtil
.
isNotEmpty
(
gkblList
)
&&
CollectionUtil
.
isNotEmpty
(
fxblList
)){
//聚合同一设备
Map
<
String
,
List
<
IdxBizPvPointProcessVariableClassification
>>
fxblMap
=
fxblList
.
stream
().
collect
(
Collectors
.
groupingBy
(
IdxBizPvPointProcessVariableClassification:
:
getEquipmentName
));
gkblList
.
forEach
(
item
->{
fxblMap
.
get
(
item
.
getEquipmentName
()).
forEach
(
item1
->{
IdxBizPvPointVarCorrelation
idxBizPvPointVarCorrelation
=
BeanUtil
.
copyProperties
(
item
,
IdxBizPvPointVarCorrelation
.
class
);
idxBizPvPointVarCorrelation
.
setSequenceNbr
(
String
.
valueOf
(
sequence
.
nextId
()));
idxBizPvPointVarCorrelation
.
setRecDate
(
recDate
);
idxBizPvPointVarCorrelation
.
setCorrelationCoefficient
(
0.0
);
idxBizPvPointVarCorrelation
.
setAnalysisPointId
(
item1
.
getSequenceNbr
());
idxBizPvPointVarCorrelation
.
setProcessPointId
(
item
.
getSequenceNbr
());
idxBizPvPointVarCorrelation
.
setDeviceType
(
item
.
getDeviceType
());
idxBizPvPointVarCorrelation
.
setAnalysisGatewayId
(
item1
.
getGatewayId
());
idxBizPvPointVarCorrelation
.
setAnalysisIndexAddress
(
Integer
.
valueOf
(
item1
.
getIndexAddress
()));
idxBizPvPointVarCorrelation
.
setProcessGatewayId
(
item
.
getGatewayId
());
idxBizPvPointVarCorrelation
.
setProcessIndexAddress
(
item
.
getIndexAddress
());
idxBizPvPointVarCorrelation
.
setAnalysisPointName
(
item1
.
getPointName
());
idxBizPvPointVarCorrelation
.
setProcessPointName
(
item
.
getPointName
());
idxBizPvPointVarCorrelation
.
setMatchProcessPoint
(
"匹配"
);
pvPointVarCorrelations
.
add
(
idxBizPvPointVarCorrelation
);
});
});
}
return
pvPointVarCorrelations
;
}
// 工况划分 - 风电 - 新
// 工况划分 - 风电 - 新
@Async
@Async
public
void
getFanConditionVariablesGKHF
()
{
public
void
getFanConditionVariablesGKHF
()
{
...
@@ -77,14 +157,14 @@ public class FanConditionVariablesMessage {
...
@@ -77,14 +157,14 @@ public class FanConditionVariablesMessage {
// 中心值 - 风电 - 新
// 中心值 - 风电 - 新
@Async
@Async
public
void
getFanConditionVariablesZXZ
()
{
public
void
getFanConditionVariablesZXZ
()
{
List
<
IdxBizFanPointProcessVariableClassification
>
fenxiList
=
idxBizFanPointProcessVariableClassificationMapper
.
selectList
(
new
QueryWrapper
<
IdxBizFanPointProcessVariableClassification
>().
isNotNull
(
"SEQUENCE_NBR"
).
eq
(
"TAG_CODE"
,
"分析变量"
));
List
<
IdxBizFanPointProcessVariableClassification
>
fenxiList
=
classificationMapperFan
.
selectList
(
new
QueryWrapper
<
IdxBizFanPointProcessVariableClassification
>().
isNotNull
(
"SEQUENCE_NBR"
).
eq
(
"TAG_CODE"
,
"分析变量"
));
fenxiList
.
forEach
(
item
->
kafkaProducerService
.
sendMessageAsync
(
kafkaTopicConsumerZXZFan
,
JSON
.
toJSONString
(
item
)));
fenxiList
.
forEach
(
item
->
kafkaProducerService
.
sendMessageAsync
(
kafkaTopicConsumerZXZFan
,
JSON
.
toJSONString
(
item
)));
}
}
// 中心值 - 风电 - 新
// 中心值 - 风电 - 新
@Async
@Async
public
void
getPvConditionVariablesZXZ
()
{
public
void
getPvConditionVariablesZXZ
()
{
List
<
IdxBizPvPointProcessVariableClassification
>
fenxiList
=
idxBizPvPointProcessVariableClassificationMapper
.
selectList
(
new
QueryWrapper
<
IdxBizPvPointProcessVariableClassification
>().
isNotNull
(
"SEQUENCE_NBR"
).
eq
(
"TAG_CODE"
,
"分析变量"
));
List
<
IdxBizPvPointProcessVariableClassification
>
fenxiList
=
classificationMapperPv
.
selectList
(
new
QueryWrapper
<
IdxBizPvPointProcessVariableClassification
>().
isNotNull
(
"SEQUENCE_NBR"
).
eq
(
"TAG_CODE"
,
"分析变量"
));
fenxiList
.
forEach
(
item
->
kafkaProducerService
.
sendMessageAsync
(
kafkaTopicConsumerZXZPv
,
JSON
.
toJSONString
(
item
)));
fenxiList
.
forEach
(
item
->
kafkaProducerService
.
sendMessageAsync
(
kafkaTopicConsumerZXZPv
,
JSON
.
toJSONString
(
item
)));
}
}
}
}
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 @
779ac0bc
...
@@ -247,6 +247,7 @@ public class KafkaConsumerService {
...
@@ -247,6 +247,7 @@ public class KafkaConsumerService {
idxBizFanPointVarCentralValue
.
setSubSystem
(
analysisVariable
.
getSubSystem
());
idxBizFanPointVarCentralValue
.
setSubSystem
(
analysisVariable
.
getSubSystem
());
idxBizFanPointVarCentralValue
.
setNumber
(
analysisVariable
.
getNumber
());
idxBizFanPointVarCentralValue
.
setNumber
(
analysisVariable
.
getNumber
());
idxBizFanPointVarCentralValue
.
setEquipmentName
(
analysisVariable
.
getEquipmentName
());
idxBizFanPointVarCentralValue
.
setEquipmentName
(
analysisVariable
.
getEquipmentName
());
idxBizFanPointVarCentralValue
.
setOrgCode
(
analysisVariable
.
getOrgCode
());
insertList
.
add
(
idxBizFanPointVarCentralValue
);
insertList
.
add
(
idxBizFanPointVarCentralValue
);
}
}
if
(
CollectionUtils
.
isNotEmpty
(
insertList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
insertList
))
{
...
@@ -963,6 +964,7 @@ public class KafkaConsumerService {
...
@@ -963,6 +964,7 @@ public class KafkaConsumerService {
idxBizPvPointVarCentralValue
.
setSubarray
(
analysisVariable
.
getSubarray
());
idxBizPvPointVarCentralValue
.
setSubarray
(
analysisVariable
.
getSubarray
());
idxBizPvPointVarCentralValue
.
setManufacturer
(
analysisVariable
.
getManufacturer
());
idxBizPvPointVarCentralValue
.
setManufacturer
(
analysisVariable
.
getManufacturer
());
idxBizPvPointVarCentralValue
.
setEquipmentName
(
analysisVariable
.
getEquipmentName
());
idxBizPvPointVarCentralValue
.
setEquipmentName
(
analysisVariable
.
getEquipmentName
());
idxBizPvPointVarCentralValue
.
setOrgCode
(
analysisVariable
.
getOrgCode
());
insertList
.
add
(
idxBizPvPointVarCentralValue
);
insertList
.
add
(
idxBizPvPointVarCentralValue
);
}
}
if
(
CollectionUtils
.
isNotEmpty
(
insertList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
insertList
))
{
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/listener/SyncESDataToTdengineMqttListener.java
View file @
779ac0bc
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
listener
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
listener
;
import
java.text.ParseException
;
import
cn.hutool.core.date.DateUtil
;
import
java.util.Date
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.CountDownLatch
;
import
java.util.concurrent.ExecutionException
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.TimeUnit
;
import
javax.annotation.PostConstruct
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.TdengineTimeServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.TdengineTimeServiceImpl
;
import
cn.hutool.core.date.DateUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
javax.annotation.PostConstruct
;
import
java.text.ParseException
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeParseException
;
import
java.util.Date
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.ExecutionException
;
import
java.util.concurrent.TimeUnit
;
/**
/**
* @author Administrator
* @author Administrator
...
@@ -97,6 +94,12 @@ public class SyncESDataToTdengineMqttListener extends EmqxListener {
...
@@ -97,6 +94,12 @@ public class SyncESDataToTdengineMqttListener extends EmqxListener {
String
pvResult
=
pv
.
get
();
String
pvResult
=
pv
.
get
();
// 区域 全域最后统一生成
// 区域 全域最后统一生成
tdengineTimeService
.
insertMomentDataAll
(
format
);
tdengineTimeService
.
insertMomentDataAll
(
format
);
if
(
isWholeHour
(
format
)){
tdengineTimeService
.
insertHourData
();
}
if
(
isWholeDay
(
format
)){
tdengineTimeService
.
insertDayData
();
}
}
catch
(
InterruptedException
|
ExecutionException
e
)
{
}
catch
(
InterruptedException
|
ExecutionException
e
)
{
System
.
out
.
println
(
"任务执行异常"
);
System
.
out
.
println
(
"任务执行异常"
);
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -156,4 +159,23 @@ public class SyncESDataToTdengineMqttListener extends EmqxListener {
...
@@ -156,4 +159,23 @@ public class SyncESDataToTdengineMqttListener extends EmqxListener {
// }).start();
// }).start();
// }
// }
}
}
private
boolean
isWholeHour
(
String
dateTimeStr
)
{
try
{
DateTimeFormatter
FORMATTER
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
LocalDateTime
dateTime
=
LocalDateTime
.
parse
(
dateTimeStr
,
FORMATTER
);
return
dateTime
.
getMinute
()
==
0
&&
dateTime
.
getSecond
()
==
0
;
}
catch
(
DateTimeParseException
e
)
{
return
false
;
}
}
private
boolean
isWholeDay
(
String
dateTimeStr
)
{
try
{
DateTimeFormatter
FORMATTER
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
LocalDateTime
dateTime
=
LocalDateTime
.
parse
(
dateTimeStr
,
FORMATTER
);
return
dateTime
.
getMinute
()
==
0
&&
dateTime
.
getSecond
()
==
0
&&
dateTime
.
getHour
()
==
0
;
}
catch
(
DateTimeParseException
e
)
{
return
false
;
}
}
}
}
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 @
779ac0bc
...
@@ -100,7 +100,7 @@ public class TdengineTimeServiceImpl {
...
@@ -100,7 +100,7 @@ public class TdengineTimeServiceImpl {
/**
/**
* 风电 - 按小时生成测点、子系统、设备、场站、区域 数据
* 风电 - 按小时生成测点、子系统、设备、场站、区域 数据
*/
*/
@Scheduled
(
cron
=
"0 0 0/1 * * ? "
)
//
@Scheduled(cron = "0 0 0/1 * * ? ")
public
void
insertHourData
()
throws
ParseException
{
public
void
insertHourData
()
throws
ParseException
{
if
(!
openHealth
)
{
if
(!
openHealth
)
{
return
;
return
;
...
@@ -191,7 +191,7 @@ public class TdengineTimeServiceImpl {
...
@@ -191,7 +191,7 @@ public class TdengineTimeServiceImpl {
/**
/**
* 风电 - 按天生成测点、子系统、设备、场站、区域 数据
* 风电 - 按天生成测点、子系统、设备、场站、区域 数据
*/
*/
@Scheduled
(
cron
=
"0 05 0 1/1 * ? "
)
//
@Scheduled(cron = "0 05 0 1/1 * ? ")
public
void
insertDayData
()
throws
ParseException
{
public
void
insertDayData
()
throws
ParseException
{
if
(!
openHealth
)
{
if
(!
openHealth
)
{
return
;
return
;
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdMapper2/PvHealthIndexMapper.java
View file @
779ac0bc
...
@@ -62,7 +62,7 @@ public interface PvHealthIndexMapper extends BaseMapper<PvHealthIndex> {
...
@@ -62,7 +62,7 @@ public interface PvHealthIndexMapper extends BaseMapper<PvHealthIndex> {
List
<
PvHealthIndex
>
getInfoByPage
(
@Param
(
"dto"
)
PvHealthIndexDto
dto
);
List
<
PvHealthIndex
>
getInfoByPage
(
@Param
(
"dto"
)
PvHealthIndexDto
dto
);
l
ong
getTsByRecDate
(
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"recDate"
)
String
recDate
,
@Param
(
"sort"
)
String
sort
);
L
ong
getTsByRecDate
(
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"recDate"
)
String
recDate
,
@Param
(
"sort"
)
String
sort
);
Integer
getInfoByPageTotal
(
@Param
(
"dto"
)
PvHealthIndexDto
dto
);
Integer
getInfoByPageTotal
(
@Param
(
"dto"
)
PvHealthIndexDto
dto
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/application-kingbase8.properties
View file @
779ac0bc
...
@@ -26,7 +26,7 @@ spring.db6.datasource.password=Yeejoin@2020
...
@@ -26,7 +26,7 @@ spring.db6.datasource.password=Yeejoin@2020
spring.db6.datasource.driver-class-name
=
com.kingbase8.Driver
spring.db6.datasource.driver-class-name
=
com.kingbase8.Driver
## eureka properties:
## eureka properties:
eureka.instance.hostname
=
47.92.234.253
eureka.instance.hostname
=
10.20.1.160
eureka.client.serviceUrl.defaultZone
=
http://admin:a1234560@${eureka.instance.hostname}:10001/eureka/
eureka.client.serviceUrl.defaultZone
=
http://admin:a1234560@${eureka.instance.hostname}:10001/eureka/
## redis properties:
## redis properties:
spring.redis.database
=
1
spring.redis.database
=
1
...
@@ -166,7 +166,7 @@ pictureUrl=upload/jxiop/syz/
...
@@ -166,7 +166,7 @@ pictureUrl=upload/jxiop/syz/
#kafka
#kafka
spring.kafka.bootstrap-servers
=
10.20.0.223:9092
,10.20.0.133:9200
spring.kafka.bootstrap-servers
=
10.20.0.223:9092
spring.kafka.producer.retries
=
1
spring.kafka.producer.retries
=
1
spring.kafka.producer.bootstrap-servers
=
10.20.0.223:9092,10.20.0.133:9200
spring.kafka.producer.bootstrap-servers
=
10.20.0.223:9092,10.20.0.133:9200
spring.kafka.producer.batch-size
=
16384
spring.kafka.producer.batch-size
=
16384
...
@@ -175,7 +175,7 @@ spring.kafka.producer.acks=1
...
@@ -175,7 +175,7 @@ spring.kafka.producer.acks=1
spring.kafka.producer.key-serializer
=
org.apache.kafka.common.serialization.StringSerializer
spring.kafka.producer.key-serializer
=
org.apache.kafka.common.serialization.StringSerializer
spring.kafka.producer.value-serializer
=
org.apache.kafka.common.serialization.StringSerializer
spring.kafka.producer.value-serializer
=
org.apache.kafka.common.serialization.StringSerializer
spring.kafka.consumer.group-id
=
consumerGroup
spring.kafka.consumer.group-id
=
consumerGroup
spring.kafka.consumer.bootstrap-servers
=
10.20.0.223:9092
,10.20.0.133:9200
spring.kafka.consumer.bootstrap-servers
=
10.20.0.223:9092
spring.kafka.consumer.enable-auto-commit
=
false
spring.kafka.consumer.enable-auto-commit
=
false
spring.kafka.consumer.auto-offset-reset
=
earliest
spring.kafka.consumer.auto-offset-reset
=
earliest
spring.kafka.consumer.key-deserializer
=
org.apache.kafka.common.serialization.StringDeserializer
spring.kafka.consumer.key-deserializer
=
org.apache.kafka.common.serialization.StringDeserializer
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/FanHealthIndex.xml
View file @
779ac0bc
...
@@ -167,7 +167,7 @@
...
@@ -167,7 +167,7 @@
</select>
</select>
<select
id=
"getInfoByPage"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex"
>
<select
id=
"getInfoByPage"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex"
>
SELECT * FROM
fan_health_index_data
SELECT * FROM
${dto.tableName}
<where>
<where>
<if
test=
"dto.analysisObjType!= null and dto.analysisObjType!= ''"
>
analysis_obj_type = #{dto.analysisObjType}
</if>
<if
test=
"dto.analysisObjType!= null and dto.analysisObjType!= ''"
>
analysis_obj_type = #{dto.analysisObjType}
</if>
<if
test=
"dto.analysisType!= null and dto.analysisType!= ''"
>
and analysis_type = #{dto.analysisType}
</if>
<if
test=
"dto.analysisType!= null and dto.analysisType!= ''"
>
and analysis_type = #{dto.analysisType}
</if>
...
...
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