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
c52dc06b
Commit
c52dc06b
authored
Oct 13, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
34b7fa08
b01b710b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
104 additions
and
110 deletions
+104
-110
IdxBizFanPointProcessVariableClassificationMapper.xml
...ter/IdxBizFanPointProcessVariableClassificationMapper.xml
+6
-16
BigScreenAnalyseController.java
...dule/jxiop/biz/controller/BigScreenAnalyseController.java
+10
-7
KafkaAnalyseController.java
...t/module/jxiop/biz/controller/KafkaAnalyseController.java
+3
-0
IdxBizFanHealthIndex.java
...os/boot/module/jxiop/biz/entity/IdxBizFanHealthIndex.java
+3
-0
IdxBizPvHealthIndex.java
...mos/boot/module/jxiop/biz/entity/IdxBizPvHealthIndex.java
+3
-0
FanConditionVariablesMessage.java
.../module/jxiop/biz/kafka/FanConditionVariablesMessage.java
+1
-1
KafkaConsumerService.java
...mos/boot/module/jxiop/biz/kafka/KafkaConsumerService.java
+26
-26
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+16
-9
IdxBizFanHealthIndexMapper.xml
...n/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
+27
-19
IdxBizFanPointProcessVariableClassificationMapper.xml
...ter/IdxBizFanPointProcessVariableClassificationMapper.xml
+3
-15
IdxBizPvPointProcessVariableClassificationMapper.xml
...ster/IdxBizPvPointProcessVariableClassificationMapper.xml
+4
-15
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+2
-2
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+0
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/bin/src/main/resources/mapper/cluster/IdxBizFanPointProcessVariableClassificationMapper.xml
View file @
c52dc06b
...
...
@@ -20,11 +20,10 @@
idx_biz_fan_point_var_central_value ibfpvcv
WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
GROUP BY
b.SEQUENCE_NBR UNION ALL
b.SEQUENCE_NBR
UNION ALL
SELECT
b.*,
ibfpvcv.PROCESS_POINT1_ID AS pointOneId,
...
...
@@ -42,10 +41,7 @@
) AS b,
idx_biz_fan_point_var_central_value ibfpvcv
WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
GROUP BY
b.SEQUENCE_NBR UNION ALL
SELECT
...
...
@@ -65,10 +61,7 @@
) AS b,
idx_biz_fan_point_var_central_value ibfpvcv
WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
GROUP BY
b.SEQUENCE_NBR UNION ALL
SELECT
...
...
@@ -88,10 +81,7 @@
) AS b,
idx_biz_fan_point_var_central_value ibfpvcv
WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
GROUP BY
b.SEQUENCE_NBR
</select>
...
...
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 @
c52dc06b
...
...
@@ -258,14 +258,17 @@ public class BigScreenAnalyseController extends BaseController {
public
ResponseModel
<
Map
<
String
,
Object
>>
getHealthInfoByArea
(
@RequestParam
(
required
=
false
)
String
areaCode
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizFanHealthIndexMapper
.
getHealthInfoByStation
(
areaCode
);
Map
<
String
,
BigDecimal
>
collect
=
healthListInfo
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"station"
).
toString
(),
t
->
new
BigDecimal
(
t
.
get
(
"healthIndex"
).
toString
())));
List
<
StationBasic
>
stationBasics
=
stationBasicMapper
.
selectList
(
new
LambdaQueryWrapper
<
StationBasic
>().
like
(
StationBasic:
:
getAreaName
,
areaCode
));
List
<
String
>
list
=
stationBasics
.
stream
().
map
(
StationBasic:
:
getStationName
).
collect
(
Collectors
.
toList
()
);
//
Map<String, BigDecimal> collect = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("station").toString(), t -> new BigDecimal(t.get("healthIndex").toString())));
// List<StationBasic> stationBasics = stationBasicMapper.selectList(new LambdaQueryWrapper<StationBasic>().like(StationBasic::getAreaName, areaCode));
// List<String> list = stationBasics.stream().map(StationBasic::getStationName).collect(Collectors.toList());
// List<Object> seriesData = new ArrayList<>();
// list.forEach(item -> seriesData.add(collect.getOrDefault(item, new BigDecimal("100"))
));
List
<
String
>
list
=
new
ArrayList
<>(
);
List
<
Object
>
seriesData
=
new
ArrayList
<>();
list
.
forEach
(
item
->
seriesData
.
add
(
collect
.
getOrDefault
(
item
,
new
BigDecimal
(
"100"
))));
healthListInfo
.
forEach
(
item
->
{
list
.
add
(
item
.
get
(
"station"
).
toString
());
seriesData
.
add
(
new
BigDecimal
(
item
.
get
(
"healthIndex"
).
toString
()));
});
resultMap
.
put
(
"axisData"
,
list
);
resultMap
.
put
(
"seriesData"
,
seriesData
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/KafkaAnalyseController.java
View file @
c52dc06b
...
...
@@ -88,6 +88,8 @@ public class KafkaAnalyseController {
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"中心值 - 风电 - 新"
,
notes
=
"中心值 - 风电 - 新"
)
public
ResponseModel
<
Object
>
getFanConditionVariablesZXZ
()
{
if
(
redisUtils
.
hasKey
(
kafkaTopicConsumerZXZFan
))
{
// redisUtils.del(kafkaTopicConsumerZXZFan);
// redisUtils.getExpire(kafkaTopicConsumerZXZFan);
return
ResponseHelper
.
buildResponse
(
"计算中"
);
}
fanConditionVariablesMessage
.
getFanConditionVariablesZXZ
();
...
...
@@ -100,6 +102,7 @@ public class KafkaAnalyseController {
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"中心值 - 光伏 - 新"
,
notes
=
"工况划分 - 光伏 - 新"
)
public
ResponseModel
<
Object
>
getPvConditionVariablesZXZ
()
{
if
(
redisUtils
.
hasKey
(
kafkaTopicConsumerZXZPv
))
{
// redisUtils.del(kafkaTopicConsumerZXZPv);
return
ResponseHelper
.
buildResponse
(
"计算中"
);
}
fanConditionVariablesMessage
.
getPvConditionVariablesZXZ
();
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/entity/IdxBizFanHealthIndex.java
View file @
c52dc06b
...
...
@@ -159,4 +159,7 @@ public class IdxBizFanHealthIndex {
@TableField
(
"POINT_NAME"
)
private
String
pointName
;
@TableField
(
"ANALYSIS_TIME"
)
private
String
ANALYSISTIME
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/entity/IdxBizPvHealthIndex.java
View file @
c52dc06b
...
...
@@ -169,4 +169,7 @@ public class IdxBizPvHealthIndex{
@TableField
(
"POINT_NAME"
)
private
String
pointName
;
@TableField
(
"ANALYSIS_TIME"
)
private
String
ANALYSISTIME
;
}
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 @
c52dc06b
...
...
@@ -85,6 +85,6 @@ public class FanConditionVariablesMessage {
@Async
public
void
getPvConditionVariablesZXZ
()
{
List
<
IdxBizPvPointProcessVariableClassification
>
fenxiList
=
idxBizPvPointProcessVariableClassificationMapper
.
selectList
(
new
QueryWrapper
<
IdxBizPvPointProcessVariableClassification
>().
isNotNull
(
"SEQUENCE_NBR"
).
eq
(
"TAG_CODE"
,
"分析变量"
));
fenxiList
.
forEach
(
item
->
kafkaProducerService
.
sendMessageAsync
(
kafkaTopicConsumerZXZ
Fan
,
JSON
.
toJSONString
(
item
)));
fenxiList
.
forEach
(
item
->
kafkaProducerService
.
sendMessageAsync
(
kafkaTopicConsumerZXZ
Pv
,
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 @
c52dc06b
...
...
@@ -157,11 +157,7 @@ public class KafkaConsumerService {
minRow
=
minRow
>
values
.
size
()
?
values
.
size
()
:
minRow
;
}
values
.
setName
(
"processVariable"
+
index
);
if
(!
dataTable
.
isEmpty
()
&&
dataTable
.
rowCount
()
<
values
.
size
())
{
dataTable
.
addColumns
(
values
.
inRange
(
0
,
dataTable
.
rowCount
()));
}
else
{
dataTable
.
addColumns
(
values
);
}
dataTable
=
getDataTable
(
dataTable
,
values
);
data1
.
put
(
"processVariable"
+
index
+
"Id"
,
processVariable
.
getSequenceNbr
());
...
...
@@ -171,6 +167,7 @@ public class KafkaConsumerService {
IntervalValues
.
add
(
processVariable
.
getIntervalValue2
());
IntervalValues
.
add
(
processVariable
.
getIntervalValue3
());
IntervalValues
.
add
(
processVariable
.
getIntervalValue4
());
IntervalValues
.
add
(
processVariable
.
getIntervalValue5
());
data2
.
put
(
"processVariable"
+
index
,
IntervalValues
);
index
++;
...
...
@@ -178,15 +175,11 @@ public class KafkaConsumerService {
Selection
selection
=
table
.
stringColumn
(
"id"
).
isEqualTo
(
analysisVariable
.
getIndexAddress
()
+
"_"
+
analysisVariable
.
getGatewayId
());
DoubleColumn
values
=
table
.
where
(
selection
).
doubleColumn
(
"value"
);
values
.
setName
(
"analysisVariable"
);
if
(!
dataTable
.
isEmpty
()
&&
dataTable
.
rowCount
()
<
values
.
size
())
{
dataTable
.
addColumns
(
values
.
inRange
(
0
,
dataTable
.
rowCount
()));
}
else
{
dataTable
.
addColumns
(
values
);
}
dataTable
=
getDataTable
(
dataTable
,
values
);
data1
.
put
(
"analysisVariableId"
,
analysisVariable
.
getSequenceNbr
());
// 获取相同长度的数据
dataTable
=
dataTable
.
inRange
(
0
,
minRow
);
//
dataTable = dataTable.inRange(0, minRow);
List
<
String
>
list
=
dataTable
.
columnNames
();
for
(
String
column
:
list
)
{
data1
.
put
(
column
,
dataTable
.
doubleColumn
(
column
).
asDoubleArray
());
...
...
@@ -201,7 +194,7 @@ public class KafkaConsumerService {
idxBizFanPointVarCentralValueMapper
.
delete
(
new
QueryWrapper
<
IdxBizFanPointVarCentralValue
>().
eq
(
"ANALYSIS_POINT_ID"
,
analysisVariableId
));
JSONObject
jsonObject
=
JSON
.
parseObject
(
response
);
int
length
=
jsonObject
.
getJSONArray
(
"stdDev"
).
size
();
int
length
=
jsonObject
.
getJSONArray
(
"stdDev"
).
size
()
>
64
?
64
:
jsonObject
.
getJSONArray
(
"stdDev"
).
size
()
;
List
<
IdxBizFanPointVarCentralValue
>
insertList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
IdxBizFanPointVarCentralValue
idxBizFanPointVarCentralValue
=
new
IdxBizFanPointVarCentralValue
();
...
...
@@ -236,6 +229,19 @@ public class KafkaConsumerService {
}
}
private
Table
getDataTable
(
Table
dataTable
,
DoubleColumn
values
)
{
if
(!
dataTable
.
isEmpty
()
&&
dataTable
.
rowCount
()
<
values
.
size
())
{
dataTable
.
addColumns
(
values
.
inRange
(
0
,
dataTable
.
rowCount
()));
}
else
if
(!
dataTable
.
isEmpty
()
&&
dataTable
.
rowCount
()
>
values
.
size
()){
dataTable
=
dataTable
.
inRange
(
0
,
values
.
size
());
dataTable
.
addColumns
(
values
);
}
else
{
dataTable
.
addColumns
(
values
);
}
return
dataTable
;
}
private
void
execPvCorrelation
(
List
<
ConsumerRecord
<
String
,
String
>>
consumerRecords
,
Table
table
)
{
consumerRecords
.
parallelStream
().
forEach
(
record
->
{
Optional
<?>
kafkaMessage
=
Optional
.
ofNullable
(
record
.
value
());
...
...
@@ -709,7 +715,7 @@ public class KafkaConsumerService {
if
(
kafkaMessage
.
isPresent
())
{
IdxBizPvPointProcessVariableClassification
pvPointProcessVariable
=
JSON
.
parseObject
(
kafkaMessage
.
get
().
toString
(),
IdxBizPvPointProcessVariableClassification
.
class
);
List
<
IdxBiz
FanPointVarCorrelation
>
gongkuangList
=
idxBizFanPointVarCorrelationService
.
list
(
new
QueryWrapper
<
IdxBizFan
PointVarCorrelation
>().
eq
(
"ANALYSIS_GATEWAY_ID"
,
pvPointProcessVariable
.
getGatewayId
()).
eq
(
"ANALYSIS_POINT_ID"
,
pvPointProcessVariable
.
getSequenceNbr
()).
orderByDesc
(
"CORRELATION_COEFFICIENT"
).
last
(
"limit 3"
));
List
<
IdxBiz
PvPointVarCorrelation
>
gongkuangList
=
idxBizPvPointVarCorrelationService
.
list
(
new
QueryWrapper
<
IdxBizPv
PointVarCorrelation
>().
eq
(
"ANALYSIS_GATEWAY_ID"
,
pvPointProcessVariable
.
getGatewayId
()).
eq
(
"ANALYSIS_POINT_ID"
,
pvPointProcessVariable
.
getSequenceNbr
()).
orderByDesc
(
"CORRELATION_COEFFICIENT"
).
last
(
"limit 3"
));
List
<
String
>
processPointIds
=
gongkuangList
.
stream
().
map
(
idxBizFanPointVarCorrelation
->
idxBizFanPointVarCorrelation
.
getProcessPointId
().
toString
()).
collect
(
Collectors
.
toList
());
List
<
IdxBizPvPointProcessVariableClassification
>
idxBizPvPointProcessVariableClassificationList
=
idxBizPvPointProcessVariableClassificationService
.
list
(
new
QueryWrapper
<
IdxBizPvPointProcessVariableClassification
>().
in
(
"SEQUENCE_NBR"
,
processPointIds
));
...
...
@@ -730,7 +736,7 @@ public class KafkaConsumerService {
}
});
buildZXZPvExecData
(
consumerRecords
,
gatewayPoints
,
zxzIds
,
"ZXZ
Fan
Consumer"
);
buildZXZPvExecData
(
consumerRecords
,
gatewayPoints
,
zxzIds
,
"ZXZ
Pv
Consumer"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -788,11 +794,7 @@ public class KafkaConsumerService {
minRow
=
minRow
>
values
.
size
()
?
values
.
size
()
:
minRow
;
}
values
.
setName
(
"processVariable"
+
index
);
if
(!
dataTable
.
isEmpty
()
&&
dataTable
.
rowCount
()
<
values
.
size
())
{
dataTable
.
addColumns
(
values
.
inRange
(
0
,
dataTable
.
rowCount
()));
}
else
{
dataTable
.
addColumns
(
values
);
}
dataTable
=
getDataTable
(
dataTable
,
values
);
data1
.
put
(
"processVariable"
+
index
+
"Id"
,
processVariable
.
getSequenceNbr
());
// 构建工况区间数组
...
...
@@ -801,6 +803,7 @@ public class KafkaConsumerService {
IntervalValues
.
add
(
processVariable
.
getIntervalValue2
());
IntervalValues
.
add
(
processVariable
.
getIntervalValue3
());
IntervalValues
.
add
(
processVariable
.
getIntervalValue4
());
IntervalValues
.
add
(
processVariable
.
getIntervalValue5
());
data2
.
put
(
"processVariable"
+
index
,
IntervalValues
);
index
++;
...
...
@@ -808,15 +811,12 @@ public class KafkaConsumerService {
Selection
selection
=
table
.
stringColumn
(
"id"
).
isEqualTo
(
analysisVariable
.
getIndexAddress
()
+
"_"
+
analysisVariable
.
getGatewayId
());
DoubleColumn
values
=
table
.
where
(
selection
).
doubleColumn
(
"value"
);
values
.
setName
(
"analysisVariable"
);
if
(!
dataTable
.
isEmpty
()
&&
dataTable
.
rowCount
()
<
values
.
size
())
{
dataTable
.
addColumns
(
values
.
inRange
(
0
,
dataTable
.
rowCount
()));
}
else
{
dataTable
.
addColumns
(
values
);
}
dataTable
=
getDataTable
(
dataTable
,
values
);
data1
.
put
(
"analysisVariableId"
,
analysisVariable
.
getSequenceNbr
());
// 获取相同长度的数据
dataTable
=
dataTable
.
inRange
(
0
,
minRow
);
//
dataTable = dataTable.inRange(0, minRow);
List
<
String
>
list
=
dataTable
.
columnNames
();
for
(
String
column
:
list
)
{
data1
.
put
(
column
,
dataTable
.
doubleColumn
(
column
).
asDoubleArray
());
...
...
@@ -831,7 +831,7 @@ public class KafkaConsumerService {
idxBizPvPointVarCentralValueMapper
.
delete
(
new
QueryWrapper
<
IdxBizPvPointVarCentralValue
>().
eq
(
"ANALYSIS_POINT_ID"
,
analysisVariable
.
getSequenceNbr
()));
JSONObject
jsonObject
=
JSON
.
parseObject
(
response
);
int
length
=
jsonObject
.
getJSONArray
(
"stdDev"
).
size
();
int
length
=
jsonObject
.
getJSONArray
(
"stdDev"
).
size
()
>
64
?
64
:
jsonObject
.
getJSONArray
(
"stdDev"
).
size
()
;
List
<
IdxBizPvPointVarCentralValue
>
insertList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
IdxBizPvPointVarCentralValue
idxBizPvPointVarCentralValue
=
new
IdxBizPvPointVarCentralValue
();
...
...
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 @
c52dc06b
...
...
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONArray;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments
;
import
com.yeejoin.amos.boot.module.jxiop.biz.Enum.SmartAnalyseEnum
;
import
com.yeejoin.amos.boot.module.jxiop.biz.Thread.MyServiceThread
;
...
...
@@ -18,6 +19,7 @@ import com.yeejoin.amos.component.influxdb.InfluxdbUtil;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.joda.time.DateTimeUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -32,6 +34,7 @@ import org.springframework.data.elasticsearch.core.query.Query;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.DateTimeUtil
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
...
...
@@ -1454,7 +1457,7 @@ public class CommonServiceImpl {
}
@Scheduled
(
cron
=
"0
0/5
* * * ?"
)
@Scheduled
(
cron
=
"0
/5 *
* * * ?"
)
public
void
healthWarningMinuteByFan
()
{
Date
time
=
new
Date
();
List
<
IdxBizFanPointProcessVariableClassificationDto
>
data
=
idxBizFanPointProcessVariableClassificationMapper
.
getInfluxDBData
();
...
...
@@ -1552,22 +1555,24 @@ public class CommonServiceImpl {
for
(
int
i
=
0
;
i
<
analysisVariableIdArray
.
size
();
i
++)
{
IdxBizFanHealthIndex
idxBizFanHealthIndex
=
new
IdxBizFanHealthIndex
();
BeanUtils
.
copyProperties
(
obj
,
idxBizFanHealthIndex
);
idxBizFanHealthIndex
.
setHealthIndex
(
indexValueArray
.
getDoubleValue
(
i
));
idxBizFanHealthIndex
.
setHealthIndex
(
indexValueArray
.
getDoubleValue
(
i
)
<
0
?
0
:
indexValueArray
.
getDoubleValue
(
i
)
);
idxBizFanHealthIndex
.
setAnalysisObjSeq
(
obj
.
getSequenceNbr
());
idxBizFanHealthIndex
.
setRecDate
(
time
);
idxBizFanHealthIndex
.
setSequenceNbr
(
null
);
idxBizFanHealthIndex
.
setRecDate
(
new
Date
());
idxBizFanHealthIndex
.
setWeigth
(
1.0
);
//获取健康指数对应等级
LambdaQueryWrapper
<
IdxBizFanHealthLevel
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
IdxBizFanHealthLevel:
:
getAnalysisObjType
,
"
设备
"
);
query
.
eq
(
IdxBizFanHealthLevel:
:
getAnalysisObjType
,
"
测点
"
);
query
.
eq
(
IdxBizFanHealthLevel:
:
getStatus
,
obj
.
getStation
());
query
.
le
(
IdxBizFanHealthLevel:
:
getGroupLowerLimit
,
indexValueArray
.
getDoubleValue
(
i
));
query
.
ge
(
IdxBizFanHealthLevel:
:
getGroupUpperLimit
,
indexValueArray
.
getDoubleValue
(
i
));
query
.
le
(
IdxBizFanHealthLevel:
:
getGroupLowerLimit
,
indexValueArray
.
getDoubleValue
(
i
)
<
0
?
0
:
indexValueArray
.
getDoubleValue
(
i
)
);
query
.
ge
(
IdxBizFanHealthLevel:
:
getGroupUpperLimit
,
indexValueArray
.
getDoubleValue
(
i
)
<
0
?
0
:
indexValueArray
.
getDoubleValue
(
i
)
);
IdxBizFanHealthLevel
idxBizFanHealthLevel
=
idxBizFanHealthLevelMapper
.
selectOne
(
query
);
idxBizFanHealthIndex
.
setHealthLevel
(
idxBizFanHealthLevel
.
getHealthLevel
());
idxBizFanHealthIndex
.
setAnalysisType
(
"按时刻"
);
idxBizFanHealthIndex
.
setAnalysisObjType
(
"测点"
);
idxBizFanHealthIndex
.
setANOMALY
(
scoreValueArray
.
getDoubleValue
(
i
));
idxBizFanHealthIndex
.
setANALYSISTIME
(
DateUtils
.
getDateNowString
());
idxBizFanHealthIndexs
.
add
(
idxBizFanHealthIndex
);
}
}
...
...
@@ -1674,20 +1679,22 @@ public class CommonServiceImpl {
for
(
int
i
=
0
;
i
<
analysisVariableIdArray
.
size
();
i
++)
{
IdxBizPvHealthIndex
idxBizPvHealthIndex
=
new
IdxBizPvHealthIndex
();
BeanUtils
.
copyProperties
(
obj
,
idxBizPvHealthIndex
);
idxBizPvHealthIndex
.
setHealthIndex
(
indexValueArray
.
getDoubleValue
(
i
));
idxBizPvHealthIndex
.
setHealthIndex
(
indexValueArray
.
getDoubleValue
(
i
)
<
0
?
0
:
indexValueArray
.
getDoubleValue
(
i
)
);
idxBizPvHealthIndex
.
setAnalysisObjSeq
(
obj
.
getSequenceNbr
());
idxBizPvHealthIndex
.
setRecDate
(
time
);
idxBizPvHealthIndex
.
setWeigth
(
1.0
);
//获取健康指数对应等级
LambdaQueryWrapper
<
IdxBizPvHealthLevel
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
IdxBizPvHealthLevel:
:
getAnalysisObjType
,
"
设备
"
);
query
.
eq
(
IdxBizPvHealthLevel:
:
getAnalysisObjType
,
"
测点
"
);
query
.
eq
(
IdxBizPvHealthLevel:
:
getStatus
,
obj
.
getStation
());
query
.
le
(
IdxBizPvHealthLevel:
:
getGroupLowerLimit
,
indexValueArray
.
getDoubleValue
(
i
));
query
.
ge
(
IdxBizPvHealthLevel:
:
getGroupUpperLimit
,
indexValueArray
.
getDoubleValue
(
i
));
query
.
le
(
IdxBizPvHealthLevel:
:
getGroupLowerLimit
,
indexValueArray
.
getDoubleValue
(
i
)
<
0
?
0
:
indexValueArray
.
getDoubleValue
(
i
)
);
query
.
ge
(
IdxBizPvHealthLevel:
:
getGroupUpperLimit
,
indexValueArray
.
getDoubleValue
(
i
)
<
0
?
0
:
indexValueArray
.
getDoubleValue
(
i
)
);
IdxBizPvHealthLevel
idxBizFanHealthLevel
=
idxBizPvHealthLevelMapper
.
selectOne
(
query
);
idxBizPvHealthIndex
.
setHealthLevel
(
idxBizFanHealthLevel
.
getHealthLevel
());
idxBizPvHealthIndex
.
setAnalysisType
(
"按时刻"
);
idxBizPvHealthIndex
.
setAnalysisObjType
(
"测点"
);
idxBizPvHealthIndex
.
setANOMALY
(
scoreValueArray
.
getDoubleValue
(
i
));
idxBizPvHealthIndex
.
setANALYSISTIME
(
DateUtils
.
getDateNowString
());
idxBizPvHealthIndexs
.
add
(
idxBizPvHealthIndex
);
}
}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
View file @
c52dc06b
...
...
@@ -11,18 +11,22 @@
IFNULL( AVG( HEALTH_INDEX ), 100 ) AS avgHealthIndex
FROM
idx_biz_fan_health_index
<where>
ANALYSIS_TYPE = '按天'
AN
D
DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
<if
test=
"areaCode != null and areaCode != ''"
>
<where>
AN
ALYSIS_TYPE = '按天'
AND
DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE like concat('%', #{areaCode}, '%')
AND ANALYSIS_OBJ_TYPE = '片区'
</if>
<if
test=
"stationCode != null and stationCode != ''"
>
AND STATION = #{stationCode}
AND ANALYSIS_OBJ_TYPE = '场站'
</if>
<if
test=
"stationCode == null or stationCode == ''"
>
AND ( STATION IS NULL OR STATION = '' )
</if>
<if
test=
"(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')"
>
AND ANALYSIS_OBJ_TYPE = '片区'
</if>
</where>
UNION ALL
(
...
...
@@ -35,12 +39,14 @@
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE like concat('%', #{areaCode}, '%')
AND ANALYSIS_OBJ_TYPE = '片区'
</if>
<if
test=
"stationCode != null and stationCode != ''"
>
AND STATION = #{stationCode}
AND ANALYSIS_OBJ_TYPE = '场站'
</if>
<if
test=
"
stationCode == null or stationCode == ''
"
>
AND
( STATION IS NULL OR STATION = '' )
<if
test=
"
(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')
"
>
AND
ANALYSIS_OBJ_TYPE = '片区'
</if>
</where>
)
...
...
@@ -72,12 +78,14 @@
ANALYSIS_TYPE = '按天'
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE like concat('%', #{areaCode}, '%')
AND ANALYSIS_OBJ_TYPE = '片区'
</if>
<if
test=
"stationCode != null and stationCode != ''"
>
AND STATION = #{stationCode}
AND ANALYSIS_OBJ_TYPE = '场站'
</if>
<if
test=
"
stationCode == null or stationCode == ''
"
>
AND
( STATION IS NULL OR STATION = '' )
<if
test=
"
(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')
"
>
AND
ANALYSIS_OBJ_TYPE = '片区'
</if>
</where>
UNION ALL
...
...
@@ -91,12 +99,14 @@
ANALYSIS_TYPE = '按天'
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE like concat('%', #{areaCode}, '%')
AND ANALYSIS_OBJ_TYPE = '片区'
</if>
<if
test=
"stationCode != null and stationCode != ''"
>
AND STATION = #{stationCode}
AND ANALYSIS_OBJ_TYPE = '场站'
</if>
<if
test=
"
stationCode == null or stationCode == ''
"
>
AND
( STATION IS NULL OR STATION = '' )
<if
test=
"
(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')
"
>
AND
ANALYSIS_OBJ_TYPE = '片区'
</if>
</where>
)
...
...
@@ -128,7 +138,7 @@
FROM
idx_biz_fan_health_index
WHERE
( STATION IS NULL OR STATION = '' )
ANALYSIS_OBJ_TYPE = '片区'
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
GROUP BY
...
...
@@ -140,7 +150,7 @@
FROM
idx_biz_pv_health_index
WHERE
( STATION IS NULL OR STATION = '' )
ANALYSIS_OBJ_TYPE = '片区'
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
GROUP BY
...
...
@@ -185,8 +195,7 @@
FROM
idx_biz_fan_health_index
<where>
STATION IS NOT NULL
AND STATION != ''
ANALYSIS_OBJ_TYPE = '场站'
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
<if
test=
"areaCode != null and areaCode != ''"
>
...
...
@@ -202,8 +211,7 @@
FROM
idx_biz_pv_health_index
<where>
STATION IS NOT NULL
AND STATION != ''
ANALYSIS_OBJ_TYPE = '场站'
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
<if
test=
"areaCode != null and areaCode != ''"
>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizFanPointProcessVariableClassificationMapper.xml
View file @
c52dc06b
...
...
@@ -20,9 +20,6 @@
idx_biz_fan_point_var_central_value ibfpvcv
WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
GROUP BY
b.SEQUENCE_NBR UNION ALL
SELECT
...
...
@@ -42,10 +39,7 @@
) AS b,
idx_biz_fan_point_var_central_value ibfpvcv
WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
GROUP BY
b.SEQUENCE_NBR UNION ALL
SELECT
...
...
@@ -65,10 +59,7 @@
) AS b,
idx_biz_fan_point_var_central_value ibfpvcv
WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
GROUP BY
b.SEQUENCE_NBR UNION ALL
SELECT
...
...
@@ -88,10 +79,7 @@
) AS b,
idx_biz_fan_point_var_central_value ibfpvcv
WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
GROUP BY
b.SEQUENCE_NBR
</select>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizPvPointProcessVariableClassificationMapper.xml
View file @
c52dc06b
...
...
@@ -24,9 +24,6 @@
idx_biz_pv_point_var_central_value ibfpvcv
WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
GROUP BY
b.SEQUENCE_NBR UNION ALL
SELECT
...
...
@@ -46,10 +43,7 @@
) AS b,
idx_biz_pv_point_var_central_value ibfpvcv
WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
GROUP BY
b.SEQUENCE_NBR UNION ALL
SELECT
...
...
@@ -69,10 +63,8 @@
) AS b,
idx_biz_pv_point_var_central_value ibfpvcv
WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
GROUP BY
b.SEQUENCE_NBR UNION ALL
SELECT
...
...
@@ -92,10 +84,7 @@
) AS b,
idx_biz_pv_point_var_central_value ibfpvcv
WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
GROUP BY
b.SEQUENCE_NBR
</select>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/MonitorFanIdxController.java
View file @
c52dc06b
...
...
@@ -491,9 +491,9 @@ public class MonitorFanIdxController extends BaseController {
public
ResponseModel
getMajorAnalogQuantityByPage
(
@RequestParam
(
required
=
false
)
String
stationId
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
String
gatewayId
=
stationBasic
.
getBoosterGatewayId
();
if
(
"夏造风电站"
.
equals
(
stationBasic
.
getStationName
()
))
{
if
(
stationBasic
.
getStationName
().
contains
(
"夏造"
))
{
monitorFanIndicator
.
getMajorAnalogQuantityByPage
(
gatewayId
,
stationBasic
.
getSequenceNbr
().
toString
());
}
else
if
(
"泰和前进光伏站"
.
equals
(
stationBasic
.
getStationName
()
))
{
}
else
if
(
stationBasic
.
getStationName
().
contains
(
"泰和"
))
{
monitorFanIndicator
.
getMajorAnalogQuantityByPageByTHGF
(
gatewayId
,
stationBasic
.
getSequenceNbr
().
toString
());
}
return
CommonResponseUtil
.
success
();
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
View file @
c52dc06b
This diff is collapsed.
Click to expand it.
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