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
25285773
Commit
25285773
authored
Nov 09, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://39.98.45.134:8090/moa/amos-boot-biz
into developer
parents
ad8e7b93
375ff847
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
73 deletions
+54
-73
TDBigScreenAnalyseController.java
...le/jxiop/biz/controller/TDBigScreenAnalyseController.java
+0
-0
WarningRecordStatusMessage.java
...oot/module/jxiop/biz/emqx/WarningRecordStatusMessage.java
+10
-41
AlarmInfoDetailServiceImpl.java
...le/jxiop/biz/service/impl/AlarmInfoDetailServiceImpl.java
+44
-32
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/TDBigScreenAnalyseController.java
0 → 100644
View file @
25285773
This diff is collapsed.
Click to expand it.
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 @
25285773
...
...
@@ -4,11 +4,9 @@ import cn.hutool.core.date.DateUtil;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
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.IdxBizPvWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.*
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.FanWarningRecordServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.HealthStatusIndicatorServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.PvWarningRecordServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord
;
...
...
@@ -16,14 +14,14 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord;
import
lombok.extern.slf4j.Slf4j
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
javax.annotation.PostConstruct
;
import
java.util.*
;
import
java.util.concurrent.BlockingQueue
;
import
java.util.concurrent.LinkedBlockingQueue
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Component
...
...
@@ -38,16 +36,6 @@ public class WarningRecordStatusMessage extends EmqxListener {
public
static
final
String
WARNING_CHANGE_MESSAGE
=
"+/warning/change"
;
private
static
final
BlockingQueue
<
JSONArray
>
blockingQueueFan
=
new
LinkedBlockingQueue
<
JSONArray
>();
private
static
final
BlockingQueue
<
JSONArray
>
blockingQueuePv
=
new
LinkedBlockingQueue
<
JSONArray
>();
@Autowired
private
IdxBizFanWarningRecordServiceImpl
idxBizFanWarningRecordService
;
@Autowired
private
IdxBizPvWarningRecordServiceImpl
idxBizPvWarningRecordService
;
@Autowired
private
FanWaringRecordMapper
fanWaringRecordMapper
;
...
...
@@ -62,7 +50,6 @@ public class WarningRecordStatusMessage extends EmqxListener {
@PostConstruct
void
init
()
throws
Exception
{
new
Thread
(
taskRunnable
).
start
();
emqKeeper
.
subscript
(
WARNING_CHANGE_MESSAGE
,
2
,
this
);
}
...
...
@@ -71,35 +58,16 @@ public class WarningRecordStatusMessage extends EmqxListener {
if
(
topic
.
contains
(
HealthStatusIndicatorServiceImpl
.
SMART_ANALYSE_PV
))
{
log
.
info
(
"预警状态改变消息-光伏{}"
,
new
String
(
message
.
getPayload
()));
JSONArray
ja
=
JSON
.
parseArray
(
new
String
(
message
.
getPayload
()));
blockingQueuePv
.
add
(
ja
);
jxIopUpdatePv
(
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
);
jxIopUpdateFan
(
ja
);
}
}
Runnable
taskRunnable
=
new
Runnable
()
{
@Override
public
void
run
()
{
boolean
isRun
=
true
;
int
k
=
0
;
while
(
isRun
)
{
k
++;
isRun
=
k
<
Integer
.
MAX_VALUE
;
try
{
JSONArray
analysisResultFan
=
blockingQueueFan
.
take
();
jxIopUpdateFan
(
analysisResultFan
);
JSONArray
analysisResultPv
=
blockingQueuePv
.
take
();
jxIopUpdatePv
(
analysisResultPv
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
};
@Async
(
"async"
)
public
void
jxIopUpdateFan
(
JSONArray
analysisResult
)
{
log
.
info
(
"修改预警状态信息:{}"
,
analysisResult
);
List
<
JSONObject
>
taskList
=
JSONObject
.
parseArray
(
analysisResult
.
toJSONString
(),
JSONObject
.
class
);
...
...
@@ -124,6 +92,7 @@ public class WarningRecordStatusMessage extends EmqxListener {
}
@Async
(
"async"
)
public
void
jxIopUpdatePv
(
JSONArray
analysisResult
)
{
log
.
info
(
"修改预警状态信息:{}"
,
analysisResult
);
List
<
JSONObject
>
taskList
=
JSONObject
.
parseArray
(
analysisResult
.
toJSONString
(),
JSONObject
.
class
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/AlarmInfoDetailServiceImpl.java
View file @
25285773
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