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
0e514a00
Commit
0e514a00
authored
May 13, 2024
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改point_system查询规则
parent
2c773676
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
+18
-5
AlarmKafkaConsumer.java
...ejoin/amos/api/alarm/service/impl/AlarmKafkaConsumer.java
+7
-1
PointSystemServiceImpl.java
...n/amos/api/alarm/service/impl/PointSystemServiceImpl.java
+9
-3
application.properties
...boot-data-alarm/src/main/resources/application.properties
+2
-1
No files found.
amos-boot-data/amos-boot-data-alarm/src/main/java/com/yeejoin/amos/api/alarm/service/impl/AlarmKafkaConsumer.java
View file @
0e514a00
...
@@ -22,15 +22,21 @@ public class AlarmKafkaConsumer {
...
@@ -22,15 +22,21 @@ public class AlarmKafkaConsumer {
PointSystemServiceImpl
pointSystemServiceImpl
;
PointSystemServiceImpl
pointSystemServiceImpl
;
//消费者来处理消息
//消费者来处理消息
@KafkaListener
(
id
=
"
user1
"
,
topics
={
"${kafka.equipment.alarm}"
})
@KafkaListener
(
id
=
"
alarmInfo
"
,
topics
={
"${kafka.equipment.alarm}"
})
public
void
message1
(
String
record
,
Acknowledgment
ack
){
public
void
message1
(
String
record
,
Acknowledgment
ack
){
// 处理业务
// 处理业务
String
date
=
record
;
String
date
=
record
;
System
.
out
.
println
(
"消息进来了"
+
record
);
//异步触发预警
//异步触发预警
pointSystemServiceImpl
.
sendWarningAsync
(
date
);
pointSystemServiceImpl
.
sendWarningAsync
(
date
);
//手动提交
//手动提交
ack
.
acknowledge
();
ack
.
acknowledge
();
}
@KafkaListener
(
id
=
"user2"
,
topics
={
"${kafka.equipment.test}"
})
public
void
message2
(
String
record
,
Acknowledgment
ack
){
String
date
=
record
;
System
.
out
.
println
(
"消息进来了 8888888888888888888888"
);
}
}
...
...
amos-boot-data/amos-boot-data-alarm/src/main/java/com/yeejoin/amos/api/alarm/service/impl/PointSystemServiceImpl.java
View file @
0e514a00
...
@@ -99,12 +99,18 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
...
@@ -99,12 +99,18 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
//通过测点地址获取,和对应值 获取kks
//通过测点地址获取,和对应值 获取kks
QueryWrapper
<
PointSystem
>
pointSystemWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
PointSystem
>
pointSystemWrapper
=
new
QueryWrapper
<>();
pointSystemWrapper
.
lambda
().
eq
(
PointSystem:
:
getAddress
,
address
);
pointSystemWrapper
.
lambda
().
eq
(
PointSystem:
:
getAddress
,
address
);
pointSystemWrapper
.
lambda
().
eq
(
PointSystem:
:
getValue
,
value
);
if
(!
value
.
equals
(
"false"
)
&&
!
value
.
equals
(
"true"
)){
pointSystemWrapper
.
lambda
().
eq
(
PointSystem:
:
getValue
,
value
);
}
pointSystemWrapper
.
lambda
().
eq
(
PointSystem:
:
getGatewayId
,
gatewayId
);
pointSystemWrapper
.
lambda
().
eq
(
PointSystem:
:
getGatewayId
,
gatewayId
);
PointSystem
pointSystem
=
pointSystemMapper
.
selectOne
(
pointSystemWrapper
);
List
<
PointSystem
>
pointSystems
=
pointSystemMapper
.
selectList
(
pointSystemWrapper
);
if
(
pointSystem
==
null
)
{
if
(
pointSystem
s
==
null
||
pointSystems
.
size
()
<
1
)
{
throw
new
RuntimeException
(
"获取kks码失败!"
);
throw
new
RuntimeException
(
"获取kks码失败!"
);
}
}
PointSystem
pointSystem
=
pointSystems
.
get
(
0
);
if
(
pointSystem
.
getType
().
equals
(
"遥信"
)){
return
;
}
//调用获取设备相关信息
//调用获取设备相关信息
Map
<
String
,
String
>
maps
=
new
HashMap
<>();
Map
<
String
,
String
>
maps
=
new
HashMap
<>();
maps
.
put
(
"type"
,
"equipinfo"
);
maps
.
put
(
"type"
,
"equipinfo"
);
...
...
amos-boot-data/amos-boot-data-alarm/src/main/resources/application.properties
View file @
0e514a00
...
@@ -53,7 +53,8 @@ spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.Str
...
@@ -53,7 +53,8 @@ spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.Str
kafka.equipment.alarm
=
EQUIPMENT_ALARM88
kafka.equipment.alarm
=
EQUIPMENT_ALARM
kafka.equipment.test
=
test88888
#电站对接第三方查询设备kks码
#电站对接第三方查询设备kks码
power.station.url
=
http://139.9.169.123:5024/prod-api/fdgl/process/DataInterface
power.station.url
=
http://139.9.169.123:5024/prod-api/fdgl/process/DataInterface
...
...
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