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
61729399
Commit
61729399
authored
Nov 21, 2024
by
xixinzhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_bugfix@dl' into develop_dl_4.0
parents
efb99e5e
47a3ca2c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
8 deletions
+55
-8
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+50
-6
application-dev.properties
...ystem-equip/src/main/resources/application-dev.properties
+5
-2
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
61729399
...
...
@@ -240,6 +240,12 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
private
String
authKeyEnable
;
private
static
final
String
QRCODE_REDIS_KEY
=
"qrCodeRedisKey"
;
@Value
(
"${send.data.to.center.time}"
)
private
long
sendDataToCenterTime
;
@Value
(
"${send.data.to.center.key}"
)
private
String
sendDataToCenterKey
;
public
static
List
<
EquipmentSpecificAlarmLog
>
upAlarmLogStatus
(
String
iotCode
,
String
equipmentSpecificIndexKey
,
String
traceId
,
IEquipmentSpecificAlarmLogService
equipmentSpecificAlarmLogService
,
boolean
flag
,
boolean
batchConfirm
,
String
confirmType
)
{
...
...
@@ -412,6 +418,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
Map
.
Entry
<
String
,
Object
>
entry
=
(
Map
.
Entry
<
String
,
Object
>)
it
.
next
();
String
key
=
entry
.
getKey
();
Object
value
=
entry
.
getValue
();
boolean
saveData
=
isSaveData
(
topicEntity
.
getIotCode
(),
key
,
value
);
if
(
saveData
)
{
return
;
}
iotDataVO
.
setKey
(
key
);
iotDataVO
.
setValue
(
value
);
if
(
"traceId"
.
equalsIgnoreCase
(
key
))
{
...
...
@@ -518,6 +528,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
equipmentSpeIndex
.
setUUID
(
UUIDUtils
.
getUUID
());
equipmentSpeIndex
.
setUnit
(
Objects
.
nonNull
(
equipmentIndex
.
getUnit
())
?
equipmentIndex
.
getUnit
()
:
equipmentIndex
.
getUnitName
());
boolean
saveData
=
isSaveData
(
equipmentSpeIndex
.
getIotCode
(),
equipmentSpeIndex
.
getEquipmentIndexKey
(),
value
);
if
(
saveData
)
{
return
;
}
IotDataVO
iotDataVO
=
new
IotDataVO
();
iotDataVO
.
setKey
(
equipmentSpeIndex
.
getNameKey
());
iotDataVO
.
setValue
(
value
);
...
...
@@ -825,6 +840,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
equipmentSpeIndex
.
setTimeStamp
(
sShanStationMessage
.
getTimestamp
());
equipmentSpeIndex
.
setUUID
(
UUIDUtils
.
getUUID
());
boolean
saveData
=
isSaveData
(
equipmentSpeIndex
.
getIotCode
(),
equipmentSpeIndex
.
getEquipmentIndexKey
(),
value
);
if
(
saveData
)
{
return
;
}
IotDataVO
iotDataVO
=
new
IotDataVO
();
iotDataVO
.
setKey
(
equipmentSpeIndex
.
getNameKey
());
iotDataVO
.
setValue
(
value
);
...
...
@@ -1464,7 +1484,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
//预警业务 泡沫罐 或 者管网压力
JSONObject
config
=
this
.
getRiskTriggerConfig
(
"FIRE_EQUIP_LEVEL"
);
if
(
Objects
.
isNull
(
config
))
{
throw
new
RuntimeException
(
"获取配置失败!"
);
log
.
info
(
"获取配置失败!"
);
return
false
;
}
HashMap
<
String
,
String
>
extra
=
new
HashMap
<>();
extra
.
put
(
"useSource"
,
config
.
getString
(
"useSource"
));
...
...
@@ -1544,7 +1565,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
String
warningObjectCode
=
bizOrgCode
+
"@"
+
indexKey
;
JSONObject
config
=
this
.
getRiskTriggerConfig
(
"FIRE_WATER_CAPACITY"
);
if
(
Objects
.
isNull
(
config
))
{
throw
new
RuntimeException
(
"获取配置失败!"
);
log
.
info
(
"获取配置失败!"
);
return
;
}
HashMap
<
String
,
String
>
extra
=
new
HashMap
<>();
extra
.
put
(
"useSource"
,
config
.
getString
(
"useSource"
));
...
...
@@ -1590,7 +1612,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
private
void
doPressurePumInfo
(
Integer
totalNum
,
EquipmentSpecificIndex
equipmentSpecificIndex
)
{
JSONObject
config
=
this
.
getRiskTriggerConfig
(
"FIRE_EQUIP_PRESSURE"
);
if
(
Objects
.
isNull
(
config
))
{
throw
new
RuntimeException
(
"获取配置失败!"
);
log
.
info
(
"获取配置失败!"
);
return
;
}
HashMap
<
String
,
String
>
extra
=
new
HashMap
<>();
extra
.
put
(
"useSource"
,
config
.
getString
(
"useSource"
));
...
...
@@ -1693,7 +1716,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
if
(
"pool"
.
equals
(
map
.
get
(
"resourceType"
).
toString
())
||
"waterTank"
.
equals
(
map
.
get
(
"resourceType"
).
toString
()))
{
JSONObject
config
=
this
.
getRiskTriggerConfig
(
"FIRE_WATER_LEVEL"
);
if
(
Objects
.
isNull
(
config
))
{
throw
new
RuntimeException
(
"获取配置失败!"
);
log
.
info
(
"获取配置失败!"
);
return
false
;
}
HashMap
<
String
,
String
>
extra
=
new
HashMap
<>();
extra
.
put
(
"useSource"
,
config
.
getString
(
"useSource"
));
...
...
@@ -3155,9 +3179,29 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
private
JSONObject
getRiskTriggerConfig
(
String
tableName
)
{
Map
<
String
,
Object
>
configMap
=
JSON
.
parseObject
(
redisUtils
.
getString
(
QRCODE_REDIS_KEY
),
Map
.
class
);
if
(!
ObjectUtils
.
isEmpty
(
configMap
))
{
String
config
=
configMap
.
get
(
tableName
+
"0"
).
toString
();
return
JSONObject
.
parseObject
(
config
).
getJSONObject
(
"content"
).
getJSONObject
(
"extra"
);
if
(!
ObjectUtils
.
isEmpty
(
configMap
.
get
(
tableName
+
"0"
)))
{
String
config
=
String
.
valueOf
(
configMap
.
get
(
tableName
+
"0"
));
return
JSONObject
.
parseObject
(
config
).
getJSONObject
(
"content"
).
getJSONObject
(
"extra"
);
}
}
return
null
;
}
private
boolean
isSaveData
(
String
iotCode
,
String
key
,
Object
value
)
{
// 设置连续几秒内数据不入库
if
(!
ObjectUtils
.
isEmpty
(
sendDataToCenterKey
))
{
String
[]
split
=
sendDataToCenterKey
.
split
(
","
);
boolean
contains
=
Arrays
.
asList
(
split
).
contains
(
key
);
if
(
contains
)
{
String
redisKey
=
iotCode
+
"-"
+
key
+
"-DATA-FREQUENCY"
;
Object
existRedis
=
redisUtils
.
get
(
redisKey
);
if
(!
ObjectUtils
.
isEmpty
(
existRedis
))
{
return
true
;
}
else
{
redisUtils
.
set
(
redisKey
,
value
,
sendDataToCenterTime
);
}
}
}
return
false
;
}
}
amos-boot-system-equip/src/main/resources/application-dev.properties
View file @
61729399
...
...
@@ -187,4 +187,7 @@ message.alarm.char=\u51FA\u73B0
update.car.qrCode
=
-
power.station.url
=
-
equip.patrol.cron
=
0 21 17 * * ?
\ No newline at end of file
equip.patrol.cron
=
0 21 17 * * ?
send.data.to.center.time
=
30
send.data.to.center.key
=
FHS_FirePoolDevice_WaterLevel,FHS_PipePressureDetector_PipePressure
\ 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