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
91e7cab3
Commit
91e7cab3
authored
Oct 18, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修改
parent
883405a2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
188 additions
and
132 deletions
+188
-132
WarningRecordStatusMessage.java
...oot/module/jxiop/biz/emqx/WarningRecordStatusMessage.java
+48
-26
WarningRecordStatusMessage2.java
...ot/module/jxiop/biz/emqx/WarningRecordStatusMessage2.java
+98
-98
IdxBizFanHealthIndex.java
...os/boot/module/jxiop/biz/entity/IdxBizFanHealthIndex.java
+5
-0
IdxBizFanWarningRecord.java
.../boot/module/jxiop/biz/entity/IdxBizFanWarningRecord.java
+6
-0
IdxBizPvHealthIndex.java
...mos/boot/module/jxiop/biz/entity/IdxBizPvHealthIndex.java
+6
-0
IdxBizPvWarningRecord.java
...s/boot/module/jxiop/biz/entity/IdxBizPvWarningRecord.java
+6
-0
HealthStatusIndicatorServiceImpl.java
...op/biz/service/impl/HealthStatusIndicatorServiceImpl.java
+19
-8
No files found.
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 @
91e7cab3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
emqx
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
emqx
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.HealthStatusIndicatorServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRecordServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRecordServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvWarningRecordServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvWarningRecordServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -16,9 +18,10 @@ import org.typroject.tyboot.component.emq.EmqKeeper;
...
@@ -16,9 +18,10 @@ import org.typroject.tyboot.component.emq.EmqKeeper;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
java.util.
Date
;
import
java.util.
*
;
import
java.util.concurrent.BlockingQueue
;
import
java.util.concurrent.BlockingQueue
;
import
java.util.concurrent.LinkedBlockingQueue
;
import
java.util.concurrent.LinkedBlockingQueue
;
import
java.util.stream.Collectors
;
@Component
@Component
@Slf4j
@Slf4j
...
@@ -26,11 +29,15 @@ public class WarningRecordStatusMessage extends EmqxListener {
...
@@ -26,11 +29,15 @@ public class WarningRecordStatusMessage extends EmqxListener {
@Autowired
@Autowired
protected
EmqKeeper
emqKeeper
;
protected
EmqKeeper
emqKeeper
;
/**
* 预警状态修改消息 - 标准化
*/
public
static
final
String
WARNING_CHANGE_MESSAGE
=
"+/warning/change"
;
// 江西电建接收红黄绿码主题
private
static
final
String
QUESTION_STATUS_CHANGE
=
"question/status/change"
;
private
static
final
BlockingQueue
<
JSONObject
>
blockingQueue
=
new
LinkedBlockingQueue
<
JSONObject
>();
private
static
final
BlockingQueue
<
JSONArray
>
blockingQueueFan
=
new
LinkedBlockingQueue
<
JSONArray
>();
private
static
final
BlockingQueue
<
JSONArray
>
blockingQueuePv
=
new
LinkedBlockingQueue
<
JSONArray
>();
@Autowired
@Autowired
private
IdxBizFanWarningRecordServiceImpl
idxBizFanWarningRecordService
;
private
IdxBizFanWarningRecordServiceImpl
idxBizFanWarningRecordService
;
...
@@ -41,14 +48,21 @@ public class WarningRecordStatusMessage extends EmqxListener {
...
@@ -41,14 +48,21 @@ public class WarningRecordStatusMessage extends EmqxListener {
@PostConstruct
@PostConstruct
void
init
()
throws
Exception
{
void
init
()
throws
Exception
{
new
Thread
(
taskRunnable
).
start
();
new
Thread
(
taskRunnable
).
start
();
emqKeeper
.
subscript
(
QUESTION_STATUS_CHAN
GE
,
2
,
this
);
emqKeeper
.
subscript
(
WARNING_CHANGE_MESSA
GE
,
2
,
this
);
}
}
@Override
@Override
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
throws
Exception
{
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
throws
Exception
{
log
.
info
(
"人员赋码消息{}"
,
new
String
(
message
.
getPayload
()));
if
(
topic
.
contains
(
HealthStatusIndicatorServiceImpl
.
SMART_ANALYSE_PV
))
{
JSONObject
ja
=
JSON
.
parseObject
(
new
String
(
message
.
getPayload
()));
log
.
info
(
"预警状态改变消息-光伏{}"
,
new
String
(
message
.
getPayload
()));
blockingQueue
.
add
(
ja
);
JSONArray
ja
=
JSON
.
parseArray
(
new
String
(
message
.
getPayload
()));
blockingQueuePv
.
add
(
ja
);
}
else
if
(
topic
.
contains
(
HealthStatusIndicatorServiceImpl
.
SMART_ANALYSE_FAN
))
{
log
.
info
(
"预警状态改变消息-风电{}"
,
new
String
(
message
.
getPayload
()));
JSONArray
ja
=
JSON
.
parseArray
(
new
String
(
message
.
getPayload
()));
blockingQueueFan
.
add
(
ja
);
}
}
}
Runnable
taskRunnable
=
new
Runnable
()
{
Runnable
taskRunnable
=
new
Runnable
()
{
...
@@ -60,8 +74,10 @@ public class WarningRecordStatusMessage extends EmqxListener {
...
@@ -60,8 +74,10 @@ public class WarningRecordStatusMessage extends EmqxListener {
k
++;
k
++;
isRun
=
k
<
Integer
.
MAX_VALUE
;
isRun
=
k
<
Integer
.
MAX_VALUE
;
try
{
try
{
JSONObject
analysisResult
=
blockingQueue
.
take
();
JSONArray
analysisResultFan
=
blockingQueueFan
.
take
();
jxIopUpdate
(
analysisResult
);
jxIopUpdateFan
(
analysisResultFan
);
JSONArray
analysisResultPv
=
blockingQueuePv
.
take
();
jxIopUpdatePv
(
analysisResultPv
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -69,22 +85,28 @@ public class WarningRecordStatusMessage extends EmqxListener {
...
@@ -69,22 +85,28 @@ public class WarningRecordStatusMessage extends EmqxListener {
}
}
};
};
public
void
jxIopUpdate
(
JSONObject
analysisResult
)
{
public
void
jxIopUpdate
Fan
(
JSONArray
analysisResult
)
{
log
.
info
(
"修改预警状态信息:{}"
,
analysisResult
);
log
.
info
(
"修改预警状态信息:{}"
,
analysisResult
);
if
(
ObjectUtils
.
isNotEmpty
(
analysisResult
)
&&
analysisResult
.
get
(
"warningObjectType"
).
toString
().
equals
(
"fan"
))
{
List
<
JSONObject
>
taskList
=
JSONObject
.
parseArray
(
analysisResult
.
toJSONString
(),
JSONObject
.
class
);
LambdaUpdateWrapper
<
IdxBizFanWarningRecord
>
lambda
=
new
LambdaUpdateWrapper
<>();
List
<
String
>
traceIds
=
taskList
.
stream
().
map
(
t
->
t
.
get
(
"traceId"
).
toString
()).
collect
(
Collectors
.
toList
());
lambda
.
set
(
IdxBizFanWarningRecord:
:
getDisposotionState
,
"已处置"
);
LambdaUpdateWrapper
<
IdxBizFanWarningRecord
>
lambda
=
new
LambdaUpdateWrapper
<>();
lambda
.
set
(
IdxBizFanWarningRecord:
:
getStatus
,
"1"
);
lambda
.
set
(
IdxBizFanWarningRecord:
:
getDisposotionState
,
"已处置"
);
lambda
.
set
(
IdxBizFanWarningRecord:
:
getDisposotionDate
,
new
Date
());
lambda
.
set
(
IdxBizFanWarningRecord:
:
getStatus
,
"1"
);
lambda
.
eq
(
IdxBizFanWarningRecord:
:
getSequenceNbr
,
analysisResult
.
get
(
"objectId"
));
lambda
.
set
(
IdxBizFanWarningRecord:
:
getDisposotionDate
,
new
Date
());
idxBizFanWarningRecordService
.
update
(
lambda
);
lambda
.
in
(
IdxBizFanWarningRecord:
:
getSequenceNbr
,
traceIds
);
}
else
if
(
ObjectUtils
.
isNotEmpty
(
analysisResult
)
&&
analysisResult
.
get
(
"warningObjectType"
).
toString
().
equals
(
"pv"
))
{
idxBizFanWarningRecordService
.
update
(
lambda
);
LambdaUpdateWrapper
<
IdxBizPvWarningRecord
>
lambda
=
new
LambdaUpdateWrapper
<>();
lambda
.
set
(
IdxBizPvWarningRecord:
:
getDisposotionState
,
"已处置"
);
}
lambda
.
set
(
IdxBizPvWarningRecord:
:
getStatus
,
"1"
);
lambda
.
set
(
IdxBizPvWarningRecord:
:
getDisposotionDate
,
new
Date
());
public
void
jxIopUpdatePv
(
JSONArray
analysisResult
)
{
lambda
.
eq
(
IdxBizPvWarningRecord:
:
getSequenceNbr
,
analysisResult
.
get
(
"objectId"
));
log
.
info
(
"修改预警状态信息:{}"
,
analysisResult
);
idxBizPvWarningRecordService
.
update
(
lambda
);
List
<
JSONObject
>
taskList
=
JSONObject
.
parseArray
(
analysisResult
.
toJSONString
(),
JSONObject
.
class
);
}
List
<
String
>
traceIds
=
taskList
.
stream
().
map
(
t
->
t
.
get
(
"traceId"
).
toString
()).
collect
(
Collectors
.
toList
());
LambdaUpdateWrapper
<
IdxBizPvWarningRecord
>
lambda
=
new
LambdaUpdateWrapper
<>();
lambda
.
set
(
IdxBizPvWarningRecord:
:
getDisposotionState
,
"已处置"
);
lambda
.
set
(
IdxBizPvWarningRecord:
:
getStatus
,
"1"
);
lambda
.
set
(
IdxBizPvWarningRecord:
:
getDisposotionDate
,
new
Date
());
lambda
.
in
(
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/emqx/WarningRecordStatusMessage2.java
View file @
91e7cab3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
emqx
;
//
package com.yeejoin.amos.boot.module.jxiop.biz.emqx;
//
import
com.alibaba.fastjson.JSON
;
//
import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONObject
;
//
import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
//
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
//
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord
;
//
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWarningRecord
;
//
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWarningRecord;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRecordServiceImpl
;
//
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRecordServiceImpl;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvWarningRecordServiceImpl
;
//
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvWarningRecordServiceImpl;
import
lombok.extern.slf4j.Slf4j
;
//
import lombok.extern.slf4j.Slf4j;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
//
import org.eclipse.paho.client.mqttv3.MqttMessage;
import
org.springframework.beans.factory.annotation.Autowired
;
//
import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Component
;
//
import org.springframework.stereotype.Component;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
//
import org.typroject.tyboot.component.emq.EmqKeeper;
import
org.typroject.tyboot.component.emq.EmqxListener
;
//
import org.typroject.tyboot.component.emq.EmqxListener;
//
import
javax.annotation.PostConstruct
;
//
import javax.annotation.PostConstruct;
import
java.util.Date
;
//
import java.util.Date;
import
java.util.List
;
//
import java.util.List;
import
java.util.concurrent.BlockingQueue
;
//
import java.util.concurrent.BlockingQueue;
import
java.util.concurrent.LinkedBlockingQueue
;
//
import java.util.concurrent.LinkedBlockingQueue;
//
/**
/
//
**
* 处理无需处置情况
//
* 处理无需处置情况
*/
//
*/
@Component
//
@Component
@Slf4j
//
@Slf4j
public
class
WarningRecordStatusMessage2
extends
EmqxListener
{
//
public class WarningRecordStatusMessage2 extends EmqxListener {
//
@Autowired
//
@Autowired
protected
EmqKeeper
emqKeeper
;
//
protected EmqKeeper emqKeeper;
//
/**
//
/**
* 无需处置
//
* 无需处置
*/
//
*/
public
static
final
String
NOT_DISPOSE_AMOS
=
"not/dispose/amos"
;
//
public static final String NOT_DISPOSE_AMOS = "not/dispose/amos";
//
private
static
final
BlockingQueue
<
JSONObject
>
blockingQueue
=
new
LinkedBlockingQueue
<
JSONObject
>();
//
private static final BlockingQueue<JSONObject> blockingQueue = new LinkedBlockingQueue<JSONObject>();
//
@Autowired
//
@Autowired
private
IdxBizFanWarningRecordServiceImpl
idxBizFanWarningRecordService
;
//
private IdxBizFanWarningRecordServiceImpl idxBizFanWarningRecordService;
//
@Autowired
//
@Autowired
private
IdxBizPvWarningRecordServiceImpl
idxBizPvWarningRecordService
;
//
private IdxBizPvWarningRecordServiceImpl idxBizPvWarningRecordService;
//
@PostConstruct
//
@PostConstruct
void
init
()
throws
Exception
{
//
void init() throws Exception {
new
Thread
(
taskRunnable
).
start
();
//
new Thread(taskRunnable).start();
emqKeeper
.
subscript
(
NOT_DISPOSE_AMOS
,
2
,
this
);
//
emqKeeper.subscript(NOT_DISPOSE_AMOS, 2, this);
}
//
}
//
@Override
//
@Override
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
throws
Exception
{
//
public void processMessage(String topic, MqttMessage message) throws Exception {
log
.
info
(
"修改预警状态消息{}"
,
new
String
(
message
.
getPayload
()));
//
log.info("修改预警状态消息{}", new String(message.getPayload()));
JSONObject
ja
=
JSON
.
parseObject
(
new
String
(
message
.
getPayload
()));
//
JSONObject ja = JSON.parseObject(new String(message.getPayload()));
blockingQueue
.
add
(
ja
);
//
blockingQueue.add(ja);
}
//
}
//
Runnable
taskRunnable
=
new
Runnable
()
{
//
Runnable taskRunnable = new Runnable() {
@Override
//
@Override
public
void
run
()
{
//
public void run() {
boolean
isRun
=
true
;
//
boolean isRun = true;
int
k
=
0
;
//
int k = 0;
while
(
isRun
)
{
//
while (isRun) {
k
++;
//
k++;
isRun
=
k
<
Integer
.
MAX_VALUE
;
//
isRun = k < Integer.MAX_VALUE;
try
{
//
try {
JSONObject
analysisResult
=
blockingQueue
.
take
();
//
JSONObject analysisResult = blockingQueue.take();
jxIopUpdate
(
analysisResult
);
//
jxIopUpdate(analysisResult);
}
catch
(
Exception
e
)
{
//
} catch (Exception e) {
e
.
printStackTrace
();
//
e.printStackTrace();
}
//
}
}
//
}
}
//
}
};
//
};
//
public
void
jxIopUpdate
(
JSONObject
analysisResult
)
{
//
public void jxIopUpdate(JSONObject analysisResult) {
log
.
info
(
"修改预警状态信息:{}"
,
analysisResult
);
//
log.info("修改预警状态信息:{}", analysisResult);
if
(
ObjectUtils
.
isNotEmpty
(
analysisResult
)
&&
analysisResult
.
get
(
"warningObjectType"
).
toString
().
equals
(
"fan"
))
{
//
if (ObjectUtils.isNotEmpty(analysisResult) && analysisResult.get("warningObjectType").toString().equals("fan")) {
LambdaUpdateWrapper
<
IdxBizFanWarningRecord
>
lambda
=
new
LambdaUpdateWrapper
<>();
//
LambdaUpdateWrapper<IdxBizFanWarningRecord> lambda = new LambdaUpdateWrapper<>();
lambda
.
set
(
IdxBizFanWarningRecord:
:
getDisposotionState
,
"已处置"
);
//
lambda.set(IdxBizFanWarningRecord::getDisposotionState, "已处置");
lambda
.
set
(
IdxBizFanWarningRecord:
:
getStatus
,
"1"
);
//
lambda.set(IdxBizFanWarningRecord::getStatus, "1");
lambda
.
set
(
IdxBizFanWarningRecord:
:
getDisposotionDate
,
new
Date
());
//
lambda.set(IdxBizFanWarningRecord::getDisposotionDate, new Date());
List
<
String
>
traceIds
=
(
List
<
String
>)
analysisResult
.
get
(
"traceIds"
);
//
List<String> traceIds = (List<String>) analysisResult.get("traceIds");
lambda
.
in
(
IdxBizFanWarningRecord:
:
getSequenceNbr
,
traceIds
);
//
lambda.in(IdxBizFanWarningRecord::getSequenceNbr, traceIds);
idxBizFanWarningRecordService
.
update
(
lambda
);
//
idxBizFanWarningRecordService.update(lambda);
}
else
if
(
ObjectUtils
.
isNotEmpty
(
analysisResult
)
&&
analysisResult
.
get
(
"warningObjectType"
).
toString
().
equals
(
"pv"
))
{
//
} else if (ObjectUtils.isNotEmpty(analysisResult) && analysisResult.get("warningObjectType").toString().equals("pv")) {
LambdaUpdateWrapper
<
IdxBizPvWarningRecord
>
lambda
=
new
LambdaUpdateWrapper
<>();
//
LambdaUpdateWrapper<IdxBizPvWarningRecord> lambda = new LambdaUpdateWrapper<>();
lambda
.
set
(
IdxBizPvWarningRecord:
:
getDisposotionState
,
"已处置"
);
//
lambda.set(IdxBizPvWarningRecord::getDisposotionState, "已处置");
lambda
.
set
(
IdxBizPvWarningRecord:
:
getStatus
,
"1"
);
//
lambda.set(IdxBizPvWarningRecord::getStatus, "1");
lambda
.
set
(
IdxBizPvWarningRecord:
:
getDisposotionDate
,
new
Date
());
//
lambda.set(IdxBizPvWarningRecord::getDisposotionDate, new Date());
List
<
String
>
traceIds
=
(
List
<
String
>)
analysisResult
.
get
(
"traceIds"
);
//
List<String> traceIds = (List<String>) analysisResult.get("traceIds");
lambda
.
in
(
IdxBizPvWarningRecord:
:
getSequenceNbr
,
traceIds
);
//
lambda.in(IdxBizPvWarningRecord::getSequenceNbr, traceIds);
idxBizPvWarningRecordService
.
update
(
lambda
);
//
idxBizPvWarningRecordService.update(lambda);
}
//
}
}
//
}
}
//
}
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 @
91e7cab3
...
@@ -162,4 +162,9 @@ public class IdxBizFanHealthIndex {
...
@@ -162,4 +162,9 @@ public class IdxBizFanHealthIndex {
@TableField
(
"ANALYSIS_TIME"
)
@TableField
(
"ANALYSIS_TIME"
)
private
String
ANALYSISTIME
;
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/IdxBizFanWarningRecord.java
View file @
91e7cab3
...
@@ -145,4 +145,10 @@ public class IdxBizFanWarningRecord{
...
@@ -145,4 +145,10 @@ public class IdxBizFanWarningRecord{
@TableField
(
"DISPOSOTION_DATE"
)
@TableField
(
"DISPOSOTION_DATE"
)
private
Date
disposotionDate
;
private
Date
disposotionDate
;
/**
* 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/IdxBizPvHealthIndex.java
View file @
91e7cab3
...
@@ -172,4 +172,10 @@ public class IdxBizPvHealthIndex{
...
@@ -172,4 +172,10 @@ public class IdxBizPvHealthIndex{
@TableField
(
"ANALYSIS_TIME"
)
@TableField
(
"ANALYSIS_TIME"
)
private
String
ANALYSISTIME
;
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/IdxBizPvWarningRecord.java
View file @
91e7cab3
...
@@ -146,4 +146,10 @@ public class IdxBizPvWarningRecord{
...
@@ -146,4 +146,10 @@ public class IdxBizPvWarningRecord{
@TableField
(
"DISPOSOTION_DATE"
)
@TableField
(
"DISPOSOTION_DATE"
)
private
Date
disposotionDate
;
private
Date
disposotionDate
;
/**
* 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/service/impl/HealthStatusIndicatorServiceImpl.java
View file @
91e7cab3
...
@@ -95,9 +95,14 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -95,9 +95,14 @@ public class HealthStatusIndicatorServiceImpl {
public
static
final
String
INDEX_KEY_PV
=
"THFX#FXGF#ZNFX"
;
public
static
final
String
INDEX_KEY_PV
=
"THFX#FXGF#ZNFX"
;
/**
/**
* 智能分析触发预警系统标识
* 智能分析触发预警系统标识
- 光伏
*/
*/
public
static
final
String
SMART_ANALYSE
=
"smartAnalyse"
;
public
static
final
String
SMART_ANALYSE_PV
=
"smartAnalysePv"
;
/**
* 智能分析触发预警系统标识 - 风电
*/
public
static
final
String
SMART_ANALYSE_FAN
=
"smartAnalyseFan"
;
/***
/***
...
@@ -210,6 +215,7 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -210,6 +215,7 @@ public class HealthStatusIndicatorServiceImpl {
if
(!
level
.
equals
(
""
)
&&
flag
==
0
){
if
(!
level
.
equals
(
""
)
&&
flag
==
0
){
IdxBizPvWarningRecord
idxBizPvWarningRecord
=
new
IdxBizPvWarningRecord
();
IdxBizPvWarningRecord
idxBizPvWarningRecord
=
new
IdxBizPvWarningRecord
();
idxBizPvWarningRecord
.
setKks
(
idxBizPvHealthIndices
.
get
(
0
).
getKks
());
idxBizPvWarningRecord
.
setRecord
(
idxBizPvHealthIndices
.
get
(
0
).
getRecord
());
idxBizPvWarningRecord
.
setRecord
(
idxBizPvHealthIndices
.
get
(
0
).
getRecord
());
idxBizPvWarningRecord
.
setArae
(
idxBizPvHealthIndices
.
get
(
0
).
getArae
());
idxBizPvWarningRecord
.
setArae
(
idxBizPvHealthIndices
.
get
(
0
).
getArae
());
idxBizPvWarningRecord
.
setStation
(
idxBizPvHealthIndices
.
get
(
0
).
getStation
());
idxBizPvWarningRecord
.
setStation
(
idxBizPvHealthIndices
.
get
(
0
).
getStation
());
...
@@ -353,6 +359,7 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -353,6 +359,7 @@ public class HealthStatusIndicatorServiceImpl {
if
(!
level
.
equals
(
""
)
&&
flag
==
0
){
if
(!
level
.
equals
(
""
)
&&
flag
==
0
){
IdxBizPvWarningRecord
idxBizPvWarningRecord
=
new
IdxBizPvWarningRecord
();
IdxBizPvWarningRecord
idxBizPvWarningRecord
=
new
IdxBizPvWarningRecord
();
idxBizPvWarningRecord
.
setKks
(
idxBizPvHealthIndices
.
get
(
0
).
getKks
());
idxBizPvWarningRecord
.
setRecord
(
idxBizPvHealthIndices
.
get
(
0
).
getRecord
());
idxBizPvWarningRecord
.
setRecord
(
idxBizPvHealthIndices
.
get
(
0
).
getRecord
());
idxBizPvWarningRecord
.
setArae
(
idxBizPvHealthIndices
.
get
(
0
).
getArae
());
idxBizPvWarningRecord
.
setArae
(
idxBizPvHealthIndices
.
get
(
0
).
getArae
());
idxBizPvWarningRecord
.
setStation
(
idxBizPvHealthIndices
.
get
(
0
).
getStation
());
idxBizPvWarningRecord
.
setStation
(
idxBizPvHealthIndices
.
get
(
0
).
getStation
());
...
@@ -490,6 +497,7 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -490,6 +497,7 @@ public class HealthStatusIndicatorServiceImpl {
if
(!
level
.
equals
(
""
)
&&
flag
==
0
){
if
(!
level
.
equals
(
""
)
&&
flag
==
0
){
IdxBizPvWarningRecord
idxBizPvWarningRecord
=
new
IdxBizPvWarningRecord
();
IdxBizPvWarningRecord
idxBizPvWarningRecord
=
new
IdxBizPvWarningRecord
();
idxBizPvWarningRecord
.
setKks
(
idxBizPvHealthIndices
.
get
(
0
).
getKks
());
idxBizPvWarningRecord
.
setRecord
(
idxBizPvHealthIndices
.
get
(
0
).
getRecord
());
idxBizPvWarningRecord
.
setRecord
(
idxBizPvHealthIndices
.
get
(
0
).
getRecord
());
idxBizPvWarningRecord
.
setArae
(
idxBizPvHealthIndices
.
get
(
0
).
getArae
());
idxBizPvWarningRecord
.
setArae
(
idxBizPvHealthIndices
.
get
(
0
).
getArae
());
idxBizPvWarningRecord
.
setStation
(
idxBizPvHealthIndices
.
get
(
0
).
getStation
());
idxBizPvWarningRecord
.
setStation
(
idxBizPvHealthIndices
.
get
(
0
).
getStation
());
...
@@ -629,6 +637,7 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -629,6 +637,7 @@ public class HealthStatusIndicatorServiceImpl {
if
(!
level
.
equals
(
""
)
&&
flag
==
0
){
if
(!
level
.
equals
(
""
)
&&
flag
==
0
){
IdxBizFanWarningRecord
idxBizFanWarningRecord
=
new
IdxBizFanWarningRecord
();
IdxBizFanWarningRecord
idxBizFanWarningRecord
=
new
IdxBizFanWarningRecord
();
idxBizFanWarningRecord
.
setKks
(
idxBizFanHealthIndices
.
get
(
0
).
getKks
());
idxBizFanWarningRecord
.
setRecord
(
idxBizFanHealthIndices
.
get
(
0
).
getRecord
());
idxBizFanWarningRecord
.
setRecord
(
idxBizFanHealthIndices
.
get
(
0
).
getRecord
());
idxBizFanWarningRecord
.
setArae
(
idxBizFanHealthIndices
.
get
(
0
).
getArae
());
idxBizFanWarningRecord
.
setArae
(
idxBizFanHealthIndices
.
get
(
0
).
getArae
());
idxBizFanWarningRecord
.
setStation
(
idxBizFanHealthIndices
.
get
(
0
).
getStation
());
idxBizFanWarningRecord
.
setStation
(
idxBizFanHealthIndices
.
get
(
0
).
getStation
());
...
@@ -767,6 +776,7 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -767,6 +776,7 @@ public class HealthStatusIndicatorServiceImpl {
if
(!
level
.
equals
(
""
)
&&
flag
==
0
){
if
(!
level
.
equals
(
""
)
&&
flag
==
0
){
IdxBizFanWarningRecord
idxBizFanWarningRecord
=
new
IdxBizFanWarningRecord
();
IdxBizFanWarningRecord
idxBizFanWarningRecord
=
new
IdxBizFanWarningRecord
();
idxBizFanWarningRecord
.
setKks
(
idxBizFanHealthIndices
.
get
(
0
).
getKks
());
idxBizFanWarningRecord
.
setRecord
(
idxBizFanHealthIndices
.
get
(
0
).
getRecord
());
idxBizFanWarningRecord
.
setRecord
(
idxBizFanHealthIndices
.
get
(
0
).
getRecord
());
idxBizFanWarningRecord
.
setArae
(
idxBizFanHealthIndices
.
get
(
0
).
getArae
());
idxBizFanWarningRecord
.
setArae
(
idxBizFanHealthIndices
.
get
(
0
).
getArae
());
idxBizFanWarningRecord
.
setStation
(
idxBizFanHealthIndices
.
get
(
0
).
getStation
());
idxBizFanWarningRecord
.
setStation
(
idxBizFanHealthIndices
.
get
(
0
).
getStation
());
...
@@ -907,6 +917,7 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -907,6 +917,7 @@ public class HealthStatusIndicatorServiceImpl {
int
flag
=
ObjectUtils
.
isEmpty
(
idxBizFanWarningRecords
)
||
WarningNameEnum
.
getCode
(
level
)
>
WarningNameEnum
.
getCode
(
idxBizFanWarningRecords
.
get
(
0
).
getWarningName
())
?
0
:
1
;
int
flag
=
ObjectUtils
.
isEmpty
(
idxBizFanWarningRecords
)
||
WarningNameEnum
.
getCode
(
level
)
>
WarningNameEnum
.
getCode
(
idxBizFanWarningRecords
.
get
(
0
).
getWarningName
())
?
0
:
1
;
if
(!
level
.
equals
(
""
)
&&
flag
==
0
){
if
(!
level
.
equals
(
""
)
&&
flag
==
0
){
IdxBizFanWarningRecord
idxBizFanWarningRecord
=
new
IdxBizFanWarningRecord
();
IdxBizFanWarningRecord
idxBizFanWarningRecord
=
new
IdxBizFanWarningRecord
();
idxBizFanWarningRecord
.
setKks
(
idxBizFanHealthIndices
.
get
(
0
).
getKks
());
idxBizFanWarningRecord
.
setRecord
(
idxBizFanHealthIndices
.
get
(
0
).
getRecord
());
idxBizFanWarningRecord
.
setRecord
(
idxBizFanHealthIndices
.
get
(
0
).
getRecord
());
idxBizFanWarningRecord
.
setArae
(
idxBizFanHealthIndices
.
get
(
0
).
getArae
());
idxBizFanWarningRecord
.
setArae
(
idxBizFanHealthIndices
.
get
(
0
).
getArae
());
idxBizFanWarningRecord
.
setStation
(
idxBizFanHealthIndices
.
get
(
0
).
getStation
());
idxBizFanWarningRecord
.
setStation
(
idxBizFanHealthIndices
.
get
(
0
).
getStation
());
...
@@ -950,10 +961,10 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -950,10 +961,10 @@ public class HealthStatusIndicatorServiceImpl {
bizMessage
.
setTraceId
(
idxBizPvWarningRecord
.
getSequenceNbr
());
bizMessage
.
setTraceId
(
idxBizPvWarningRecord
.
getSequenceNbr
());
RiskBizInfoVo
riskBizInfoVo
=
new
RiskBizInfoVo
();
RiskBizInfoVo
riskBizInfoVo
=
new
RiskBizInfoVo
();
riskBizInfoVo
.
setWarningObjectName
(
idxBizPvWarningRecord
.
getEquipmentName
());
riskBizInfoVo
.
setWarningObjectName
(
idxBizPvWarningRecord
.
getEquipmentName
());
riskBizInfoVo
.
setWarningObjectCode
(
idxBizPvWarningRecord
.
get
SequenceNbr
());
riskBizInfoVo
.
setWarningObjectCode
(
idxBizPvWarningRecord
.
get
Kks
());
riskBizInfoVo
.
setSourceAttribution
(
stationMap
.
get
(
idxBizPvWarningRecord
.
getGatewayId
()).
getProjectOrgCode
());
riskBizInfoVo
.
setSourceAttribution
(
stationMap
.
get
(
idxBizPvWarningRecord
.
getGatewayId
()).
getProjectOrgCode
());
riskBizInfoVo
.
setSourceAttributionDesc
(
idxBizPvWarningRecord
.
getStation
());
riskBizInfoVo
.
setSourceAttributionDesc
(
idxBizPvWarningRecord
.
getStation
());
riskBizInfoVo
.
setWarningObjectType
(
"
pv
"
);
riskBizInfoVo
.
setWarningObjectType
(
"
equip
"
);
List
<
RiskDynamicDetailsVo
>
detailsVos
=
new
ArrayList
<>();
List
<
RiskDynamicDetailsVo
>
detailsVos
=
new
ArrayList
<>();
RiskDynamicDetailsVo
dynamicDetailsVo
=
new
RiskDynamicDetailsVo
();
RiskDynamicDetailsVo
dynamicDetailsVo
=
new
RiskDynamicDetailsVo
();
dynamicDetailsVo
.
setTabName
(
"预警详情"
);
dynamicDetailsVo
.
setTabName
(
"预警详情"
);
...
@@ -961,7 +972,7 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -961,7 +972,7 @@ public class HealthStatusIndicatorServiceImpl {
riskBizInfoVo
.
setDynamicDetails
(
detailsVos
);
riskBizInfoVo
.
setDynamicDetails
(
detailsVos
);
bizMessage
.
setBizInfo
(
riskBizInfoVo
);
bizMessage
.
setBizInfo
(
riskBizInfoVo
);
try
{
try
{
emqKeeper
.
getMqttClient
().
publish
(
SMART_ANALYSE
+
"/data/analysis"
,
JSON
.
toJSONString
(
bizMessage
).
getBytes
(
StandardCharsets
.
UTF_8
),
2
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
SMART_ANALYSE
_PV
+
"/data/analysis"
,
JSON
.
toJSONString
(
bizMessage
).
getBytes
(
StandardCharsets
.
UTF_8
),
2
,
false
);
}
catch
(
MqttException
e
)
{
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -984,10 +995,10 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -984,10 +995,10 @@ public class HealthStatusIndicatorServiceImpl {
bizMessage
.
setTraceId
(
idxBizFanWarningRecord
.
getSequenceNbr
());
bizMessage
.
setTraceId
(
idxBizFanWarningRecord
.
getSequenceNbr
());
RiskBizInfoVo
riskBizInfoVo
=
new
RiskBizInfoVo
();
RiskBizInfoVo
riskBizInfoVo
=
new
RiskBizInfoVo
();
riskBizInfoVo
.
setWarningObjectName
(
idxBizFanWarningRecord
.
getEquipmentName
());
riskBizInfoVo
.
setWarningObjectName
(
idxBizFanWarningRecord
.
getEquipmentName
());
riskBizInfoVo
.
setWarningObjectCode
(
idxBizFanWarningRecord
.
get
SequenceNbr
());
riskBizInfoVo
.
setWarningObjectCode
(
idxBizFanWarningRecord
.
get
Kks
());
riskBizInfoVo
.
setSourceAttribution
(
stationMap
.
get
(
idxBizFanWarningRecord
.
getGatewayId
()).
getProjectOrgCode
());
riskBizInfoVo
.
setSourceAttribution
(
stationMap
.
get
(
idxBizFanWarningRecord
.
getGatewayId
()).
getProjectOrgCode
());
riskBizInfoVo
.
setSourceAttributionDesc
(
idxBizFanWarningRecord
.
getStation
());
riskBizInfoVo
.
setSourceAttributionDesc
(
idxBizFanWarningRecord
.
getStation
());
riskBizInfoVo
.
setWarningObjectType
(
"
fan
"
);
riskBizInfoVo
.
setWarningObjectType
(
"
equip
"
);
List
<
RiskDynamicDetailsVo
>
detailsVos
=
new
ArrayList
<>();
List
<
RiskDynamicDetailsVo
>
detailsVos
=
new
ArrayList
<>();
RiskDynamicDetailsVo
dynamicDetailsVo
=
new
RiskDynamicDetailsVo
();
RiskDynamicDetailsVo
dynamicDetailsVo
=
new
RiskDynamicDetailsVo
();
dynamicDetailsVo
.
setTabName
(
"预警详情"
);
dynamicDetailsVo
.
setTabName
(
"预警详情"
);
...
@@ -995,7 +1006,7 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -995,7 +1006,7 @@ public class HealthStatusIndicatorServiceImpl {
riskBizInfoVo
.
setDynamicDetails
(
detailsVos
);
riskBizInfoVo
.
setDynamicDetails
(
detailsVos
);
bizMessage
.
setBizInfo
(
riskBizInfoVo
);
bizMessage
.
setBizInfo
(
riskBizInfoVo
);
try
{
try
{
emqKeeper
.
getMqttClient
().
publish
(
SMART_ANALYSE
+
"/data/analysis"
,
JSON
.
toJSONString
(
bizMessage
).
getBytes
(
StandardCharsets
.
UTF_8
),
2
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
SMART_ANALYSE
_FAN
+
"/data/analysis"
,
JSON
.
toJSONString
(
bizMessage
).
getBytes
(
StandardCharsets
.
UTF_8
),
2
,
false
);
}
catch
(
MqttException
e
)
{
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
...
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