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
149f1b03
Commit
149f1b03
authored
Jul 30, 2024
by
wujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改片区参数
parent
886f2158
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
490 additions
and
97 deletions
+490
-97
AmosJxiopAnalyseApplication.java
...in/java/com/yeejoin/amos/AmosJxiopAnalyseApplication.java
+14
-13
TDBigScreenAnalyseController.java
...le/jxiop/biz/controller/TDBigScreenAnalyseController.java
+67
-44
IdxBizFanHealthIndexLatest.java
...t/module/jxiop/biz/entity/IdxBizFanHealthIndexLatest.java
+146
-0
IdxBizPvHealthIndexLatest.java
...ot/module/jxiop/biz/entity/IdxBizPvHealthIndexLatest.java
+157
-0
SyncESDataToTdengineMqttListener.java
.../jxiop/biz/listener/SyncESDataToTdengineMqttListener.java
+70
-32
IdxBizFanHealthIndexLatestMapper.java
...e/jxiop/biz/mapper2/IdxBizFanHealthIndexLatestMapper.java
+14
-0
IdxBizPvHealthIndexLatestMapper.java
...le/jxiop/biz/mapper2/IdxBizPvHealthIndexLatestMapper.java
+14
-0
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+8
-8
HealthStatusIndicatorServiceImpl.java
...op/biz/service/impl/HealthStatusIndicatorServiceImpl.java
+0
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/AmosJxiopAnalyseApplication.java
View file @
149f1b03
...
...
@@ -30,10 +30,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
java.net.InetAddress
;
/**
* <pre>
* 智信能源科技服务启动类
...
...
@@ -51,17 +49,19 @@ import java.net.InetAddress;
@EnableScheduling
@MapperScan
({
"org.typroject.tyboot.demo.face.orm.dao*"
,
"org.typroject.tyboot.face.*.orm.dao*"
,
"org.typroject.tyboot.core.auth.face.orm.dao*"
,
"org.typroject.tyboot.component.*.face.orm.dao*"
,
"com.yeejoin.amos.boot.module.**.api.mapper"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
,
"com.yeejoin.amos.boot.module.common.biz.*"
,
"com.yeejoin.amos.boot.module.jxiop.api.mapper"
,
"com.yeejoin.amos.boot.module.jxiop.biz.tdmapper"
,
"com.yeejoin.amos.boot.module.jxiop.biz.mapper5"
})
"com.yeejoin.amos.boot.module.**.api.mapper"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
,
"com.yeejoin.amos.boot.module.common.biz.*"
,
"com.yeejoin.amos.boot.module.jxiop.api.mapper"
,
"com.yeejoin.amos.boot.module.jxiop.biz.tdmapper"
,
"com.yeejoin.amos.boot.module.jxiop.biz.mapper5"
})
@ComponentScan
(
basePackages
=
{
"org.typroject"
,
"com.yeejoin.amos"
})
@SpringBootApplication
(
exclude
=
{
DataSourceAutoConfiguration
.
class
,
DruidDataSourceAutoConfigure
.
class
})
@SpringBootApplication
(
exclude
=
{
DataSourceAutoConfiguration
.
class
,
DruidDataSourceAutoConfigure
.
class
})
//@SpringBootApplication
public
class
AmosJxiopAnalyseApplication
{
@Autowired
private
EmqKeeper
emqKeeper
;
//本地是否执行健康指数算法开关
//
本地是否执行健康指数算法开关
@Value
(
"${openHealth:false}"
)
Boolean
openHealth
;
@Autowired
@Autowired
private
SyncESDataToTdengineMqttListener
syncESDataToTdengineMqttListener
;
@Autowired
private
SyncDasSuccessMqttListener
syncDasSuccessMqttListener
;
...
...
@@ -76,17 +76,18 @@ public class AmosJxiopAnalyseApplication {
String
path
=
oConvertUtils
.
getString
(
env
.
getProperty
(
"server.servlet.context-path"
));
logger
.
info
(
"\n----------------------------------------------------------\n\t"
+
"Application Amos-Biz-Boot-Jxiop-Montior is running! Access URLs:\n\t"
+
"Swagger文档: \thttp://"
+
ip
+
":"
+
port
+
path
+
"/doc.html\n"
+
"----------------------------------------------------------"
);
+
"Application Amos-Biz-Boot-Jxiop-Montior is running! Access URLs:\n\t"
+
"Swagger文档: \thttp://"
+
ip
+
":"
+
port
+
path
+
"/doc.html\n"
+
"----------------------------------------------------------"
);
}
@Bean
public
void
initMqtt
()
throws
Exception
{
if
(
openHealth
)
{
//订阅固化周期性数据成功的消息
emqKeeper
.
subscript
(
"sync_esdata_to_tdengine_notice"
,
1
,
syncESDataToTdengineMqttListener
);
//订阅业务固化同步数据成功消息
emqKeeper
.
subscript
(
"sync_iotdata_to_tdengine_notice"
,
1
,
syncDasSuccessMqttListener
);
if
(!
openHealth
)
{
return
;
}
// 订阅固化周期性数据成功的消息
emqKeeper
.
subscript
(
"sync_esdata_to_tdengine_notice"
,
1
,
syncESDataToTdengineMqttListener
);
// 订阅业务固化同步数据成功消息
emqKeeper
.
subscript
(
"sync_iotdata_to_tdengine_notice"
,
1
,
syncDasSuccessMqttListener
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/TDBigScreenAnalyseController.java
View file @
149f1b03
...
...
@@ -49,14 +49,19 @@ import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import
com.yeejoin.amos.boot.module.jxiop.biz.Enum.WarningPeriodEnum
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallDataDTO
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallInfoDTO
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthIndexLatest
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthLevel
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRuleSet
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvHealthIndexLatest
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvHealthLevel
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWarningRuleSet
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IndicatorData
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthIndexLatestMapper
;
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.IdxBizFanWarningRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthIndexLatestMapper
;
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.IPermissionService
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl
;
...
...
@@ -69,10 +74,8 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexDayMapper;
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.FanHealthIndexDay
;
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.PvHealthIndexDay
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.utils.TimeRangeUtil
;
...
...
@@ -94,6 +97,12 @@ public class TDBigScreenAnalyseController extends BaseController {
@Autowired
IdxBizFanHealthIndexMapper
idxBizFanHealthIndexMapper
;
@Autowired
IdxBizPvHealthIndexMapper
idxBizPvHealthIndexMapper
;
@Autowired
IdxBizFanHealthIndexLatestMapper
idxBizFanHealthIndexLatestMapper
;
@Autowired
IdxBizPvHealthIndexLatestMapper
idxBizPvHealthIndexLatestMapper
;
@Autowired
IdxBizFanWarningRecordMapper
idxBizFanWarningRecordMapper
;
@Autowired
IdxBizPvHealthLevelMapper
idxBizPvHealthLevelMapper
;
...
...
@@ -481,7 +490,7 @@ public class TDBigScreenAnalyseController extends BaseController {
FanHealthIndex
fanHealthIndex
=
fanHealthIndexMapper
.
selectOne
(
wrapper
);
LambdaQueryWrapper
<
FanHealthIndex
>
wrapperl
=
new
LambdaQueryWrapper
<
FanHealthIndex
>();
wrapperl
.
select
(
FanHealthIndex:
:
getTs
,
FanHealthIndex:
:
getArea
,
FanHealthIndex:
:
getHealthIndex
);
wrapperl
.
select
(
FanHealthIndex:
:
getTs
,
FanHealthIndex:
:
getArea
,
FanHealthIndex:
:
getHealthIndex
);
wrapperl
.
eq
(
FanHealthIndex:
:
getAnalysisType
,
"按10分钟"
);
wrapperl
.
eq
(
FanHealthIndex:
:
getAnalysisObjType
,
"片区"
);
wrapperl
.
eq
(
FanHealthIndex:
:
getAnalysisTime
,
fanHealthIndex
.
getAnalysisTime
());
...
...
@@ -512,47 +521,61 @@ public class TDBigScreenAnalyseController extends BaseController {
public
ResponseModel
<
Map
<
String
,
Object
>>
getStationHealthInfoByMinute
(
@RequestParam
(
required
=
false
)
String
areaCode
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
LambdaQueryWrapper
<
FanHealthIndex
>
wrapper
=
new
LambdaQueryWrapper
<
FanHealthIndex
>();
wrapper
.
orderByDesc
(
FanHealthIndex:
:
getTs
);
wrapper
.
eq
(
FanHealthIndex:
:
getAnalysisType
,
"按10分钟"
);
wrapper
.
eq
(
FanHealthIndex:
:
getAnalysisObjType
,
"片区"
);
wrapper
.
last
(
"limit 1"
);
FanHealthIndex
fanHealthIndex
=
fanHealthIndexMapper
.
selectOne
(
wrapper
);
LambdaQueryWrapper
<
FanHealthIndex
>
wrapperl
=
new
LambdaQueryWrapper
<
FanHealthIndex
>();
wrapperl
.
select
(
FanHealthIndex:
:
getTs
,
FanHealthIndex:
:
getStation
,
FanHealthIndex:
:
getHealthIndex
);
wrapperl
.
eq
(
FanHealthIndex:
:
getAnalysisType
,
"按10分钟"
);
wrapperl
.
eq
(
FanHealthIndex:
:
getAnalysisObjType
,
"场站"
);
wrapperl
.
eq
(
FanHealthIndex:
:
getArea
,
areaCode
+
"区域"
);
wrapperl
.
eq
(
FanHealthIndex:
:
getAnalysisTime
,
fanHealthIndex
.
getAnalysisTime
());
List
<
FanHealthIndex
>
fanHealthIndexList
=
fanHealthIndexMapper
.
selectList
(
wrapper
);
LambdaQueryWrapper
<
PvHealthIndex
>
wrapper1
=
new
LambdaQueryWrapper
<
PvHealthIndex
>();
wrapper1
.
orderByDesc
(
PvHealthIndex:
:
getTs
);
wrapper1
.
eq
(
PvHealthIndex:
:
getAnalysisType
,
"按10分钟"
);
wrapper1
.
eq
(
PvHealthIndex:
:
getAnalysisObjType
,
"片区"
);
wrapper1
.
last
(
"limit 1"
);
PvHealthIndex
pvHealthIndex
=
pvHealthIndexMapper
.
selectOne
(
wrapper1
);
LambdaQueryWrapper
<
PvHealthIndex
>
pvWrapper
=
new
LambdaQueryWrapper
<
PvHealthIndex
>();
pvWrapper
.
select
(
PvHealthIndex:
:
getTs
,
PvHealthIndex:
:
getStation
,
PvHealthIndex:
:
getHealthIndex
);
pvWrapper
.
eq
(
PvHealthIndex:
:
getAnalysisType
,
"按10分钟"
);
pvWrapper
.
eq
(
PvHealthIndex:
:
getAnalysisObjType
,
"场站"
);
pvWrapper
.
eq
(
PvHealthIndex:
:
getArea
,
areaCode
+
"区域"
);
pvWrapper
.
eq
(
PvHealthIndex:
:
getAnalysisTime
,
pvHealthIndex
.
getAnalysisTime
());
List
<
PvHealthIndex
>
pvHealthIndexList
=
pvHealthIndexMapper
.
selectList
(
pvWrapper
);
Map
<
String
,
List
<
FanHealthIndex
>>
fanHealthGroupedData
=
fanHealthIndexList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
FanHealthIndex:
:
getStation
));
Map
<
String
,
FanHealthIndex
>
fanHealthLatestData
=
fanHealthGroupedData
.
values
().
stream
()
.
map
(
list
->
list
.
stream
().
max
(
Comparator
.
comparing
(
FanHealthIndex:
:
getTs
)).
get
())
.
collect
(
Collectors
.
toMap
(
FanHealthIndex:
:
getStation
,
Function
.
identity
()));
Map
<
String
,
List
<
PvHealthIndex
>>
pvHealthGroupedData
=
pvHealthIndexList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
PvHealthIndex:
:
getStation
));
Map
<
String
,
PvHealthIndex
>
pvHealthLatestData
=
pvHealthGroupedData
.
values
().
stream
()
.
map
(
list
->
list
.
stream
().
max
(
Comparator
.
comparing
(
PvHealthIndex:
:
getTs
)).
get
())
.
collect
(
Collectors
.
toMap
(
PvHealthIndex:
:
getStation
,
Function
.
identity
()));
// LambdaQueryWrapper<FanHealthIndex> wrapper = new LambdaQueryWrapper<FanHealthIndex>();
// wrapper.orderByDesc(FanHealthIndex::getTs);
// wrapper.eq(FanHealthIndex::getAnalysisType, "按10分钟");
// wrapper.eq(FanHealthIndex::getAnalysisObjType, "片区");
// wrapper.last("limit 1");
// FanHealthIndex fanHealthIndex = fanHealthIndexMapper.selectOne(wrapper);
//
// LambdaQueryWrapper<FanHealthIndex> wrapperl = new LambdaQueryWrapper<FanHealthIndex>();
// wrapperl.select(FanHealthIndex::getTs,FanHealthIndex::getStation,FanHealthIndex::getHealthIndex);
// wrapperl.eq(FanHealthIndex::getAnalysisType, "按10分钟");
// wrapperl.eq(FanHealthIndex::getAnalysisObjType, "场站");
// wrapperl.eq(FanHealthIndex::getArea, areaCode+"区域");
// wrapperl.eq(FanHealthIndex::getAnalysisTime, fanHealthIndex.getAnalysisTime());
// wrapperl.last("limit 10");
// List<FanHealthIndex> fanHealthIndexList = fanHealthIndexMapper.selectList(wrapperl);
//
// LambdaQueryWrapper<PvHealthIndex> wrapper1 = new LambdaQueryWrapper<PvHealthIndex>();
// wrapper1.orderByDesc(PvHealthIndex::getTs);
// wrapper1.eq(PvHealthIndex::getAnalysisType, "按10分钟");
// wrapper1.eq(PvHealthIndex::getAnalysisObjType, "片区");
// wrapper1.last("limit 1");
// PvHealthIndex pvHealthIndex = pvHealthIndexMapper.selectOne(wrapper1);
//
// LambdaQueryWrapper<PvHealthIndex> pvWrapper = new LambdaQueryWrapper<PvHealthIndex>();
// pvWrapper.select(PvHealthIndex::getTs,PvHealthIndex::getStation,PvHealthIndex::getHealthIndex);
// pvWrapper.eq(PvHealthIndex::getAnalysisType, "按10分钟");
// pvWrapper.eq(PvHealthIndex::getAnalysisObjType, "场站");
// pvWrapper.eq(PvHealthIndex::getArea, areaCode+"区域");
// pvWrapper.eq(PvHealthIndex::getAnalysisTime, pvHealthIndex.getAnalysisTime());
// pvWrapper.last("limit 10");
// List<PvHealthIndex> pvHealthIndexList = pvHealthIndexMapper.selectList(pvWrapper);
LambdaQueryWrapper
<
IdxBizFanHealthIndexLatest
>
wrapperl
=
new
LambdaQueryWrapper
<
IdxBizFanHealthIndexLatest
>();
wrapperl
.
eq
(
IdxBizFanHealthIndexLatest:
:
getAnalysisType
,
"按10分钟"
);
wrapperl
.
eq
(
IdxBizFanHealthIndexLatest:
:
getAnalysisObjType
,
"场站"
);
wrapperl
.
eq
(
IdxBizFanHealthIndexLatest:
:
getArae
,
areaCode
+
"区域"
);
List
<
IdxBizFanHealthIndexLatest
>
fanHealthIndexList
=
idxBizFanHealthIndexLatestMapper
.
selectList
(
wrapperl
);
LambdaQueryWrapper
<
IdxBizPvHealthIndexLatest
>
wrapperp
=
new
LambdaQueryWrapper
<
IdxBizPvHealthIndexLatest
>();
wrapperp
.
eq
(
IdxBizPvHealthIndexLatest:
:
getAnalysisType
,
"按10分钟"
);
wrapperp
.
eq
(
IdxBizPvHealthIndexLatest:
:
getAnalysisObjType
,
"场站"
);
wrapperp
.
eq
(
IdxBizPvHealthIndexLatest:
:
getArae
,
areaCode
+
"区域"
);
List
<
IdxBizPvHealthIndexLatest
>
pvHealthIndexList
=
idxBizPvHealthIndexLatestMapper
.
selectList
(
wrapperp
);
Map
<
String
,
List
<
IdxBizFanHealthIndexLatest
>>
fanHealthGroupedData
=
fanHealthIndexList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
IdxBizFanHealthIndexLatest:
:
getStation
));
Map
<
String
,
IdxBizFanHealthIndexLatest
>
fanHealthLatestData
=
fanHealthGroupedData
.
values
().
stream
()
.
map
(
list
->
list
.
stream
().
max
(
Comparator
.
comparing
(
IdxBizFanHealthIndexLatest:
:
getRecDate
)).
get
())
.
collect
(
Collectors
.
toMap
(
IdxBizFanHealthIndexLatest:
:
getStation
,
Function
.
identity
()));
Map
<
String
,
List
<
IdxBizPvHealthIndexLatest
>>
pvHealthGroupedData
=
pvHealthIndexList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
IdxBizPvHealthIndexLatest:
:
getStation
));
Map
<
String
,
IdxBizPvHealthIndexLatest
>
pvHealthLatestData
=
pvHealthGroupedData
.
values
().
stream
()
.
map
(
list
->
list
.
stream
().
max
(
Comparator
.
comparing
(
IdxBizPvHealthIndexLatest:
:
getRecDate
)).
get
())
.
collect
(
Collectors
.
toMap
(
IdxBizPvHealthIndexLatest:
:
getStation
,
Function
.
identity
()));
List
<
String
>
finalAxisData
=
new
ArrayList
<>();
List
<
Object
>
finaleSeriesData
=
new
ArrayList
<>();
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/entity/IdxBizFanHealthIndexLatest.java
0 → 100644
View file @
149f1b03
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
/**
*
*
* @author system_generator
* @date 2023-08-15
*/
@Data
@Accessors
(
chain
=
true
)
@TableName
(
"fan_health_index_latest_data"
)
public
class
IdxBizFanHealthIndexLatest
{
private
static
final
long
serialVersionUID
=
1L
;
/**
*
*/
@TableId
(
value
=
"SEQUENCE_NBR"
,
type
=
IdType
.
ID_WORKER_STR
)
private
String
sequenceNbr
;
/**
*
*/
@TableField
(
"REC_DATE"
)
private
Date
recDate
;
/**
* 分析维度类型
*/
@TableField
(
"ANALYSIS_OBJ_TYPE"
)
private
String
analysisObjType
;
/**
* 分析维度seq
*/
@TableField
(
"ANALYSIS_OBJ_SEQ"
)
private
String
analysisObjSeq
;
/**
*
*/
@TableField
(
"WEIGTH"
)
private
Double
weigth
;
/**
*
*/
@TableField
(
"HEALTH_INDEX"
)
private
Double
healthIndex
;
/**
* 健康等级
*/
@TableField
(
"HEALTH_LEVEL"
)
private
String
healthLevel
;
/**
*
*/
@TableField
(
"ANALYSIS_TYPE"
)
private
String
analysisType
;
/**
*
*/
@TableField
(
"ANALYSIS_START_TIME"
)
private
Date
analysisStartTime
;
/**
*
*/
@TableField
(
"ANALYSIS_END_TIME"
)
private
Date
analysisEndTime
;
/**
* 片区
*/
@TableField
(
"ARAE"
)
private
String
arae
;
/**
* 场站
*/
@TableField
(
"STATION"
)
private
String
station
;
/**
* 子系统
*/
@TableField
(
"SUB_SYSTEM"
)
private
String
subSystem
;
/**
* 型号
*/
@TableField
(
"NUMBER"
)
private
String
number
;
/**
* 设备名称
*/
@TableField
(
"EQUIPMENT_NAME"
)
private
String
equipmentName
;
/**
*
*/
@TableField
(
"GATEWAY_ID"
)
private
String
gatewayId
;
/**
* 点表地址
*/
@TableField
(
"INDEX_ADDRESS"
)
private
String
indexAddress
;
@TableField
(
"ANOMALY"
)
private
Double
ANOMALY
;
/**
* 分析变量名称
*/
@TableField
(
"POINT_NAME"
)
private
String
pointName
;
@TableField
(
"ANALYSIS_TIME"
)
private
String
ANALYSISTIME
;
/**
* KKS码
*/
@TableField
(
"KKS"
)
private
String
kks
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/entity/IdxBizPvHealthIndexLatest.java
0 → 100644
View file @
149f1b03
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
/**
*
*
* @author system_generator
* @date 2023-08-15
*/
@Data
@Accessors
(
chain
=
true
)
@TableName
(
"pv_health_index_latest_data"
)
public
class
IdxBizPvHealthIndexLatest
{
private
static
final
long
serialVersionUID
=
1L
;
/**
*
*/
@TableId
(
value
=
"SEQUENCE_NBR"
,
type
=
IdType
.
ID_WORKER_STR
)
private
String
sequenceNbr
;
/**
*
*/
@TableField
(
"REC_DATE"
)
private
Date
recDate
;
/**
* 分析维度类型
*/
@TableField
(
"ANALYSIS_OBJ_TYPE"
)
private
String
analysisObjType
;
/**
* 分析维度seq
*/
@TableField
(
"ANALYSIS_OBJ_SEQ"
)
private
String
analysisObjSeq
;
/**
*
*/
@TableField
(
"WEIGTH"
)
private
Double
weigth
;
/**
*
*/
@TableField
(
"HEALTH_INDEX"
)
private
Double
healthIndex
;
/**
* 健康等级
*/
@TableField
(
"HEALTH_LEVEL"
)
private
String
healthLevel
;
/**
* 分析周期
*/
@TableField
(
"ANALYSIS_TYPE"
)
private
String
analysisType
;
/**
*
*/
@TableField
(
"ANALYSIS_START_TIME"
)
private
Date
analysisStartTime
;
/**
*
*/
@TableField
(
"ANALYSIS_END_TIME"
)
private
Date
analysisEndTime
;
/**
* 片区
*/
@TableField
(
"ARAE"
)
private
String
arae
;
/**
* 场站
*/
@TableField
(
"STATION"
)
private
String
station
;
/**
* 子阵
*/
@TableField
(
"SUBARRAY"
)
private
String
subarray
;
/**
* 厂商
*/
@TableField
(
"MANUFACTURER"
)
private
String
manufacturer
;
/**
* 设备类型
*/
@TableField
(
"DEVICE_TYPE"
)
private
String
deviceType
;
/**
* 网关ID
*/
@TableField
(
"GATEWAY_ID"
)
private
String
gatewayId
;
/**
* 点表地址
*/
@TableField
(
"INDEX_ADDRESS"
)
private
String
indexAddress
;
/**
* 设备名称
*/
@TableField
(
"EQUIPMENT_NAME"
)
private
String
equipmentName
;
@TableField
(
"ANOMALY"
)
private
Double
ANOMALY
;
/**
* 分析变量名称
*/
@TableField
(
"POINT_NAME"
)
private
String
pointName
;
@TableField
(
"ANALYSIS_TIME"
)
private
String
ANALYSISTIME
;
/**
* KKS码
*/
@TableField
(
"KKS"
)
private
String
kks
;
}
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 @
149f1b03
...
...
@@ -5,6 +5,9 @@ import java.util.Date;
import
java.util.concurrent.CountDownLatch
;
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
;
...
...
@@ -13,6 +16,7 @@ import org.typroject.tyboot.component.emq.EmqxListener;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
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.TdengineTimeServiceImpl
;
...
...
@@ -28,12 +32,24 @@ public class SyncESDataToTdengineMqttListener extends EmqxListener {
@Autowired
private
CommonServiceImpl
commonServiceImpl
;
@Autowired
private
TdengineTimeServiceImpl
tdengineTimeService
;
@Autowired
private
TdengineTimeServiceImpl
tdengineTimeService
;
@Autowired
private
RedisUtils
redisUtils
;
private
final
static
String
JXIOP_ANALYSE_TIME
=
"JXIOP_ANALYSE_TIME"
;
@PostConstruct
public
void
test
()
{
// 每次启动清空redis
//redisUtils.set(JXIOP_ANALYSE_TIME, "2024-07-30 13:40:00");
redisUtils
.
del
(
JXIOP_ANALYSE_TIME
);
}
@Override
public
void
processMessage
(
String
topic
,
MqttMessage
mqttMessage
)
throws
InterruptedException
,
ParseException
{
public
void
processMessage
(
String
topic
,
MqttMessage
mqttMessage
)
throws
ParseException
{
log
.
info
(
topic
+
"收到数据同步成功,开始计算健康指数!"
);
byte
[]
payload
=
mqttMessage
.
getPayload
();
String
str
=
new
String
(
payload
);
...
...
@@ -41,31 +57,53 @@ public class SyncESDataToTdengineMqttListener extends EmqxListener {
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
msg
);
String
flag
=
jsonObject
.
get
(
"sync_flag"
).
toString
();
if
(
"success"
.
equals
(
flag
))
{
Date
time
=
new
Date
();
time
=
DateUtil
.
offsetMinute
(
time
,
-
DateUtil
.
minute
(
time
)
%
10
);
String
format
=
DateUtil
.
format
(
time
,
"yyyy-MM-dd HH:mm:00"
);
time
=
DateUtil
.
parse
(
format
,
"yyyy-MM-dd HH:mm:00"
);
ExecutorService
excutorService
=
Executors
.
newFixedThreadPool
(
4
);
if
(
redisUtils
.
get
(
JXIOP_ANALYSE_TIME
)
!=
null
)
{
// 如果相差20分钟 按10分钟处理 可能装备发消息晚了
String
lastformat
=
String
.
valueOf
(
redisUtils
.
get
(
JXIOP_ANALYSE_TIME
));
Date
oldTime
=
DateUtil
.
parse
(
lastformat
,
"yyyy-MM-dd HH:mm:00"
);
long
diffInMillies
=
Math
.
abs
(
time
.
getTime
()
-
oldTime
.
getTime
());
long
diffInMinutes
=
TimeUnit
.
MINUTES
.
convert
(
diffInMillies
,
TimeUnit
.
MILLISECONDS
);
if
(
diffInMinutes
==
20
)
{
time
=
DateUtil
.
offsetMinute
(
time
,
-
10
);
format
=
DateUtil
.
format
(
time
,
"yyyy-MM-dd HH:mm:00"
);
}
}
redisUtils
.
set
(
JXIOP_ANALYSE_TIME
,
format
);
System
.
out
.
println
(
format
);
final
Date
timeF
=
time
;
ExecutorService
excutorService
=
Executors
.
newFixedThreadPool
(
10
);
int
taskCount
=
2
;
final
CountDownLatch
latch
=
new
CountDownLatch
(
taskCount
);
excutorService
.
submit
(()->{
commonServiceImpl
.
healthWarningMinuteByFan
();
excutorService
.
submit
(()
->
{
commonServiceImpl
.
healthWarningMinuteByFan
(
timeF
);
System
.
out
.
println
(
"风电任务完成.."
);
latch
.
countDown
();
});
excutorService
.
submit
(()->{
commonServiceImpl
.
healthWarningMinuteByPv
();
excutorService
.
submit
(()
->
{
commonServiceImpl
.
healthWarningMinuteByPv
(
timeF
);
System
.
out
.
println
(
"光伏任务完成.."
);
latch
.
countDown
();
});
System
.
out
.
println
(
"等待所有任务完成.."
);
latch
.
await
();
System
.
out
.
println
(
"所有任务完成"
);
//区域 全域最后统一生成
try
{
System
.
out
.
println
(
"等待所有任务完成.."
);
latch
.
await
();
System
.
out
.
println
(
"所有任务完成"
);
}
catch
(
InterruptedException
e
)
{
System
.
out
.
println
(
"任务执行异常"
);
e
.
printStackTrace
();
Thread
.
currentThread
().
interrupt
();
}
// 结束线程池
excutorService
.
shutdown
();
// 区域 全域最后统一生成
tdengineTimeService
.
insertMomentDataAll
(
format
);
// // 开始异步计算光伏的健康指数算法
// new Thread(() -> {
// // 调用光伏的健康指数算法
...
...
@@ -77,19 +115,19 @@ public class SyncESDataToTdengineMqttListener extends EmqxListener {
// commonServiceImpl.healthWarningMinuteByFan();
// }).start();
}
if
(
"pvsuccess"
.
equals
(
flag
))
{
// 开始异步计算光伏的健康指数算法
new
Thread
(()
->
{
// 调用光伏的健康指数算法
commonServiceImpl
.
healthWarningMinuteByPv
();
}).
start
();
}
if
(
"fansuccess"
.
equals
(
flag
))
{
// 开始异步计算光伏的健康指数算法
new
Thread
(()
->
{
// 调用光伏的健康指数算法
commonServiceImpl
.
healthWarningMinuteByFan
();
}).
start
();
}
//
if ("pvsuccess".equals(flag)) {
//
// 开始异步计算光伏的健康指数算法
//
new Thread(() -> {
//
// 调用光伏的健康指数算法
//
commonServiceImpl.healthWarningMinuteByPv();
//
}).start();
//
}
//
if ("fansuccess".equals(flag)) {
//
// 开始异步计算光伏的健康指数算法
//
new Thread(() -> {
//
// 调用光伏的健康指数算法
//
commonServiceImpl.healthWarningMinuteByFan();
//
}).start();
//
}
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/mapper2/IdxBizFanHealthIndexLatestMapper.java
0 → 100644
View file @
149f1b03
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
mapper2
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthIndexLatest
;
/**
* Mapper 接口
*
* @author system_generator
* @date 2023-08-15
*/
public
interface
IdxBizFanHealthIndexLatestMapper
extends
BaseMapper
<
IdxBizFanHealthIndexLatest
>
{
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/mapper2/IdxBizPvHealthIndexLatestMapper.java
0 → 100644
View file @
149f1b03
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
mapper2
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvHealthIndexLatest
;
/**
* Mapper 接口
*
* @author system_generator
* @date 2023-08-15
*/
public
interface
IdxBizPvHealthIndexLatestMapper
extends
BaseMapper
<
IdxBizPvHealthIndexLatest
>
{
}
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 @
149f1b03
...
...
@@ -1828,15 +1828,15 @@ public class CommonServiceImpl {
// @Scheduled(cron = "0 0/10 * * * ?")
// @Async("async")
public
void
healthWarningMinuteByFan
()
{
public
void
healthWarningMinuteByFan
(
Date
time
)
{
if
(!
openHealth
)
{
return
;
}
Date
time
=
new
Date
();
time
=
DateUtil
.
offsetMinute
(
time
,
-
DateUtil
.
minute
(
time
)
%
10
);
//
Date time = new Date();
//
time = DateUtil.offsetMinute(time, -DateUtil.minute(time) % 10);
String
format
=
DateUtil
.
format
(
time
,
"yyyy-MM-dd HH:mm:00"
);
time
=
DateUtil
.
parse
(
format
,
"yyyy-MM-dd HH:mm:00"
);
//
time = DateUtil.parse(format, "yyyy-MM-dd HH:mm:00");
logger
.
info
(
"风机---------------------健康指数时间----"
+
time
);
// Calendar calendar = Calendar.getInstance();
List
<
IdxBizFanPointProcessVariableClassificationDto
>
data
=
idxBizFanPointProcessVariableClassificationMapper
...
...
@@ -2455,15 +2455,15 @@ public class CommonServiceImpl {
// @Scheduled(cron = "0 0/10 * * * ?")
// @Async("async")
public
void
healthWarningMinuteByPv
()
{
public
void
healthWarningMinuteByPv
(
Date
time
)
{
if
(!
openHealth
)
{
return
;
}
// Calendar calendar = Calendar.getInstance();
Date
time
=
new
Date
();
time
=
DateUtil
.
offsetMinute
(
time
,
-
DateUtil
.
minute
(
time
)
%
10
);
//
Date time = new Date();
//
time = DateUtil.offsetMinute(time, -DateUtil.minute(time) % 10);
String
format
=
DateUtil
.
format
(
time
,
"yyyy-MM-dd HH:mm:00"
);
time
=
DateUtil
.
parse
(
format
,
"yyyy-MM-dd HH:mm:00"
);
//
time = DateUtil.parse(format, "yyyy-MM-dd HH:mm:00");
logger
.
info
(
"光伏---------------------健康指数时间----"
+
time
);
List
<
IdxBizPvPointProcessVariableClassificationDto
>
data
=
idxBizPvPointProcessVariableClassificationMapper
.
getInfluxDBData
();
...
...
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 @
149f1b03
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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