|
|
|
@ -3,6 +3,7 @@ package com.xydl.cac.iec;
|
|
|
|
|
import com.beanit.iec61850bean.*;
|
|
|
|
|
import com.xydl.cac.entity.IcdTransform;
|
|
|
|
|
import com.xydl.cac.service.IcdTransformService;
|
|
|
|
|
import com.xydl.cac.service.impl.IcdTransformServiceImpl;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.io.IOUtils;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
@ -49,10 +50,13 @@ public class IecServer implements ServerEventListener {
|
|
|
|
|
public void updateBda(BasicDataAttribute bda) {
|
|
|
|
|
String ref = bda.getReference().toString();
|
|
|
|
|
List<IcdTransform> list = _transformService.listTransform();
|
|
|
|
|
String rptTo = "";
|
|
|
|
|
if (!CollectionUtils.isEmpty(list)) {
|
|
|
|
|
for (IcdTransform item : list) {
|
|
|
|
|
if (ref.startsWith(item.getRptFrom())) {
|
|
|
|
|
ref = ref.replace(item.getRptFrom(), item.getRptTo());
|
|
|
|
|
rptTo = item.getRptTo();
|
|
|
|
|
IcdTransformServiceImpl.rptFromActiveMap.put(item.getRptFrom(), "1");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -62,6 +66,7 @@ public class IecServer implements ServerEventListener {
|
|
|
|
|
node.setValueFrom(bda);
|
|
|
|
|
List<BasicDataAttribute> bdas = new ArrayList<>();
|
|
|
|
|
bdas.add(node);
|
|
|
|
|
IcdTransformServiceImpl.rptToActiveMap.put(rptTo, "1");
|
|
|
|
|
serverSap.setValues(bdas);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|