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
93b8b0b6
Commit
93b8b0b6
authored
Nov 29, 2023
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新告警信号入库逻辑
parent
e45bd109
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
7 deletions
+31
-7
SShanMessage.java
.../java/com/yeejoin/equipmanage/common/vo/SShanMessage.java
+1
-0
EquipmentIotMqttReceiveConfig.java
...oin/equipmanage/config/EquipmentIotMqttReceiveConfig.java
+2
-2
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+11
-3
BeanUtil.java
...src/main/java/com/yeejoin/equipmanage/utils/BeanUtil.java
+12
-0
application-dev.properties
...ystem-equip/src/main/resources/application-dev.properties
+5
-2
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/vo/SShanMessage.java
View file @
93b8b0b6
...
@@ -18,4 +18,5 @@ public class SShanMessage {
...
@@ -18,4 +18,5 @@ public class SShanMessage {
private
String
pointId
;
private
String
pointId
;
private
String
time
;
private
String
time
;
private
String
deviceId
;
private
String
deviceId
;
private
String
eventstatus
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/config/EquipmentIotMqttReceiveConfig.java
View file @
93b8b0b6
...
@@ -150,9 +150,9 @@ public class EquipmentIotMqttReceiveConfig {
...
@@ -150,9 +150,9 @@ public class EquipmentIotMqttReceiveConfig {
mqttReceiveService
.
handlerMqttIncrementMessage
(
topic
,
msg
);
mqttReceiveService
.
handlerMqttIncrementMessage
(
topic
,
msg
);
}
else
if
(
dataType
.
equals
(
"event"
)
&&
StringUtil
.
isNotEmpty
(
msg
))
{
}
else
if
(
dataType
.
equals
(
"event"
)
&&
StringUtil
.
isNotEmpty
(
msg
))
{
mqttEventReceiveService
.
handlerMqttIncrementMessage
(
topic
,
msg
);
mqttEventReceiveService
.
handlerMqttIncrementMessage
(
topic
,
msg
);
}
else
if
(
dataType
.
equals
(
"transmit"
)
&&
StringUtil
.
isNotEmpty
(
msg
)){
}
else
if
(
dataType
.
equals
(
"transmit"
)
&&
StringUtil
.
isNotEmpty
(
msg
)){
// 遥信遥测信号
mqttReceiveService
.
handlerMqttRomaMessage
(
topic
,
msg
);
mqttReceiveService
.
handlerMqttRomaMessage
(
topic
,
msg
);
}
else
if
(
dataType
.
equals
(
"shaoshan"
)
&&
StringUtil
.
isNotEmpty
(
msg
)){
}
else
if
(
dataType
.
equals
(
"shaoshan"
)
&&
StringUtil
.
isNotEmpty
(
msg
)){
// 告警信号
mqttReceiveService
.
handlerMqttStationMessage
(
topic
,
msg
);
mqttReceiveService
.
handlerMqttStationMessage
(
topic
,
msg
);
}
}
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
93b8b0b6
...
@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...
@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.component.influxdb.InfluxDbConnection
;
import
com.yeejoin.amos.component.influxdb.InfluxDbConnection
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.feign.systemctl.model.MessageModel
;
import
com.yeejoin.amos.feign.systemctl.model.MessageModel
;
import
com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentDefectAlarm
;
import
com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentDefectAlarm
;
...
@@ -48,7 +47,6 @@ import org.springframework.util.CollectionUtils;
...
@@ -48,7 +47,6 @@ import org.springframework.util.CollectionUtils;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
...
@@ -198,6 +196,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -198,6 +196,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
private
Resource
systemStateIndex
;
private
Resource
systemStateIndex
;
@Value
(
"${dcs.send.message}"
)
@Value
(
"${dcs.send.message}"
)
private
Boolean
NRMsgSend
;
private
Boolean
NRMsgSend
;
@Value
(
"${message.alarm.char}"
)
private
String
specialChars
;
public
static
List
<
EquipmentSpecificAlarmLog
>
upAlarmLogStatus
(
String
iotCode
,
String
equipmentSpecificIndexKey
,
public
static
List
<
EquipmentSpecificAlarmLog
>
upAlarmLogStatus
(
String
iotCode
,
String
equipmentSpecificIndexKey
,
String
traceId
,
IEquipmentSpecificAlarmLogService
equipmentSpecificAlarmLogService
,
String
traceId
,
IEquipmentSpecificAlarmLogService
equipmentSpecificAlarmLogService
,
...
@@ -693,7 +693,14 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -693,7 +693,14 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
SShanStationMessage
sShanStationMessage
=
JSON
.
parseObject
(
String
.
valueOf
(
message
),
SShanStationMessage
.
class
);
SShanStationMessage
sShanStationMessage
=
JSON
.
parseObject
(
String
.
valueOf
(
message
),
SShanStationMessage
.
class
);
Map
<
Object
,
Object
>
equipmentIndexKeyMap
=
redisUtils
.
hmget
(
RedisKey
.
EQUIP_INDEX_ADDRESS_KEY_STATION
);
Map
<
Object
,
Object
>
equipmentIndexKeyMap
=
redisUtils
.
hmget
(
RedisKey
.
EQUIP_INDEX_ADDRESS_KEY_STATION
);
sShanStationMessage
.
getWarns
().
forEach
(
m
->
{
sShanStationMessage
.
getWarns
().
forEach
(
m
->
{
String
value
=
m
.
getEventTextL1
().
contains
(
"出现"
)
?
TRUE
:
FALSE
;
String
value
;
if
(
message
.
contains
(
"eventtextL1"
))
{
// 此通道目前专供韶山告警消息value赋值,没必要用配置文件多字段进行逐个判断,所以暂时不修改
value
=
m
.
getEventTextL1
().
contains
(
"出现"
)
?
TRUE
:
FALSE
;
}
else
{
value
=
String
.
valueOf
(
BeanUtil
.
judgePropertyContainsChar
(
m
.
getEventstatus
(),
specialChars
));
}
if
(
equipmentIndexKeyMap
.
get
(
m
.
getPointId
())
!=
null
)
{
if
(
equipmentIndexKeyMap
.
get
(
m
.
getPointId
())
!=
null
)
{
EquipmentSpecificIndex
equipmentSpeIndex
=
equipmentSpecificIndexService
.
getEquipmentSpeIndexByAddress
(
null
,
m
.
getPointId
(),
null
);
EquipmentSpecificIndex
equipmentSpeIndex
=
equipmentSpecificIndexService
.
getEquipmentSpeIndexByAddress
(
null
,
m
.
getPointId
(),
null
);
if
(
equipmentSpeIndex
==
null
)
{
if
(
equipmentSpeIndex
==
null
)
{
...
@@ -933,6 +940,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -933,6 +940,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
});
});
}
}
/**
/**
* 物联数据处理
* 物联数据处理
*
*
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/utils/BeanUtil.java
View file @
93b8b0b6
...
@@ -30,4 +30,16 @@ public class BeanUtil {
...
@@ -30,4 +30,16 @@ public class BeanUtil {
public
static
void
copyPropertiesIgnoreNull
(
Object
src
,
Object
target
){
public
static
void
copyPropertiesIgnoreNull
(
Object
src
,
Object
target
){
BeanUtils
.
copyProperties
(
src
,
target
,
getNullPropertyNames
(
src
));
BeanUtils
.
copyProperties
(
src
,
target
,
getNullPropertyNames
(
src
));
}
}
public
static
boolean
judgePropertyContainsChar
(
String
sourceStr
,
String
specialStr
)
{
boolean
bool
=
Boolean
.
FALSE
;
String
[]
strings
=
specialStr
.
split
(
","
);
for
(
String
code
:
strings
)
{
if
(
sourceStr
.
contains
(
code
))
{
bool
=
Boolean
.
TRUE
;
break
;
}
}
return
bool
;
}
}
}
amos-boot-system-equip/src/main/resources/application-dev.properties
View file @
93b8b0b6
...
@@ -150,4 +150,7 @@ spring.influx.database=iot_platform
...
@@ -150,4 +150,7 @@ spring.influx.database=iot_platform
spring.influx.retention_policy
=
default
spring.influx.retention_policy
=
default
spring.influx.retention_policy_time
=
30d
spring.influx.retention_policy_time
=
30d
spring.influx.actions
=
10000
spring.influx.actions
=
10000
spring.influx.bufferLimit
=
20000
spring.influx.bufferLimit
=
20000
\ No newline at end of file
# message\u670D\u52A1\u8F6C\u53D1\u544A\u8B66\u4FE1\u53F7\u7279\u6B8A\u5224\u65AD\u5B57\u7B26\u96C6
message.alarm.char
=
\u
51FA
\u
73B0
\ No newline at end of file
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