Commit 2220f0b4 authored by KeYong's avatar KeYong

改为启动订阅

parent 32a014fc
...@@ -15,14 +15,9 @@ public class ContingencyLogListener implements ApplicationListener<ContingencyEv ...@@ -15,14 +15,9 @@ public class ContingencyLogListener implements ApplicationListener<ContingencyEv
@Autowired @Autowired
IRuleRunningSnapshotService ruleRunningSnapshotService; IRuleRunningSnapshotService ruleRunningSnapshotService;
// @Autowired
// @Lazy
// IEquipmentHandlerService equipmentHandlerService;
@Override @Override
public void onApplicationEvent(ContingencyEvent event) { public void onApplicationEvent(ContingencyEvent event) {
ruleRunningSnapshotService.reacordPlan(event.getTopic(), event.getMsgType(), event.getMsgBody(), event.getContingency()); ruleRunningSnapshotService.reacordPlan(event.getTopic(), event.getMsgType(), event.getMsgBody(), event.getContingency());
// equipmentHandlerService.subscribeTopic();
} }
} }
...@@ -44,7 +44,6 @@ public class SafetyController extends BaseController{ ...@@ -44,7 +44,6 @@ public class SafetyController extends BaseController{
@PostMapping(value = "/save/curCompany") @PostMapping(value = "/save/curCompany")
public CommonResponse saveCurCompany(@RequestBody ReginParams reginParams) { public CommonResponse saveCurCompany(@RequestBody ReginParams reginParams) {
this.saveSelectedOrgInfo(reginParams); this.saveSelectedOrgInfo(reginParams);
equipmentHandlerService.subscribeTopic();
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} }
......
package com.yeejoin.amos.fas.config;
import com.yeejoin.amos.fas.business.service.intfc.IEquipmentHandlerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
/**
* @author keyong
* @title: ApplicationRunnerImpl
* <pre>
* @description: TODO
* </pre>
* @date 2020/12/12 20:18
*/
@Component
public class ApplicationRunnerImpl implements ApplicationRunner {
@Autowired
IEquipmentHandlerService equipmentHandlerService;
@Override
public void run(ApplicationArguments args) throws Exception {
equipmentHandlerService.subscribeTopic();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment