|
|
|
@ -9,6 +9,7 @@ import com.xydl.cac.service.DataService;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
@ -22,6 +23,8 @@ public class IEDCollectService {
|
|
|
|
|
IcdIed ied;
|
|
|
|
|
String xml;
|
|
|
|
|
|
|
|
|
|
public static HashMap<Integer, HashMap<String, String>> lastDataMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
public IEDCollectService(IcdConfigTypeRepository configRepository, IcdConfigTypeAttRepository attRepository,
|
|
|
|
|
IcdConfigTypeInstRepository instRepository, RptparamindexRepository rptparamindexRepository,
|
|
|
|
|
DataService dataService, String xml, IcdIed ied) {
|
|
|
|
@ -89,6 +92,14 @@ public class IEDCollectService {
|
|
|
|
|
log.info("采集到" + fc + " " + paramindexNew + "=" + value + ", t=" + time);
|
|
|
|
|
time = time.replace("T", " ").replace("Z", "").replace("z", "");
|
|
|
|
|
_dataService.insertData(rpt.getTablename(), rpt.getEqmid(), time, rpt.getColname(), value);
|
|
|
|
|
|
|
|
|
|
HashMap<String, String> map = lastDataMap.get(rpt.getEqmid());
|
|
|
|
|
if (map == null) {
|
|
|
|
|
map = new HashMap<>();
|
|
|
|
|
lastDataMap.put(rpt.getEqmid(), map);
|
|
|
|
|
}
|
|
|
|
|
map.put(rpt.getColname(), value);
|
|
|
|
|
map.put("acquisitionTime", time);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Rptparamindex findRpt(List<Rptparamindex> rptList, String paramindex) {
|
|
|
|
|