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
26b0e7b9
Commit
26b0e7b9
authored
Sep 13, 2022
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
32c0c08e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
8 deletions
+26
-8
ConfirmAlarmServiceImpl.java
...oin/equipmanage/service/impl/ConfirmAlarmServiceImpl.java
+1
-1
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+25
-7
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/ConfirmAlarmServiceImpl.java
View file @
26b0e7b9
...
@@ -177,7 +177,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
...
@@ -177,7 +177,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
set
(
EquipmentSpecific:
:
getRealtimeIotIndexUpdateDate
,
new
Date
()).
set
(
EquipmentSpecific:
:
getRealtimeIotIndexUpdateDate
,
new
Date
()).
eq
(
EquipmentSpecific:
:
getId
,
alarm
.
getEquipmentSpecificId
());
eq
(
EquipmentSpecific:
:
getId
,
alarm
.
getEquipmentSpecificId
());
equipmentSpecificSerivce
.
update
(
wrapper
);
equipmentSpecificSerivce
.
update
(
wrapper
);
MqttReceiveServiceImpl
.
upAlarmLogStatus
(
alarmLog
.
getIotCode
(),
alarmLog
.
getEquipmentSpecificIndexKey
(),
null
,
equipmentSpecificAlarmLogService
);
MqttReceiveServiceImpl
.
upAlarmLogStatus
(
alarmLog
.
getIotCode
(),
alarmLog
.
getEquipmentSpecificIndexKey
(),
null
,
equipmentSpecificAlarmLogService
,
true
);
}
}
// 如果是批量确警,先查询,再确警,用于批量消息推送
// 如果是批量确警,先查询,再确警,用于批量消息推送
isBatch
=
ent
.
getIsBatch
();
isBatch
=
ent
.
getIsBatch
();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
26b0e7b9
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.mchange.v2.beans.swing.TestBean
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
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
;
...
@@ -57,8 +58,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -57,8 +58,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
private
static
Map
<
String
,
TemperatureAlarmDto
>
temperatureMap
=
new
HashMap
<>();
private
static
Map
<
String
,
TemperatureAlarmDto
>
temperatureMap
=
new
HashMap
<>();
static
IEquipmentSpecificIndexService
equipmentSpecificIndexService
;
@Autowired
@Autowired
IEquipmentSpecificIndexService
equipmentSpecificIndexService
;
public
void
setEquipmentSpecificIndexService
(
IEquipmentSpecificIndexService
equipmentSpecificIndexService
){
MqttReceiveServiceImpl
.
equipmentSpecificIndexService
=
equipmentSpecificIndexService
;
}
@Autowired
@Autowired
ICarPropertyService
carPropertyService
;
ICarPropertyService
carPropertyService
;
...
@@ -88,11 +92,18 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -88,11 +92,18 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Autowired
@Autowired
FireFightingSystemMapper
FireFightingSystemMapper
;
FireFightingSystemMapper
FireFightingSystemMapper
;
static
IFireFightingSystemService
fireFightingSystemService
;
@Autowired
@Autowired
IFireFightingSystemService
fireFightingSystemService
;
public
void
setFireFightingSystemService
(
IFireFightingSystemService
fireFightingSystemService
){
MqttReceiveServiceImpl
.
fireFightingSystemService
=
fireFightingSystemService
;
}
static
MqttSendGateway
mqttSendGateway
;
@Autowired
@Autowired
MqttSendGateway
mqttSendGateway
;
public
void
setMqttSendGateway
(
MqttSendGateway
mqttSendGateway
){
MqttReceiveServiceImpl
.
mqttSendGateway
=
mqttSendGateway
;
}
@Autowired
@Autowired
private
RedisUtils
redisUtils
;
private
RedisUtils
redisUtils
;
...
@@ -133,8 +144,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -133,8 +144,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Value
(
"${mqtt.vehicle.topic}"
)
@Value
(
"${mqtt.vehicle.topic}"
)
private
String
carTopic
;
private
String
carTopic
;
private
static
String
canvasTopic
;
@Value
(
"${equip.point.equipmentdata.topic}"
)
@Value
(
"${equip.point.equipmentdata.topic}"
)
private
String
canvasTopic
;
public
void
setCanvasTopic
(
String
canvasTopic
){
MqttReceiveServiceImpl
.
canvasTopic
=
canvasTopic
;
}
@Value
(
"${equip.index.topic}"
)
@Value
(
"${equip.index.topic}"
)
private
String
indexTopic
;
private
String
indexTopic
;
...
@@ -301,7 +315,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -301,7 +315,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQDQR
.
getTopic
(),
JSONArray
.
toJSON
(
action
).
toString
());
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQDQR
.
getTopic
(),
JSONArray
.
toJSON
(
action
).
toString
());
}
else
{
}
else
{
alarmLogs
.
addAll
(
upAlarmLogStatus
(
action
.
getIotCode
(),
action
.
getEquipmentSpecificIndexKey
(),
action
.
getTraceId
(),
alarmLogs
.
addAll
(
upAlarmLogStatus
(
action
.
getIotCode
(),
action
.
getEquipmentSpecificIndexKey
(),
action
.
getTraceId
(),
equipmentSpecificAlarmLogService
));
equipmentSpecificAlarmLogService
,
false
));
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQYQR
.
getTopic
(),
JSONArray
.
toJSON
(
action
).
toString
());
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQYQR
.
getTopic
(),
JSONArray
.
toJSON
(
action
).
toString
());
bool
=
Boolean
.
TRUE
;
bool
=
Boolean
.
TRUE
;
}
}
...
@@ -379,7 +393,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -379,7 +393,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
}
}
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
,
boolean
flag
)
{
LambdaQueryWrapper
<
EquipmentSpecificAlarmLog
>
queryWrapper
=
new
LambdaQueryWrapper
();
LambdaQueryWrapper
<
EquipmentSpecificAlarmLog
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
eq
(
EquipmentSpecificAlarmLog:
:
getIotCode
,
iotCode
);
queryWrapper
.
eq
(
EquipmentSpecificAlarmLog:
:
getIotCode
,
iotCode
);
queryWrapper
.
eq
(
EquipmentSpecificAlarmLog:
:
getEquipmentSpecificIndexKey
,
equipmentSpecificIndexKey
);
queryWrapper
.
eq
(
EquipmentSpecificAlarmLog:
:
getEquipmentSpecificIndexKey
,
equipmentSpecificIndexKey
);
...
@@ -396,6 +410,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -396,6 +410,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
if
(!
logs
.
isEmpty
())
{
if
(!
logs
.
isEmpty
())
{
equipmentSpecificAlarmLogService
.
updateBatchById
(
logs
);
equipmentSpecificAlarmLogService
.
updateBatchById
(
logs
);
}
}
if
(
flag
)
{
List
<
EquipmentSpecificIndex
>
indexList
=
equipmentSpecificIndexService
.
getEquipmentSpeIndexBySpeIotCode
(
iotCode
);
publishDataToCanvas
(
indexList
);
}
return
logs
;
return
logs
;
}
}
...
@@ -404,7 +422,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -404,7 +422,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
*
*
* @param indexList
* @param indexList
*/
*/
public
void
publishDataToCanvas
(
List
<
EquipmentSpecificIndex
>
indexList
)
{
public
static
void
publishDataToCanvas
(
List
<
EquipmentSpecificIndex
>
indexList
)
{
if
(!
ObjectUtils
.
isEmpty
(
indexList
))
{
if
(!
ObjectUtils
.
isEmpty
(
indexList
))
{
EquipmentSpecificIndex
index
=
indexList
.
stream
().
filter
(
x
->
x
.
getUpdateDate
()
!=
null
)
EquipmentSpecificIndex
index
=
indexList
.
stream
().
filter
(
x
->
x
.
getUpdateDate
()
!=
null
)
.
sorted
(
Comparator
.
comparing
(
EquipmentSpecificIndex:
:
getUpdateDate
).
reversed
())
.
sorted
(
Comparator
.
comparing
(
EquipmentSpecificIndex:
:
getUpdateDate
).
reversed
())
...
...
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