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
3f7ae5d3
Commit
3f7ae5d3
authored
Nov 03, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修改
parent
da276d5f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
365 additions
and
25 deletions
+365
-25
TestController.java
...amos/boot/module/jxiop/biz/controller/TestController.java
+6
-5
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+62
-20
TdengineTimeServiceImpl.java
...odule/jxiop/biz/service/impl/TdengineTimeServiceImpl.java
+0
-0
FanHealthIndexMapper.java
...boot/module/jxiop/biz/tdMapper2/FanHealthIndexMapper.java
+37
-0
PvHealthIndexMapper.java
.../boot/module/jxiop/biz/tdMapper2/PvHealthIndexMapper.java
+20
-0
FanHealthIndex.xml
...iz/src/main/resources/mapper/tdengine2/FanHealthIndex.xml
+120
-0
PvHealthIndex.xml
...biz/src/main/resources/mapper/tdengine2/PvHealthIndex.xml
+120
-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/TestController.java
View file @
3f7ae5d3
...
...
@@ -13,11 +13,13 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -46,11 +48,11 @@ public class TestController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"test2"
,
notes
=
"test1"
)
@GetMapping
(
"/test2"
)
public
void
test2
()
{
public
void
test2
(
@RequestParam
(
value
=
"startTime"
)
String
startTime
,
@Param
(
"recDate"
)
String
recDate
)
{
// List<FanHealthIndex> infoListByGroupByCD = fanHealthIndexMapper.getInfoListByGroupByCdFan(startTime, recDate);
// commonService.healthWarningMinuteByFJ();
commonService
.
healthWarningMinuteByPv
();
//
commonService.healthWarningMinuteByPv();
// return infoListByGroupByCD;
}
@Autowired
...
...
@@ -64,7 +66,6 @@ public class TestController extends BaseController {
@PostMapping
(
"/saveTest"
)
public
void
saveTest
()
{
tdengineTimeService
.
insertHourData
();
// QueryWrapper<FanHealthIndex> fanHealthIndexQueryWrapper = new QueryWrapper<>();
// List<FanHealthIndex> fanHealthIndices = fanHealthIndexMapper.selectList(fanHealthIndexQueryWrapper);
//
...
...
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 @
3f7ae5d3
...
...
@@ -152,6 +152,10 @@ public class CommonServiceImpl {
@Autowired
private
PvHealthIndexMapper
pvHealthIndexMapper
;
@Autowired
private
TdengineTimeServiceImpl
tdengineTimeService
;
/**
* @return
* @deprecated 获取工况变量列表风机
...
...
@@ -1688,17 +1692,9 @@ public class CommonServiceImpl {
}
}
idxBizFanHealthIndexService
.
saveBatch
(
idxBizFanHealthIndexs
);
// 按时刻相关数据插入TDEngine 【异步】
insertFanDataTDEngine
(
fanHealthIndices1
,
format
);
ArrayList
<
FanHealthIndex
>
newList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
fanHealthIndices1
.
size
();
i
++)
{
//分批次处理
newList
.
add
(
fanHealthIndices1
.
get
(
i
));
//循环将数据填入载体list
if
(
500
==
newList
.
size
()
||
i
==
fanHealthIndices1
.
size
()
-
1
)
{
//载体list达到要求,进行批量操作
//调用批量插入
fanHealthIndexMapper
.
saveBatchHealthIndexList
(
newList
,
"fan_health_index_moment"
);
newList
.
clear
();
//每次批量操作后,清空载体list,等待下次的数据填入
}
}
}
try
{
...
...
@@ -1715,6 +1711,33 @@ public class CommonServiceImpl {
}
/**
* 风电按时刻相关数据插入
* @param fanHealthIndices
*/
@Async
public
void
insertFanDataTDEngine
(
ArrayList
<
FanHealthIndex
>
fanHealthIndices
,
String
recDate
)
{
// 按时刻 - 测点插入
ArrayList
<
FanHealthIndex
>
newList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
fanHealthIndices
.
size
();
i
++)
{
//分批次处理
newList
.
add
(
fanHealthIndices
.
get
(
i
));
//循环将数据填入载体list
if
(
500
==
newList
.
size
()
||
i
==
fanHealthIndices
.
size
()
-
1
)
{
//载体list达到要求,进行批量操作
//调用批量插入
fanHealthIndexMapper
.
saveBatchHealthIndexList
(
newList
,
"fan_health_index_moment"
);
newList
.
clear
();
//每次批量操作后,清空载体list,等待下次的数据填入
}
}
// 按时刻 子系统、设备、场站、区域 插入数据
try
{
tdengineTimeService
.
insertMomentData
(
recDate
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
// @Scheduled(cron = "0 0/10 * * * ?")
@Async
(
"async"
)
public
void
healthWarningMinuteByPv
()
{
...
...
@@ -1927,16 +1950,8 @@ public class CommonServiceImpl {
}
}
idxBizPvHealthIndexService
.
saveBatch
(
idxBizPvHealthIndexs
);
ArrayList
<
PvHealthIndex
>
newList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
fanHealthIndices1
.
size
();
i
++)
{
//分批次处理
newList
.
add
(
fanHealthIndices1
.
get
(
i
));
//循环将数据填入载体list
if
(
500
==
newList
.
size
()
||
i
==
fanHealthIndices1
.
size
()
-
1
)
{
//载体list达到要求,进行批量操作
//调用批量插入
pvHealthIndexMapper
.
saveBatchHealthIndexList
(
newList
,
"pv_health_index_moment"
);
newList
.
clear
();
//每次批量操作后,清空载体list,等待下次的数据填入
}
}
//按时刻 - 相关数据插入
insertPvDataTDEngine
(
fanHealthIndices1
,
format
);
}
try
{
logger
.
info
(
"--------------------response: "
+
response
);
...
...
@@ -1948,4 +1963,31 @@ public class CommonServiceImpl {
}
/**
* 光伏按时刻相关数据插入
* @param pvHealthIndices
*/
@Async
public
void
insertPvDataTDEngine
(
ArrayList
<
PvHealthIndex
>
pvHealthIndices
,
String
recDate
)
{
// 按时刻 - 测点插入
ArrayList
<
PvHealthIndex
>
newList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
pvHealthIndices
.
size
();
i
++)
{
//分批次处理
newList
.
add
(
pvHealthIndices
.
get
(
i
));
//循环将数据填入载体list
if
(
500
==
newList
.
size
()
||
i
==
pvHealthIndices
.
size
()
-
1
)
{
//载体list达到要求,进行批量操作
//调用批量插入
pvHealthIndexMapper
.
saveBatchHealthIndexList
(
newList
,
"pv_health_index_moment"
);
newList
.
clear
();
//每次批量操作后,清空载体list,等待下次的数据填入
}
}
// 按时刻 设备、子阵、场站、区域 插入数据
try
{
tdengineTimeService
.
insertMomentDataPv
(
recDate
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
}
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 @
3f7ae5d3
This diff is collapsed.
Click to expand it.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdMapper2/FanHealthIndexMapper.java
View file @
3f7ae5d3
...
...
@@ -25,4 +25,41 @@ public interface FanHealthIndexMapper extends BaseMapper<FanHealthIndex> {
List
<
FanHealthIndexDay
>
selectData
(
@Param
(
"healthLevel"
)
String
healthLevel
,
@Param
(
"area"
)
String
area
,
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"subSystem"
)
String
subSystem
,
@Param
(
"analysisType"
)
String
analysisType
,
@Param
(
"analysisObjType"
)
String
analysisObjType
,
@Param
(
"station"
)
String
station
,
@Param
(
"pointName"
)
String
pointName
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"startTimeTop"
)
String
startTimeTop
,
@Param
(
"endTimeTop"
)
String
endTimeTop
);
int
saveBatchHealthIndexList
(
@Param
(
"list"
)
List
<
FanHealthIndex
>
list
,
@Param
(
"tableName"
)
String
tableName
);
/**
* 测点
*
* @return
*/
List
<
FanHealthIndex
>
getInfoListByGroupByCdFan
(
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"analysisObjectType"
)
String
analysisObjectType
);
/**
* 子系统
*/
List
<
FanHealthIndex
>
getInfoListByGroupByZxtFan
(
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"analysisObjectType"
)
String
analysisObjectType
);
/**
* 设备
*/
List
<
FanHealthIndex
>
getInfoListByGroupBySbFan
(
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"analysisObjectType"
)
String
analysisObjectType
);
/**
* 场站
*/
List
<
FanHealthIndex
>
getInfoListByGroupByCzFan
(
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"analysisObjectType"
)
String
analysisObjectType
);
/**
* 区域
*/
List
<
FanHealthIndex
>
getInfoListByGroupByQyFan
(
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"analysisObjectType"
)
String
analysisObjectType
);
}
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 @
3f7ae5d3
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvHealthIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndexDay
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -28,4 +29,23 @@ public interface PvHealthIndexMapper extends BaseMapper<PvHealthIndex> {
int
saveBatchHealthIndexList
(
@Param
(
"list"
)
List
<
PvHealthIndex
>
list
,
@Param
(
"tableName"
)
String
tableName
);
List
<
PvHealthIndex
>
getInfoListByGroupByCdPv
(
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"analysisObjectType"
)
String
analysisObjectType
);
List
<
PvHealthIndex
>
getInfoListByGroupBySbPv
(
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"analysisObjectType"
)
String
analysisObjectType
);
List
<
PvHealthIndex
>
getInfoListByGroupByZzPv
(
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"analysisObjectType"
)
String
analysisObjectType
);
List
<
PvHealthIndex
>
getInfoListByGroupByCzPv
(
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"analysisObjectType"
)
String
analysisObjectType
);
List
<
PvHealthIndex
>
getInfoListByGroupByQyPv
(
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"analysisObjectType"
)
String
analysisObjectType
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/FanHealthIndex.xml
View file @
3f7ae5d3
...
...
@@ -32,4 +32,124 @@
)
</foreach>
</insert>
<select
id=
"getInfoListByGroupByCdFan"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex"
>
select
index_address,
gateway_id ,
station,
analysis_obj_type,
analysis_obj_seq,
weight,
area,
sub_system,
number,
equipment_name,
avg(anomaly) as anomaly,
point_name,
kks,
AVG(health_index) as health_index
from
#{tableName}
where
analysis_obj_type = #{analysisObjectType}
and ts > #{startTime}
group by
gateway_id,
index_address,
station,
analysis_obj_type,
analysis_obj_seq,
weight,
area,
sub_system,
number,
equipment_name,
point_name,
kks
</select>
<select
id=
"getInfoListByGroupByZxtFan"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex"
>
select
gateway_id ,
station,
'子系统' as analysis_obj_type,
area,
sub_system,
equipment_name,
avg(anomaly) as anomaly,
AVG(health_index) as health_index
from
#{tableName}
where
analysis_obj_type = #{analysisObjectType}
and ts > #{startTime}
group by
gateway_id,
station,
analysis_obj_type,
area,
sub_system,
equipment_name
</select>
<select
id=
"getInfoListByGroupBySbFan"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex"
>
select
gateway_id ,
station,
'设备' as analysis_obj_type,
area,
number,
equipment_name,
avg(anomaly) as anomaly,
AVG(health_index) as health_index
from
#{tableName}
where
analysis_obj_type = #{analysisObjectType}
and ts > #{startTime}
group by
gateway_id,
station,
analysis_obj_type,
area,
number,
equipment_name
</select>
<select
id=
"getInfoListByGroupByCzFan"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex"
>
select
gateway_id,
station,
'场站' as analysis_obj_type,
area,
avg(anomaly) as anomaly,
AVG(health_index) as health_index
from
#{tableName}
where
analysis_obj_type = #{analysisObjectType}
and ts > #{startTime}
group by
gateway_id,
station,
analysis_obj_type,
area
</select>
<select
id=
"getInfoListByGroupByQyFan"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex"
>
select
'片区' as analysis_obj_type,
area,
avg(anomaly) as anomaly,
AVG(health_index) as health_index
from
#{tableName}
where
analysis_obj_type = #{analysisObjectType}
and ts > #{startTime}
group by
analysis_obj_type,
area
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/PvHealthIndex.xml
View file @
3f7ae5d3
...
...
@@ -66,4 +66,124 @@
)
</foreach>
</insert>
<select
id=
"getInfoListByGroupByCdPv"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex"
>
select
index_address,
gateway_id ,
station,
'测点' as analysis_obj_type,
analysis_obj_seq,
weight,
area,
subarray,
manufacturer,
equipment_name,
avg(anomaly) as anomaly,
point_name,
device_type,
kks,
AVG(health_index) as health_index
from
#{tableName}
where
analysis_obj_type = #{analysisObjectType}
and ts > #{startTime}
group by
gateway_id,
index_address,
station,
analysis_obj_type,
analysis_obj_seq,
weight,
area,
subarray,
manufacturer,
equipment_name,
point_name,
device_type,
kks
</select>
<select
id=
"getInfoListByGroupBySbPv"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex"
>
select
gateway_id ,
station,
'设备' as analysis_obj_type,
area,
subarray,
equipment_name,
avg(anomaly) as anomaly,
AVG(health_index) as health_index
from
#{tableName}
where
analysis_obj_type = #{analysisObjectType}
and ts > #{startTime}
group by
gateway_id,
station,
analysis_obj_type,
area,
subarray,
equipment_name
</select>
<select
id=
"getInfoListByGroupByZzPv"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex"
>
select
gateway_id ,
station,
'子阵' as analysis_obj_type,
area,
subarray,
avg(anomaly) as anomaly,
AVG(health_index) as health_index
from
#{tableName}
where
analysis_obj_type = #{analysisObjectType}
and ts > #{startTime}
group by
gateway_id,
station,
analysis_obj_type,
area,
subarray
</select>
<select
id=
"getInfoListByGroupByCzPv"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex"
>
select
gateway_id ,
station,
'场站' as analysis_obj_type,
area,
avg(anomaly) as anomaly,
AVG(health_index) as health_index
from
#{tableName}
where
analysis_obj_type = #{analysisObjectType}
and ts > #{startTime}
group by
gateway_id,
station,
analysis_obj_type,
area
</select>
<select
id=
"getInfoListByGroupByQyPv"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex"
>
select
'片区' as analysis_obj_type,
area,
avg(anomaly) as anomaly,
AVG(health_index) as health_index
from
#{tableName}
where
analysis_obj_type = #{analysisObjectType}
and ts > #{startTime}
group by
analysis_obj_type,
area
</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