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
a90f12fc
Commit
a90f12fc
authored
Jun 05, 2023
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备报警红黄码
parent
41879898
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
2 deletions
+40
-2
EquipQrcodeColorEnum.java
...eejoin/equipmanage/common/enums/EquipQrcodeColorEnum.java
+27
-0
SendToMsgRiskEquipInfoVo.java
...ejoin/equipmanage/common/vo/SendToMsgRiskEquipInfoVo.java
+2
-0
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+11
-2
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/enums/EquipQrcodeColorEnum.java
0 → 100644
View file @
a90f12fc
package
com
.
yeejoin
.
equipmanage
.
common
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Getter
;
/**
* @author
* @title: EquipQrcodeColorEnum
* <pre>
* @description: TODO
* </pre>
* @date 2020/12/12 14:23
*/
@Getter
@AllArgsConstructor
public
enum
EquipQrcodeColorEnum
{
GREEN
(
"0"
,
"绿色"
),
YELLOW
(
"1"
,
"黄色"
),
RED
(
"2"
,
"红色"
);
private
String
code
;
private
String
describe
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/vo/SendToMsgRiskEquipInfoVo.java
View file @
a90f12fc
...
...
@@ -22,4 +22,6 @@ public class SendToMsgRiskEquipInfoVo {
private
String
bizOrgName
;
private
String
bizOrgCode
;
private
Boolean
reportIsAlarm
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
a90f12fc
...
...
@@ -271,6 +271,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
private
static
Boolean
bool
=
Boolean
.
FALSE
;
private
static
Boolean
isAlarm
=
Boolean
.
FALSE
;
@Autowired
protected
EmqKeeper
emqKeeper
;
...
...
@@ -514,18 +516,24 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Override
public
void
afterCommit
()
{
equipmentSpecificAlarms
.
forEach
(
action
->
{
EquipmentSpecific
specific
=
equipmentSpecificMapper
.
selectById
(
action
.
getEquipmentSpecificId
());
if
(
AlarmStatusEnum
.
BJ
.
getCode
()
==
action
.
getStatus
())
{
alarmLogs
.
add
(
addEquipAlarmLogRecord
(
action
));
if
(
ValidationUtil
.
isEmpty
(
action
.
getAlamContent
()))
{
action
.
setAlamContent
(
action
.
getEquipmentSpecificName
()
+
action
.
getEquipmentSpecificIndexName
());
}
specific
.
setEquipStatus
(
EquipQrcodeColorEnum
.
RED
.
getCode
());
isAlarm
=
Boolean
.
TRUE
;
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQDQR
.
getTopic
(),
JSONArray
.
toJSON
(
action
).
toString
());
}
else
{
specific
.
setEquipStatus
(
EquipQrcodeColorEnum
.
GREEN
.
getCode
());
isAlarm
=
Boolean
.
FALSE
;
alarmLogs
.
addAll
(
upAlarmLogStatus
(
action
.
getIotCode
(),
action
.
getEquipmentSpecificIndexKey
(),
action
.
getTraceId
(),
equipmentSpecificAlarmLogService
,
false
));
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQYQR
.
getTopic
(),
JSONArray
.
toJSON
(
action
).
toString
());
bool
=
Boolean
.
TRUE
;
}
equipmentSpecificMapper
.
updateById
(
specific
);
});
// 直流中心消息推送刷新
...
...
@@ -535,7 +543,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
publishNormalIndexValueToPage
(
equipmentSpecificIndexList
);
// 触发风险---> 站端发送消息到Message服务
publishDataToMessage
(
equipmentSpecificIndexList
);
publishDataToMessage
(
equipmentSpecificIndexList
,
isAlarm
);
if
(
"zd"
.
equals
(
system
)){
System
.
out
.
println
(
"站端系统----------------"
);
...
...
@@ -1452,7 +1460,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
log
.
info
(
String
.
format
(
"四横八纵遥测指标消息发送:%s"
,
JSON
.
toJSONString
(
equipmentSpecificIndexList
)));
}
public
void
publishDataToMessage
(
List
<
EquipmentSpecificIndex
>
equipmentSpeIndexes
)
{
public
void
publishDataToMessage
(
List
<
EquipmentSpecificIndex
>
equipmentSpeIndexes
,
Boolean
isAlarm
)
{
equipmentSpeIndexes
.
forEach
(
equipmentSpeIndex
->
{
SendToMsgRiskDetailVo
detailVo
=
new
SendToMsgRiskDetailVo
();
SendToMsgRiskEquipInfoVo
equipInfoVo
=
new
SendToMsgRiskEquipInfoVo
();
...
...
@@ -1462,6 +1470,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
equipInfoVo
.
setCode
(
equipmentSpeIndex
.
getEquipmentSpecificCode
());
equipInfoVo
.
setBizOrgCode
(
equipmentSpeIndex
.
getBizOrgCode
());
equipInfoVo
.
setBizOrgName
(
equipmentSpeIndex
.
getBizOrgName
());
equipInfoVo
.
setReportIsAlarm
(
isAlarm
);
alarmInfoVo
.
setKey
(
equipmentSpeIndex
.
getEquipmentIndexKey
());
alarmInfoVo
.
setValue
(
equipmentSpeIndex
.
getValue
());
...
...
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