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
f4661b31
Commit
f4661b31
authored
Oct 17, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修改
parent
10f58548
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
115 additions
and
113 deletions
+115
-113
BigScreenAnalyseController.java
...dule/jxiop/biz/controller/BigScreenAnalyseController.java
+2
-2
WarningRecordStatusMessage.java
...oot/module/jxiop/biz/emqx/WarningRecordStatusMessage.java
+2
-0
WarningRecordStatusMessage2.java
...ot/module/jxiop/biz/emqx/WarningRecordStatusMessage2.java
+2
-0
IdxBizFanHealthIndexMapper.java
.../module/jxiop/biz/mapper2/IdxBizFanHealthIndexMapper.java
+2
-1
InfluxDButils.java
...ejoin/amos/boot/module/jxiop/biz/utils/InfluxDButils.java
+101
-101
IdxBizFanHealthIndexMapper.xml
...n/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
+6
-9
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/BigScreenAnalyseController.java
View file @
f4661b31
...
...
@@ -367,9 +367,9 @@ public class BigScreenAnalyseController extends BaseController {
if
(
CharSequenceUtil
.
isNotEmpty
(
stationType
))
{
if
(
"fan"
.
equals
(
stationType
))
{
allEquipAlarmInfo
=
idxBizFanHealthIndexMapper
.
getAllEquipAlarmInfoAnalysisByStationType
(
"idx_biz_fan_warning_record"
,
areaCode
,
"idx_biz_fan_point_process_variable_classification"
);
allEquipAlarmInfo
=
idxBizFanHealthIndexMapper
.
getAllEquipAlarmInfoAnalysisByStationType
(
"idx_biz_fan_warning_record"
,
areaCode
,
"idx_biz_fan_point_process_variable_classification"
,
"风电"
);
}
else
if
(
"pv"
.
equals
(
stationType
))
{
allEquipAlarmInfo
=
idxBizFanHealthIndexMapper
.
getAllEquipAlarmInfoAnalysisByStationType
(
"idx_biz_pv_warning_record"
,
areaCode
,
"idx_biz_pv_point_process_variable_classification"
);
allEquipAlarmInfo
=
idxBizFanHealthIndexMapper
.
getAllEquipAlarmInfoAnalysisByStationType
(
"idx_biz_pv_warning_record"
,
areaCode
,
"idx_biz_pv_point_process_variable_classification"
,
"光伏"
);
}
}
else
{
allEquipAlarmInfo
=
idxBizFanHealthIndexMapper
.
getAllEquipAlarmInfoAnalysisByArea
(
areaCode
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/emqx/WarningRecordStatusMessage.java
View file @
f4661b31
...
...
@@ -73,11 +73,13 @@ public class WarningRecordStatusMessage extends EmqxListener {
if
(
ObjectUtils
.
isNotEmpty
(
analysisResult
)
&&
analysisResult
.
get
(
"warningObjectType"
).
toString
().
equals
(
"pv"
))
{
LambdaUpdateWrapper
<
IdxBizFanWarningRecord
>
lambda
=
new
LambdaUpdateWrapper
<>();
lambda
.
set
(
IdxBizFanWarningRecord:
:
getDisposotionState
,
"已处置"
);
lambda
.
set
(
IdxBizFanWarningRecord:
:
getStatus
,
"1"
);
lambda
.
eq
(
IdxBizFanWarningRecord:
:
getSequenceNbr
,
analysisResult
.
get
(
"objectId"
));
idxBizFanWarningRecordService
.
update
(
lambda
);
}
else
if
(
ObjectUtils
.
isNotEmpty
(
analysisResult
)
&&
analysisResult
.
get
(
"warningObjectType"
).
toString
().
equals
(
"fan"
))
{
LambdaUpdateWrapper
<
IdxBizPvWarningRecord
>
lambda
=
new
LambdaUpdateWrapper
<>();
lambda
.
set
(
IdxBizPvWarningRecord:
:
getDisposotionState
,
"已处置"
);
lambda
.
set
(
IdxBizPvWarningRecord:
:
getStatus
,
"1"
);
lambda
.
eq
(
IdxBizPvWarningRecord:
:
getSequenceNbr
,
analysisResult
.
get
(
"objectId"
));
idxBizPvWarningRecordService
.
update
(
lambda
);
}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/emqx/WarningRecordStatusMessage2.java
View file @
f4661b31
...
...
@@ -79,12 +79,14 @@ public class WarningRecordStatusMessage2 extends EmqxListener {
if
(
ObjectUtils
.
isNotEmpty
(
analysisResult
)
&&
analysisResult
.
get
(
"warningObjectType"
).
toString
().
equals
(
"pv"
))
{
LambdaUpdateWrapper
<
IdxBizFanWarningRecord
>
lambda
=
new
LambdaUpdateWrapper
<>();
lambda
.
set
(
IdxBizFanWarningRecord:
:
getDisposotionState
,
"已处置"
);
lambda
.
set
(
IdxBizFanWarningRecord:
:
getStatus
,
"1"
);
List
<
String
>
traceIds
=
(
List
<
String
>)
analysisResult
.
get
(
"traceIds"
);
lambda
.
in
(
IdxBizFanWarningRecord:
:
getSequenceNbr
,
traceIds
);
idxBizFanWarningRecordService
.
update
(
lambda
);
}
else
if
(
ObjectUtils
.
isNotEmpty
(
analysisResult
)
&&
analysisResult
.
get
(
"warningObjectType"
).
toString
().
equals
(
"fan"
))
{
LambdaUpdateWrapper
<
IdxBizPvWarningRecord
>
lambda
=
new
LambdaUpdateWrapper
<>();
lambda
.
set
(
IdxBizPvWarningRecord:
:
getDisposotionState
,
"已处置"
);
lambda
.
set
(
IdxBizPvWarningRecord:
:
getStatus
,
"1"
);
List
<
String
>
traceIds
=
(
List
<
String
>)
analysisResult
.
get
(
"traceIds"
);
lambda
.
eq
(
IdxBizPvWarningRecord:
:
getSequenceNbr
,
traceIds
);
idxBizPvWarningRecordService
.
update
(
lambda
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/mapper2/IdxBizFanHealthIndexMapper.java
View file @
f4661b31
...
...
@@ -38,7 +38,8 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
List
<
Map
<
String
,
Object
>>
getAllEquipAlarmInfoAnalysisByStationType
(
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"areaCode"
)
String
areaCode
,
@Param
(
"tableName2"
)
String
tableName2
);
@Param
(
"tableName2"
)
String
tableName2
,
@Param
(
"stationType"
)
String
stationType
);
List
<
Map
<
String
,
Object
>>
getAllEquipAlarmInfoAnalysisByArea
(
@Param
(
"areaCode"
)
String
areaCode
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/utils/InfluxDButils.java
View file @
f4661b31
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
utils
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.component.influxdb.InfluxDbConnection
;
import
com.yeejoin.amos.component.influxdb.InfluxdbUtil
;
import
org.influxdb.dto.QueryResult
;
import
org.springframework.beans.BeanWrapperImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Component
public
class
InfluxDButils
{
@Autowired
InfluxDbConnection
influxDbConnection
;
@Autowired
InfluxdbUtil
influxdbUtil
;
public
<
T
>
List
<
T
>
getListData
(
String
sql
,
Class
<
T
>
clazz
)
{
List
<
T
>
list
=
new
ArrayList
<>();
try
{
QueryResult
query
=
influxDbConnection
.
query
(
sql
);
List
<
QueryResult
.
Result
>
queryResults
=
query
.
getResults
();
for
(
QueryResult
.
Result
result
:
queryResults
)
{
List
<
QueryResult
.
Series
>
series
=
result
.
getSeries
();
if
(
series
==
null
)
{
continue
;
}
for
(
QueryResult
.
Series
serie
:
series
)
{
List
<
List
<
Object
>>
values
=
serie
.
getValues
();
List
<
String
>
columns
=
serie
.
getColumns
();
for
(
int
i
=
0
;
i
<
values
.
size
();
++
i
)
{
T
object
=
clazz
.
newInstance
();
BeanWrapperImpl
bean
=
new
BeanWrapperImpl
(
object
);
for
(
int
j
=
0
;
j
<
columns
.
size
();
++
j
)
{
String
k
=
columns
.
get
(
j
);
Object
v
=
values
.
get
(
i
).
get
(
j
);
if
(
"time"
.
equals
(
k
))
{
continue
;
}
else
{
bean
.
setPropertyValue
(
k
,
v
);
}
}
list
.
add
(
object
);
}
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
list
;
}
public
<
T
>
List
<
T
>
getListData1
(
String
sql
,
Class
<
T
>
clazz
)
{
List
<
T
>
list
=
new
ArrayList
<>();
try
{
List
<
Map
<
String
,
Object
>>
mapList
=
influxdbUtil
.
query
(
sql
);
list
=
mapList
.
stream
().
map
(
stringObjectMap
->
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
stringObjectMap
),
clazz
)).
collect
(
Collectors
.
toList
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
list
;
}
public
<
T
>
List
<
T
>
getListDataAll
(
String
sql
,
Class
<
T
>
clazz
)
{
List
<
T
>
list
=
new
ArrayList
<>();
try
{
QueryResult
query
=
influxDbConnection
.
query
(
sql
);
List
<
QueryResult
.
Result
>
queryResults
=
query
.
getResults
();
for
(
QueryResult
.
Result
result
:
queryResults
)
{
List
<
QueryResult
.
Series
>
series
=
result
.
getSeries
();
if
(
series
==
null
)
{
continue
;
}
for
(
QueryResult
.
Series
serie
:
series
)
{
List
<
List
<
Object
>>
values
=
serie
.
getValues
();
List
<
String
>
columns
=
serie
.
getColumns
();
for
(
int
i
=
0
;
i
<
values
.
size
();
++
i
)
{
T
object
=
clazz
.
newInstance
();
BeanWrapperImpl
bean
=
new
BeanWrapperImpl
(
object
);
for
(
int
j
=
0
;
j
<
columns
.
size
();
++
j
)
{
String
k
=
columns
.
get
(
j
);
Object
v
=
values
.
get
(
i
).
get
(
j
);
bean
.
setPropertyValue
(
k
,
v
);
}
list
.
add
(
object
);
}
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
list
;
}
}
//
package com.yeejoin.amos.boot.module.jxiop.biz.utils;
//
//
import com.alibaba.fastjson.JSON;
//
import com.alibaba.fastjson.JSONObject;
//
import com.yeejoin.amos.component.influxdb.InfluxDbConnection;
//
import com.yeejoin.amos.component.influxdb.InfluxdbUtil;
//
import org.influxdb.dto.QueryResult;
//
import org.springframework.beans.BeanWrapperImpl;
//
import org.springframework.beans.factory.annotation.Autowired;
//
import org.springframework.stereotype.Component;
//
//
import java.util.ArrayList;
//
import java.util.List;
//
import java.util.Map;
//
import java.util.stream.Collectors;
//
//
@Component
//
public class InfluxDButils {
//
@Autowired
//
InfluxDbConnection influxDbConnection;
//
@Autowired
//
InfluxdbUtil influxdbUtil;
//
public <T> List<T> getListData(String sql, Class<T> clazz) {
//
List<T> list = new ArrayList<>();
//
try {
//
QueryResult query = influxDbConnection.query(sql);
//
List<QueryResult.Result> queryResults = query.getResults();
//
for (QueryResult.Result result : queryResults) {
//
List<QueryResult.Series> series = result.getSeries();
//
if (series == null) {
//
continue;
//
}
//
for (QueryResult.Series serie : series) {
//
List<List<Object>> values = serie.getValues();
//
List<String> columns = serie.getColumns();
//
for (int i = 0; i < values.size(); ++i) {
//
T object = clazz.newInstance();
//
BeanWrapperImpl bean = new BeanWrapperImpl(object);
//
for (int j = 0; j < columns.size(); ++j) {
//
String k = columns.get(j);
//
Object v = values.get(i).get(j);
//
if ("time".equals(k)) {
//
continue;
//
} else {
//
bean.setPropertyValue(k, v);
//
}
//
}
//
list.add(object);
//
}
//
}
//
}
//
} catch (Exception e) {
//
e.printStackTrace();
//
}
//
return list;
//
}
//
//
public <T> List<T> getListData1(String sql, Class<T> clazz) {
//
List<T> list = new ArrayList<>();
//
try {
//
List<Map<String,Object>> mapList = influxdbUtil.query(sql);
//
list=mapList.stream().map(stringObjectMap -> JSONObject.parseObject(JSON.toJSONString(stringObjectMap),clazz)).collect(Collectors.toList());
//
} catch (Exception e) {
//
e.printStackTrace();
//
}
//
return list;
//
}
//
//
public <T> List<T> getListDataAll(String sql, Class<T> clazz) {
//
List<T> list = new ArrayList<>();
//
try {
//
QueryResult query = influxDbConnection.query(sql);
//
List<QueryResult.Result> queryResults = query.getResults();
//
for (QueryResult.Result result : queryResults) {
//
List<QueryResult.Series> series = result.getSeries();
//
if (series == null) {
//
continue;
//
}
//
for (QueryResult.Series serie : series) {
//
List<List<Object>> values = serie.getValues();
//
List<String> columns = serie.getColumns();
//
for (int i = 0; i < values.size(); ++i) {
//
T object = clazz.newInstance();
//
BeanWrapperImpl bean = new BeanWrapperImpl(object);
//
for (int j = 0; j < columns.size(); ++j) {
//
String k = columns.get(j);
//
Object v = values.get(i).get(j);
//
//
bean.setPropertyValue(k, v);
//
//
}
//
list.add(object);
//
}
//
}
//
}
//
} catch (Exception e) {
//
e.printStackTrace();
//
}
//
return list;
//
}
//
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
View file @
f4661b31
...
...
@@ -75,7 +75,7 @@
<select
id=
"getHealthListInfo"
resultType=
"java.util.Map"
>
SELECT
IFNULL( AVG( HEALTH_INDEX ), 100 ) AS avgHealthIndex,
a.
date
DATE_ADD( a.date, INTERVAL - 1 DAY ) as
date
FROM
(
SELECT
...
...
@@ -278,7 +278,7 @@
<select
id=
"getAllEquipAlarmInfoAnalysisByStationType"
resultType=
"java.util.Map"
>
SELECT
<!-- ( SELECT POINT_NAME FROM ${tableName2} WHERE GATEWAY_ID = a.GATEWAY_ID AND INDEX_ADDRESS = a.INDEX_ADDRESS ) AS pointName,-->
b.POINT_NAME
as pointName,
concat(#{stationType}, '-', b.POINT_NAME)
as pointName,
a.WARNING_NAME as warningName,
count(1) as num
FROM
...
...
@@ -302,9 +302,8 @@
(
SELECT
wr.WARNING_NAME AS warningName,
wr.POINT_NAME AS pointName,
count( 1 ) AS num,
wr.STATION as station
concat('光伏-', wr.POINT_NAME) AS pointName,
count( 1 ) AS num
FROM
idx_biz_pv_warning_record wr
<where>
...
...
@@ -317,9 +316,8 @@
warningName UNION ALL
SELECT
wr.WARNING_NAME AS warningName,
wr.POINT_NAME AS pointName,
count( 1 ) AS num,
wr.STATION as station
concat('风电-', wr.POINT_NAME) AS pointName,
count( 1 ) AS num
FROM
idx_biz_fan_warning_record wr
<where>
...
...
@@ -334,7 +332,6 @@
WHERE
a.pointName IS NOT NULL
AND a.pointName != ''
GROUP BY pointName ,STATION,warningName
</select>
<select
id=
"getSubSystemInfo"
resultType=
"java.util.Map"
>
...
...
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