Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
ab9131bb
Commit
ab9131bb
authored
Nov 25, 2020
by
maoying
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_upgrade' of 172.16.10.76:station/YeeAmosFireAutoSysRoot into upgrade
parents
7e56a7ab
403cf6dd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
24 deletions
+26
-24
ContingencyLogListener.java
...join/amos/fas/business/action/ContingencyLogListener.java
+4
-2
SafetyController.java
...eejoin/amos/fas/business/controller/SafetyController.java
+1
-1
HandlerMqttMessageImpl.java
...mos/fas/business/service/impl/HandlerMqttMessageImpl.java
+20
-20
IEquipmentHandlerService.java
.../fas/business/service/intfc/IEquipmentHandlerService.java
+1
-1
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyLogListener.java
View file @
ab9131bb
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.fas.business.action;
import
com.yeejoin.amos.fas.business.service.intfc.IEquipmentHandlerService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationListener
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Component
;
import
com.yeejoin.amos.fas.business.action.model.ContingencyEvent
;
...
...
@@ -15,12 +16,13 @@ public class ContingencyLogListener implements ApplicationListener<ContingencyEv
IRuleRunningSnapshotService
ruleRunningSnapshotService
;
// @Autowired
// IEquipmentHandlerService IEquipmentHandlerService;
// @Lazy
// IEquipmentHandlerService equipmentHandlerService;
@Override
public
void
onApplicationEvent
(
ContingencyEvent
event
)
{
ruleRunningSnapshotService
.
reacordPlan
(
event
.
getTopic
(),
event
.
getMsgType
(),
event
.
getMsgBody
(),
event
.
getContingency
());
//
IE
quipmentHandlerService.subscribeTopic();
//
e
quipmentHandlerService.subscribeTopic();
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/SafetyController.java
View file @
ab9131bb
...
...
@@ -44,7 +44,7 @@ public class SafetyController extends BaseController{
@PostMapping
(
value
=
"/save/curCompany"
)
public
CommonResponse
saveCurCompany
(
@RequestBody
ReginParams
reginParams
)
{
this
.
saveSelectedOrgInfo
(
reginParams
);
equipmentHandlerService
.
subscribeTopic
(
reginParams
);
equipmentHandlerService
.
subscribeTopic
();
return
CommonResponseUtil
.
success
();
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/HandlerMqttMessageImpl.java
View file @
ab9131bb
...
...
@@ -199,31 +199,31 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
}
@Override
public
void
subscribeTopic
(
ReginParams
reginParams
)
{
// 若登录系统则订阅装备数据
webMqttSubscribe
.
adapter
.
removeTopic
(
defaultTopic
);
String
orgCode
=
reginParams
.
getCompany
().
getOrgCode
();
String
topic
=
String
.
format
(
"%s.%s%s"
,
serverName
,
"equipment"
,
"/#"
);
String
[]
strs
=
webMqttSubscribe
.
adapter
.
getTopic
();
List
<
String
>
list
=
Stream
.
of
(
strs
).
collect
(
Collectors
.
toList
());
if
(
list
.
size
()
>
0
)
{
list
.
forEach
(
x
->
{
if
(!(
x
.
equals
(
topic
)))
{
webMqttSubscribe
.
adapter
.
addTopic
(
topic
);
}
});
}
else
{
webMqttSubscribe
.
adapter
.
addTopic
(
topic
);
}
}
//
@Override
//
public void subscribeTopic(ReginParams reginParams) {
//
// 若登录系统则订阅装备数据
//
webMqttSubscribe.adapter.removeTopic(defaultTopic);
//
String orgCode = reginParams.getCompany().getOrgCode();
//
String topic = String.format("%s.%s%s", serverName, "equipment", "/#");
//
String[] strs = webMqttSubscribe.adapter.getTopic();
//
List<String> list = Stream.of(strs).collect(Collectors.toList());
//
if(list.size() > 0) {
//
list.forEach(x -> {
//
if(!(x.equals(topic))) {
//
webMqttSubscribe.adapter.addTopic(topic);
//
}
//
});
//
} else {
//
webMqttSubscribe.adapter.addTopic(topic);
//
}
//
//
}
@Override
public
void
subscribeTopic
()
{
// 若登录系统则订阅装备数据
webMqttSubscribe
.
adapter
.
removeTopic
(
defaultTopic
);
String
topic
=
String
.
format
(
"%s.%s
,
%s"
,
serverName
,
"equipment"
,
"/#"
);
String
topic
=
String
.
format
(
"%s.%s%s"
,
serverName
,
"equipment"
,
"/#"
);
String
[]
strs
=
webMqttSubscribe
.
adapter
.
getTopic
();
List
<
String
>
list
=
Stream
.
of
(
strs
).
collect
(
Collectors
.
toList
());
if
(
list
.
size
()
>
0
)
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IEquipmentHandlerService.java
View file @
ab9131bb
...
...
@@ -13,7 +13,7 @@ import com.yeejoin.amos.fas.business.vo.ReginParams;
public
interface
IEquipmentHandlerService
{
void
handlerMqttMessage
(
String
topic
,
String
message
);
void
subscribeTopic
(
ReginParams
reginParams
);
//
void subscribeTopic(ReginParams reginParams);
void
subscribeTopic
();
}
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