fix: 调整61850告警统一配置

dev
huangfeng 3 months ago
parent ab85f75b45
commit 0807ca3441

@ -35,6 +35,7 @@ public class IEDCollectService {
BizConfig _bizConfig;
WarningRepository _warningRepository;
SpectrogramHandler _spectrogramHandler;
boolean _warning;
String folder = "/record";
HashMap<Integer, String> eqmidTimeMap = new HashMap<>();
@ -43,7 +44,7 @@ public class IEDCollectService {
IcdConfigTypeInstRepository instRepository, RptparamindexRepository rptparamindexRepository,
IedDlRecordService dlRecordService, DataService dataService,
String xml, IcdIed ied,
WebSocketServer webSocketServer, BizConfig bizConfig,
WebSocketServer webSocketServer, BizConfig bizConfig, boolean warning,
WarningRepository warningRepository, SpectrogramHandler spectrogramHandler) {
_configRepository = configRepository;
_attRepository = attRepository;
@ -55,6 +56,7 @@ public class IEDCollectService {
this.ied = ied;
_webSocketServer = webSocketServer;
_bizConfig = bizConfig;
_warning = warning;
_warningRepository = warningRepository;
_spectrogramHandler = spectrogramHandler;
iecClient = new IecClient();
@ -90,11 +92,13 @@ public class IEDCollectService {
String err = "61850采集数据异常, ied=" + ied.getName() + ", ip=" + ied.getIp() + ", port=" + ied.getPort()
+ ", " + ex.getMessage();
log.error(err, ex);
this.saveWarning(err);
String key = ied.getName() + ied.getIp() + ied.getPort();
if (!StaticVariable.doneWarnMap.containsKey(key)) {
StaticVariable.doneWarnMap.put(key, "1");
_webSocketServer.sendMessage(err, null);
if (_warning) {
this.saveWarning(err);
String key = ied.getName() + ied.getIp() + ied.getPort();
if (!StaticVariable.doneWarnMap.containsKey(key)) {
StaticVariable.doneWarnMap.put(key, "1");
_webSocketServer.sendMessage(err, null);
}
}
} finally {
iecClient.disconnect();

@ -40,8 +40,8 @@ public class IecClient implements ClientEventListener {
public IecClient() {
}
public IecClient(WebSocketServer _webSocketServer, boolean netwarn) {
if (netwarn) {
public IecClient(WebSocketServer _webSocketServer, boolean warning) {
if (warning) {
webSocketServer = _webSocketServer;
}
}

@ -22,8 +22,8 @@ import java.util.*;
@Service
@Slf4j
public class RealTimeDataService {
@Value("${cac.61850.netwarn:false}")
public boolean netwarn;
@Value("${cac.61850.warning:true}")
public boolean warning;
@Resource
IcdFileRepository fileRepository;
@Resource
@ -55,7 +55,7 @@ public class RealTimeDataService {
}
inDoing = true;
IcdFile icdFile = optionalFile.get();
IecClient iecClient = new IecClient(webSocketServer, netwarn);
IecClient iecClient = new IecClient(webSocketServer, warning);
try {
iecClient.init(ied, icdFile.getXml());
iecClient.keep = true;

@ -10,6 +10,7 @@ import com.xydl.cac.service.DataService;
import com.xydl.cac.service.IedDlRecordService;
import com.xydl.cac.socket.WebSocketServer;
import com.xydl.cac.spectrogram.SpectrogramHandler;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
@ -18,6 +19,8 @@ import java.util.List;
@Service
public class AsyncTask {
@Value("${cac.61850.warning:true}")
public boolean warning;
@Resource
IcdConfigTypeRepository configRepository;
@Resource
@ -45,7 +48,7 @@ public class AsyncTask {
instRepository, rptparamindexRepository,
dlRecordService, dataService,
xml, ied,
webSocketServer, bizConfig,
webSocketServer, bizConfig, warning,
warningRepository, spectrogramHandler);
iedService.collectAndSave(rptList, dlList);
}

@ -42,7 +42,7 @@ cac:
61850:
enable: false
check: false
netwarn: false
warning: true
i2:
enable: false
url: http://192.168.1.190:8080/busi-back-ws/service/XydlService

@ -42,7 +42,7 @@ cac:
61850:
enable: true
check: false
netwarn: false
warning: true
i2:
enable: false
url: http://192.168.1.190:8080/busi-back-ws/service/XydlService

Loading…
Cancel
Save