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
4049bf7d
Commit
4049bf7d
authored
Jul 23, 2024
by
yangyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
风机 & 光伏 - 按时刻生成设备、子阵、场站和片区数据
parent
77aea05f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
227 additions
and
50 deletions
+227
-50
IFanHealthIndexService.java
...boot/module/jxiop/biz/service/IFanHealthIndexService.java
+88
-0
IPvHealthIndexService.java
.../boot/module/jxiop/biz/service/IPvHealthIndexService.java
+115
-0
FanHealthIndexServiceImpl.java
...ule/jxiop/biz/service/impl/FanHealthIndexServiceImpl.java
+9
-25
PvHealthIndexServiceImpl.java
...dule/jxiop/biz/service/impl/PvHealthIndexServiceImpl.java
+7
-21
TdengineTimeServiceImpl.java
...odule/jxiop/biz/service/impl/TdengineTimeServiceImpl.java
+8
-4
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/IFanHealthIndexService.java
0 → 100644
View file @
4049bf7d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex
;
import
java.util.List
;
/**
* <p>
* ProjectName: amos-boot-zx-biz
* PackageName: com.yeejoin.amos.boot.module.jxiop.biz.service
*
* @author yangyang
* @version v1.0
* @date 2024/7/23 21:55
*/
public
interface
IFanHealthIndexService
{
List
<
FanHealthIndex
>
getInfoListByGroupByZxtFan
(
String
startTime
,
String
tableName
,
String
analysisObjectType
);
/**
* 设备加权平均
* 加权平均数 = (w1 * x1 + w2 * x2 + … + wn * xn) / (w1 + w2 + … + wn)
* w1, w2, …, wn 是各个数据点的权重;
* x1, x2, …, xn 是各个数据点的数值;
* n 是数据点的总数。
*
* @param startTime startTime
* @param tableName tableName
* @param analysisObjectType analysisObjectType
* @return {@link List< FanHealthIndex>}
* @throws
* @author yangyang
* @date 2024/7/23 21:02
*/
List
<
FanHealthIndex
>
getInfoListByGroupBySbFan
(
String
startTime
,
String
tableName
,
String
analysisObjectType
);
/**
* 场站加权平均
* 加权平均数 = (w1 * x1 + w2 * x2 + … + wn * xn) / (w1 + w2 + … + wn)
* w1, w2, …, wn 是各个数据点的权重;
* x1, x2, …, xn 是各个数据点的数值;
* n 是数据点的总数。
*
* @param startTime startTime
* @param tableName tableName
* @param analysisObjectType analysisObjectType
* @return {@link List< FanHealthIndex>}
* @throws
* @author yangyang
* @date 2024/7/23 21:02
*/
List
<
FanHealthIndex
>
getInfoListByGroupByCzFan
(
String
startTime
,
String
tableName
,
String
analysisObjectType
);
/**
* 区域加权平均
* 加权平均数 = (w1 * x1 + w2 * x2 + … + wn * xn) / (w1 + w2 + … + wn)
* w1, w2, …, wn 是各个数据点的权重;
* x1, x2, …, xn 是各个数据点的数值;
* n 是数据点的总数。
*
* @param startTime startTime
* @param tableName tableName
* @param analysisObjectType analysisObjectType
* @return {@link List< FanHealthIndex>}
* @throws
* @author yangyang
* @date 2024/7/23 21:02
*/
List
<
FanHealthIndex
>
getInfoListByGroupByQyFan
(
String
startTime
,
String
tableName
,
String
analysisObjectType
);
/**
* 全域【所有 / 全国】加权平均
* 加权平均数 = (w1 * x1 + w2 * x2 + … + wn * xn) / (w1 + w2 + … + wn)
* w1, w2, …, wn 是各个数据点的权重;
* x1, x2, …, xn 是各个数据点的数值;
* n 是数据点的总数。
*
* @param startTime startTime
* @param tableName tableName
* @param analysisObjectType analysisObjectType
* @return {@link List< FanHealthIndex>}
* @throws
* @author yangyang
* @date 2024/7/23 21:02
*/
List
<
FanHealthIndex
>
getInfoListByGroupByQgFan
(
String
startTime
,
String
tableName
,
String
analysisObjectType
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/IPvHealthIndexService.java
0 → 100644
View file @
4049bf7d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex
;
import
java.util.List
;
/**
* <p>
* ProjectName: amos-boot-zx-biz
* PackageName: com.yeejoin.amos.boot.module.jxiop.biz.service.impl
*
* @author yangyang
* @version v1.0
* @date 2024/7/23 21:59
*/
public
interface
IPvHealthIndexService
{
/**
* 设备加权平均
* 加权平均数 = (w1 * x1 + w2 * x2 + … + wn * xn) / (w1 + w2 + … + wn)
* w1, w2, …, wn 是各个数据点的权重;
* x1, x2, …, xn 是各个数据点的数值;
* n 是数据点的总数。
*
* @param startTime startTime
* @param tableName tableName
* @param analysisObjectType analysisObjectType
* @return {@link List < FanHealthIndex >}
* @throws
* @author yangyang
* @date 2024/7/23 21:02
*/
List
<
PvHealthIndex
>
getInfoListByGroupBySbPv
(
String
startTime
,
String
tableName
,
String
analysisObjectType
);
/**
* 子阵加权平均
* 加权平均数 = (w1 * x1 + w2 * x2 + … + wn * xn) / (w1 + w2 + … + wn)
* w1, w2, …, wn 是各个数据点的权重;
* x1, x2, …, xn 是各个数据点的数值;
* n 是数据点的总数。
*
* @param startTime startTime
* @param tableName tableName
* @param analysisObjectType analysisObjectType
* @return {@link List< FanHealthIndex>}
* @throws
* @author yangyang
* @date 2024/7/23 21:02
*/
List
<
PvHealthIndex
>
getInfoListByGroupByZzPv
(
String
startTime
,
String
tableName
,
String
analysisObjectType
);
/**
* 场站加权平均
* 加权平均数 = (w1 * x1 + w2 * x2 + … + wn * xn) / (w1 + w2 + … + wn)
* w1, w2, …, wn 是各个数据点的权重;
* x1, x2, …, xn 是各个数据点的数值;
* n 是数据点的总数。
*
* @param startTime startTime
* @param tableName tableName
* @param analysisObjectType analysisObjectType
* @return {@link List< FanHealthIndex>}
* @throws
* @author yangyang
* @date 2024/7/23 21:02
*/
List
<
PvHealthIndex
>
getInfoListByGroupByCzPv
(
String
startTime
,
String
tableName
,
String
analysisObjectType
);
/**
* 片区加权平均
* 加权平均数 = (w1 * x1 + w2 * x2 + … + wn * xn) / (w1 + w2 + … + wn)
* w1, w2, …, wn 是各个数据点的权重;
* x1, x2, …, xn 是各个数据点的数值;
* n 是数据点的总数。
*
* @param startTime startTime
* @param tableName tableName
* @param analysisObjectType analysisObjectType
* @return {@link List< FanHealthIndex>}
* @throws
* @author yangyang
* @date 2024/7/23 21:02
*/
List
<
PvHealthIndex
>
getInfoListByGroupByQyPv
(
String
startTime
,
String
tableName
,
String
analysisObjectType
);
/**
* 全域【所有 / 全国】加权平均
* 加权平均数 = (w1 * x1 + w2 * x2 + … + wn * xn) / (w1 + w2 + … + wn)
* w1, w2, …, wn 是各个数据点的权重;
* x1, x2, …, xn 是各个数据点的数值;
* n 是数据点的总数。
*
* @param startTime startTime
* @param tableName tableName
* @param analysisObjectType analysisObjectType
* @return {@link List< FanHealthIndex>}
* @throws
* @author yangyang
* @date 2024/7/23 21:02
*/
List
<
PvHealthIndex
>
getInfoListByGroupByQgPv
(
String
startTime
,
String
tableName
,
String
analysisObjectType
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/FanHealthIndexServiceImpl.java
View file @
4049bf7d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONArray
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWeight
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthLevelMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanWeightMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.IFanHealthIndexService
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.logging.log4j.util.Strings
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
*
TODO(一句话描述该类的功能)
*
风电 - 按时刻生成子系统、设备、场站、区域 数据
* <p>
* ProjectName: amos-boot-zx-biz
* PackageName: com.yeejoin.amos.boot.module.jxiop.biz.service.impl
...
...
@@ -35,25 +27,12 @@ import java.util.stream.Collectors;
*/
@Component
@Slf4j
public
class
FanHealthIndexServiceImpl
{
public
class
FanHealthIndexServiceImpl
implements
IFanHealthIndexService
{
@Autowired
private
FanHealthIndexMapper
fanHealthIndexMapper
;
@Autowired
private
IdxBizPvHealthIndexMapper
idxFanHealthIndexMapper
;
@Autowired
private
PvHealthIndexMapper
pvHealthIndexMapper
;
@Autowired
private
IdxBizFanHealthLevelMapper
idxBizFanHealthLevelMapper
;
@Autowired
private
IdxBizPvHealthLevelMapper
idxBizPvHealthLevelMapper
;
@Autowired
private
IdxBizFanWeightMapper
idxBizFanWeightMapper
;
/**
...
...
@@ -71,12 +50,13 @@ public class FanHealthIndexServiceImpl {
* @author yangyang
* @date 2024/7/23 21:02
*/
@Override
public
List
<
FanHealthIndex
>
getInfoListByGroupByZxtFan
(
String
startTime
,
String
tableName
,
String
analysisObjectType
)
{
List
<
FanHealthIndex
>
fanHealthIndicesZxt
=
fanHealthIndexMapper
.
getInfoList
(
startTime
,
tableName
,
analysisObjectType
);
QueryWrapper
<
IdxBizFanWeight
>
idxBizFanWeightQueryWrapper
=
new
QueryWrapper
<>();
idxBizFanWeightQueryWrapper
.
ne
(
"type"
,
"5"
);
List
<
IdxBizFanWeight
>
idxBizFanWeights
=
idxBizFanWeightMapper
.
selectList
(
idxBizFanWeightQueryWrapper
);
Map
<
String
,
Float
>
weightMap
=
idxBizFanWeights
.
stream
().
collect
(
Collectors
.
toMap
(
o
->
o
.
getArae
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubarray
()
+
o
.
get
OrgCode
()
+
o
.
get
PointName
(),
IdxBizFanWeight:
:
getValue
));
Map
<
String
,
Float
>
weightMap
=
idxBizFanWeights
.
stream
().
collect
(
Collectors
.
toMap
(
o
->
o
.
getArae
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubarray
()
+
o
.
getPointName
(),
IdxBizFanWeight:
:
getValue
));
// 开始计算加权平均
Map
<
String
,
List
<
FanHealthIndex
>>
fanHealthIndicesZxtMap
=
fanHealthIndicesZxt
.
stream
().
collect
(
Collectors
.
groupingBy
(
o
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubSystem
()
+
o
.
getOrgCode
()
+
o
.
getPointName
()));
List
<
FanHealthIndex
>
fanHealthIndicesZxtNews
=
new
ArrayList
<>();
...
...
@@ -120,6 +100,7 @@ public class FanHealthIndexServiceImpl {
* @author yangyang
* @date 2024/7/23 21:02
*/
@Override
public
List
<
FanHealthIndex
>
getInfoListByGroupBySbFan
(
String
startTime
,
String
tableName
,
String
analysisObjectType
)
{
List
<
FanHealthIndex
>
fanHealthIndicesZxt
=
fanHealthIndexMapper
.
getInfoList
(
startTime
,
tableName
,
analysisObjectType
);
QueryWrapper
<
IdxBizFanWeight
>
idxBizFanWeightQueryWrapper
=
new
QueryWrapper
<>();
...
...
@@ -167,6 +148,7 @@ public class FanHealthIndexServiceImpl {
* @author yangyang
* @date 2024/7/23 21:02
*/
@Override
public
List
<
FanHealthIndex
>
getInfoListByGroupByCzFan
(
String
startTime
,
String
tableName
,
String
analysisObjectType
)
{
List
<
FanHealthIndex
>
fanHealthIndicesZxt
=
fanHealthIndexMapper
.
getInfoList
(
startTime
,
tableName
,
analysisObjectType
);
QueryWrapper
<
IdxBizFanWeight
>
idxBizFanWeightQueryWrapper
=
new
QueryWrapper
<>();
...
...
@@ -212,6 +194,7 @@ public class FanHealthIndexServiceImpl {
* @author yangyang
* @date 2024/7/23 21:02
*/
@Override
public
List
<
FanHealthIndex
>
getInfoListByGroupByQyFan
(
String
startTime
,
String
tableName
,
String
analysisObjectType
)
{
List
<
FanHealthIndex
>
fanHealthIndicesZxt
=
fanHealthIndexMapper
.
getInfoList
(
startTime
,
tableName
,
analysisObjectType
);
QueryWrapper
<
IdxBizFanWeight
>
idxBizFanWeightQueryWrapper
=
new
QueryWrapper
<>();
...
...
@@ -255,6 +238,7 @@ public class FanHealthIndexServiceImpl {
* @author yangyang
* @date 2024/7/23 21:02
*/
@Override
public
List
<
FanHealthIndex
>
getInfoListByGroupByQgFan
(
String
startTime
,
String
tableName
,
String
analysisObjectType
)
{
List
<
FanHealthIndex
>
fanHealthIndicesZxt
=
fanHealthIndexMapper
.
getInfoList
(
startTime
,
tableName
,
analysisObjectType
);
QueryWrapper
<
IdxBizFanWeight
>
idxBizFanWeightQueryWrapper
=
new
QueryWrapper
<>();
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/PvHealthIndexServiceImpl.java
View file @
4049bf7d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWeight
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvHealthIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWeight
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthLevelMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanWeightMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvWeightMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.
tdMapper2.FanHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.
service.IPvHealthIndexService
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
...
...
@@ -35,24 +28,12 @@ import java.util.stream.Collectors;
*/
@Component
@Slf4j
public
class
PvHealthIndexServiceImpl
{
@Autowired
private
FanHealthIndexMapper
fanHealthIndexMapper
;
@Autowired
private
IdxBizPvHealthIndexMapper
idxFanHealthIndexMapper
;
public
class
PvHealthIndexServiceImpl
implements
IPvHealthIndexService
{
@Autowired
private
PvHealthIndexMapper
pvHealthIndexMapper
;
@Autowired
private
IdxBizFanHealthLevelMapper
idxBizFanHealthLevelMapper
;
@Autowired
private
IdxBizPvHealthLevelMapper
idxBizPvHealthLevelMapper
;
@Autowired
private
IdxBizPvWeightMapper
idxBizPvWeightMapper
;
/**
...
...
@@ -70,6 +51,7 @@ public class PvHealthIndexServiceImpl {
* @author yangyang
* @date 2024/7/23 21:02
*/
@Override
public
List
<
PvHealthIndex
>
getInfoListByGroupBySbPv
(
String
startTime
,
String
tableName
,
String
analysisObjectType
)
{
...
...
@@ -119,6 +101,7 @@ public class PvHealthIndexServiceImpl {
* @author yangyang
* @date 2024/7/23 21:02
*/
@Override
public
List
<
PvHealthIndex
>
getInfoListByGroupByZzPv
(
String
startTime
,
String
tableName
,
String
analysisObjectType
)
{
...
...
@@ -167,6 +150,7 @@ public class PvHealthIndexServiceImpl {
* @author yangyang
* @date 2024/7/23 21:02
*/
@Override
public
List
<
PvHealthIndex
>
getInfoListByGroupByCzPv
(
String
startTime
,
String
tableName
,
String
analysisObjectType
)
{
...
...
@@ -214,6 +198,7 @@ public class PvHealthIndexServiceImpl {
* @author yangyang
* @date 2024/7/23 21:02
*/
@Override
public
List
<
PvHealthIndex
>
getInfoListByGroupByQyPv
(
String
startTime
,
String
tableName
,
String
analysisObjectType
)
{
...
...
@@ -259,6 +244,7 @@ public class PvHealthIndexServiceImpl {
* @author yangyang
* @date 2024/7/23 21:02
*/
@Override
public
List
<
PvHealthIndex
>
getInfoListByGroupByQgPv
(
String
startTime
,
String
tableName
,
String
analysisObjectType
)
{
...
...
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 @
4049bf7d
...
...
@@ -9,6 +9,8 @@ import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvHealthLevel;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthLevelMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.IFanHealthIndexService
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.IPvHealthIndexService
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex
;
...
...
@@ -16,7 +18,6 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
...
...
@@ -54,6 +55,12 @@ public class TdengineTimeServiceImpl {
@Autowired
private
HealthStatusIndicatorServiceImpl
healthStatusIndicatorServiceImpl
;
@Autowired
private
IFanHealthIndexService
fanHealthIndexService
;
@Autowired
private
IPvHealthIndexService
pvHealthIndexService
;
/**
* 风电 - 按时刻生成子系统、设备、场站、区域 数据
*/
...
...
@@ -83,9 +90,6 @@ public class TdengineTimeServiceImpl {
}
@Autowired
private
FanHealthIndexServiceImpl
fanHealthIndexService
;
public
void
insertMomentDataNew
(
String
recDate
)
throws
ParseException
{
//s 489分钟 为 8小时 + 19分钟
String
startTime
=
DateUtils
.
dateFormat
(
DateUtils
.
dateAddMinutes
(
new
Date
(),
-
489
),
DateUtils
.
DATE_TIME_PATTERN
);
...
...
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