拓扑图数据展示
This commit is contained in:
@@ -95,233 +95,216 @@ public class MqttMessageHandler {
|
|||||||
/**
|
/**
|
||||||
* 实时数据应答
|
* 实时数据应答
|
||||||
*/
|
*/
|
||||||
@MqttSubscribe(value = "/zl/askDevData/{devId}",qos = 1)
|
// @MqttSubscribe(value = "/zl/askDevData/{devId}",qos = 1)
|
||||||
public void responseTopoData(String topic, @NamedValue("devId") String devId, MqttMessage message, @Payload String payload) {
|
// public void responseTopoData(String topic, @NamedValue("devId") String devId, MqttMessage message, @Payload String payload) {
|
||||||
String topoDataJson =redisUtil.getStringByKey (devId);
|
// String topoDataJson =redisUtil.getStringByKey (devId);
|
||||||
if(StringUtils.isEmpty(topoDataJson)){
|
// if(StringUtils.isEmpty(topoDataJson)){
|
||||||
List<ThdDataVO> result = new ArrayList<>();
|
// List<ThdDataVO> result = new ArrayList<>();
|
||||||
List<ThdDataVO> tempList = new ArrayList<>();
|
// List<ThdDataVO> tempList = new ArrayList<>();
|
||||||
|
//
|
||||||
|
// //1.查询拓扑图配置的指标:拓扑图扑图配置:7677f94c749dedaff30f911949cbd724
|
||||||
|
// List<EleEpdPqd> data = csStatisticalSetFeignClient.queryStatisticalSelect("b934664f9592d1c5e92caa90695b7103").getData();
|
||||||
|
// data.forEach(temp->{
|
||||||
|
// if(Objects.nonNull(temp.getHarmStart())&&Objects.nonNull(temp.getHarmEnd())){
|
||||||
|
// FrequencyStatisticalQueryParam frequencyStatisticalQueryParam = new FrequencyStatisticalQueryParam();
|
||||||
|
// frequencyStatisticalQueryParam.setDevId(devId);
|
||||||
|
// frequencyStatisticalQueryParam.setStatisticalId(temp.getId());
|
||||||
|
// frequencyStatisticalQueryParam.setValueType("avg");
|
||||||
|
// frequencyStatisticalQueryParam.setFrequencyStart(temp.getHarmStart());
|
||||||
|
// frequencyStatisticalQueryParam.setFrequencyEnd(temp.getHarmEnd());
|
||||||
|
// List<ThdDataVO> thdDataVOList = stableDataService.QuerySqlData(frequencyStatisticalQueryParam);
|
||||||
|
// tempList.addAll(thdDataVOList);
|
||||||
|
//
|
||||||
|
// }else {
|
||||||
|
// CommonStatisticalQueryParam commonStatisticalQueryParam = new CommonStatisticalQueryParam();
|
||||||
|
// commonStatisticalQueryParam.setDevId(devId);
|
||||||
|
// commonStatisticalQueryParam.setStatisticalId(temp.getId());
|
||||||
|
// commonStatisticalQueryParam.setValueType("avg");
|
||||||
|
// List<ThdDataVO> listFuture= stableDataService.queryFisrtCommonStatistical(commonStatisticalQueryParam);
|
||||||
|
// tempList.addAll(listFuture);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// });
|
||||||
|
// //过滤M相
|
||||||
|
// List<ThdDataVO> m = tempList.stream().filter(temp -> Objects.equals(temp.getPhase(), "M")).collect(Collectors.toList());
|
||||||
|
// m.stream().forEach(temp->{
|
||||||
|
// Stream.of("A","B","C").forEach(phase->{
|
||||||
|
// ThdDataVO thdDataVO = new ThdDataVO();
|
||||||
|
// BeanUtils.copyProperties(temp,thdDataVO);
|
||||||
|
// thdDataVO.setPhase(phase);
|
||||||
|
// result.add(thdDataVO);
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// List<ThdDataVO> apfThdI = tempList.stream().filter(temp -> Objects.equals(temp.getStatisticalName(), "Apf_ThdA_Load(%)")).collect(Collectors.toList());
|
||||||
|
// Map<String, List<ThdDataVO>> collect3 = apfThdI.stream().collect(Collectors.groupingBy(ThdDataVO::getLineId));
|
||||||
|
// collect3.forEach((k,v)->{
|
||||||
|
// if(!CollectionUtil.isEmpty(v)){
|
||||||
|
// double asDouble = v.stream().mapToDouble(ThdDataVO::getStatisticalData).average().getAsDouble();
|
||||||
|
// ThdDataVO thdDataVO = new ThdDataVO();
|
||||||
|
// BeanUtils.copyProperties(v.get(0),thdDataVO);
|
||||||
|
// thdDataVO.setStatisticalData(Double.valueOf(df.format(asDouble)));
|
||||||
|
// thdDataVO.setPhase("avg");
|
||||||
|
// result.add(thdDataVO);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// List<ThdDataVO> apfRmsI = tempList.stream().filter(temp -> Objects.equals(temp.getStatisticalName(), "Apf_RmsI_TolOut(A)")).collect(Collectors.toList());
|
||||||
|
// Map<String, List<ThdDataVO>> collect2 = apfRmsI.stream().collect(Collectors.groupingBy(ThdDataVO::getLineId));
|
||||||
|
// collect2.forEach((k,v)->{
|
||||||
|
// if(!CollectionUtil.isEmpty(v)){
|
||||||
|
// double asDouble = v.stream().mapToDouble(ThdDataVO::getStatisticalData).average().getAsDouble();
|
||||||
|
// ThdDataVO thdDataVO = new ThdDataVO();
|
||||||
|
// BeanUtils.copyProperties(v.get(0),thdDataVO);
|
||||||
|
// thdDataVO.setStatisticalData(Double.valueOf(df.format(asDouble)));
|
||||||
|
// thdDataVO.setPhase("avg");
|
||||||
|
// result.add(thdDataVO);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// List<ThdDataVO> apfThdISys = tempList.stream().filter(temp -> Objects.equals(temp.getStatisticalName(), "Apf_ThdA_Sys(%)")).collect(Collectors.toList());
|
||||||
|
// Map<String, List<ThdDataVO>> collect4 = apfThdISys.stream().collect(Collectors.groupingBy(ThdDataVO::getLineId));
|
||||||
|
// collect4.forEach((k,v)->{
|
||||||
|
// if(!CollectionUtil.isEmpty(v)){
|
||||||
|
// double asDouble = v.stream().mapToDouble(ThdDataVO::getStatisticalData).average().getAsDouble();
|
||||||
|
// ThdDataVO thdDataVO = new ThdDataVO();
|
||||||
|
// BeanUtils.copyProperties(v.get(0),thdDataVO);
|
||||||
|
// thdDataVO.setStatisticalData(Double.valueOf(df.format(asDouble)));
|
||||||
|
// thdDataVO.setPhase("avg");
|
||||||
|
// result.add(thdDataVO);
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// Double capacity = devCapacityFeignClient.getDevCapacity(devId).getData();
|
||||||
|
// apfRmsI.forEach(temp->{
|
||||||
|
// ThdDataVO thdDataVO = new ThdDataVO();
|
||||||
|
// BeanUtils.copyProperties(temp,thdDataVO);
|
||||||
|
// thdDataVO.setUnit("%");
|
||||||
|
// thdDataVO.setStatisticalName("load_Rate");
|
||||||
|
// thdDataVO.setAnotherName("负载率");
|
||||||
|
// if (capacity<=0){
|
||||||
|
// thdDataVO.setStatisticalData(3.1415926);
|
||||||
|
// }else {
|
||||||
|
// double v = temp.getStatisticalData()*100 / capacity;
|
||||||
|
// thdDataVO.setStatisticalData(Double.valueOf(df.format(v)));
|
||||||
|
// }
|
||||||
|
// result.add(thdDataVO);
|
||||||
|
// });
|
||||||
|
// List<ThdDataVO> notM = tempList.stream().filter(temp -> !Objects.equals(temp.getPhase(), "M")).collect(Collectors.toList());
|
||||||
|
// result.addAll(notM);
|
||||||
|
// Gson gson = new Gson();
|
||||||
|
// topoDataJson = gson.toJson(result);
|
||||||
|
// redisUtil.saveByKeyWithExpire(devId, (Object) topoDataJson, 30L);
|
||||||
|
// }
|
||||||
|
// publisher.send("/zl/devData/"+devId,topoDataJson,1,false);
|
||||||
|
// }
|
||||||
|
/**
|
||||||
|
* 实时数据应答
|
||||||
|
*/
|
||||||
|
@MqttSubscribe(value = "/zl/askDevData/{devId}/{typeId}",qos = 1)
|
||||||
|
public void responseTopoDataByType(String topic, @NamedValue("devId") String devId,@NamedValue("typeId") String typeId, MqttMessage message, @Payload String payload) {
|
||||||
|
String topoDataJson =redisUtil.getStringByKey (devId+"#"+typeId);
|
||||||
|
if(StringUtils.isEmpty(topoDataJson)){
|
||||||
|
List<ThdDataVO> result = new ArrayList<>();
|
||||||
|
List<ThdDataVO> tempList = new ArrayList<>();
|
||||||
|
|
||||||
//1.查询拓扑图配置的指标:拓扑图扑图配置:7677f94c749dedaff30f911949cbd724
|
//1.查询拓扑图配置的指标:拓扑图扑图配置:7677f94c749dedaff30f911949cbd724
|
||||||
List<EleEpdPqd> data = csStatisticalSetFeignClient.queryStatisticalSelect("b934664f9592d1c5e92caa90695b7103").getData();
|
List<EleEpdPqd> data = csStatisticalSetFeignClient.queryStatisticalSelect(typeId).getData();
|
||||||
data.forEach(temp->{
|
data.forEach(temp->{
|
||||||
if(Objects.nonNull(temp.getHarmStart())&&Objects.nonNull(temp.getHarmEnd())){
|
if(Objects.nonNull(temp.getHarmStart())&&Objects.nonNull(temp.getHarmEnd())){
|
||||||
FrequencyStatisticalQueryParam frequencyStatisticalQueryParam = new FrequencyStatisticalQueryParam();
|
FrequencyStatisticalQueryParam frequencyStatisticalQueryParam = new FrequencyStatisticalQueryParam();
|
||||||
frequencyStatisticalQueryParam.setDevId(devId);
|
frequencyStatisticalQueryParam.setDevId(devId);
|
||||||
frequencyStatisticalQueryParam.setStatisticalId(temp.getId());
|
frequencyStatisticalQueryParam.setStatisticalId(temp.getId());
|
||||||
frequencyStatisticalQueryParam.setValueType("avg");
|
frequencyStatisticalQueryParam.setValueType("avg");
|
||||||
frequencyStatisticalQueryParam.setFrequencyStart(temp.getHarmStart());
|
frequencyStatisticalQueryParam.setFrequencyStart(temp.getHarmStart());
|
||||||
frequencyStatisticalQueryParam.setFrequencyEnd(temp.getHarmEnd());
|
frequencyStatisticalQueryParam.setFrequencyEnd(temp.getHarmEnd());
|
||||||
List<ThdDataVO> thdDataVOList = stableDataService.QuerySqlData(frequencyStatisticalQueryParam);
|
List<ThdDataVO> thdDataVOList = stableDataService.QuerySqlData(frequencyStatisticalQueryParam);
|
||||||
tempList.addAll(thdDataVOList);
|
tempList.addAll(thdDataVOList);
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
CommonStatisticalQueryParam commonStatisticalQueryParam = new CommonStatisticalQueryParam();
|
CommonStatisticalQueryParam commonStatisticalQueryParam = new CommonStatisticalQueryParam();
|
||||||
commonStatisticalQueryParam.setDevId(devId);
|
commonStatisticalQueryParam.setDevId(devId);
|
||||||
commonStatisticalQueryParam.setStatisticalId(temp.getId());
|
commonStatisticalQueryParam.setStatisticalId(temp.getId());
|
||||||
commonStatisticalQueryParam.setValueType("avg");
|
commonStatisticalQueryParam.setValueType("avg");
|
||||||
List<ThdDataVO> listFuture= stableDataService.queryFisrtCommonStatistical(commonStatisticalQueryParam);
|
List<ThdDataVO> listFuture= stableDataService.queryFisrtCommonStatistical(commonStatisticalQueryParam);
|
||||||
tempList.addAll(listFuture);
|
tempList.addAll(listFuture);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
//过滤M相
|
|
||||||
List<ThdDataVO> m = tempList.stream().filter(temp -> Objects.equals(temp.getPhase(), "M")).collect(Collectors.toList());
|
|
||||||
m.stream().forEach(temp->{
|
|
||||||
Stream.of("A","B","C").forEach(phase->{
|
|
||||||
ThdDataVO thdDataVO = new ThdDataVO();
|
|
||||||
BeanUtils.copyProperties(temp,thdDataVO);
|
|
||||||
thdDataVO.setPhase(phase);
|
|
||||||
result.add(thdDataVO);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
List<ThdDataVO> apfThdI = tempList.stream().filter(temp -> Objects.equals(temp.getStatisticalName(), "Apf_ThdA_Load(%)")).collect(Collectors.toList());
|
|
||||||
Map<String, List<ThdDataVO>> collect3 = apfThdI.stream().collect(Collectors.groupingBy(ThdDataVO::getLineId));
|
|
||||||
collect3.forEach((k,v)->{
|
|
||||||
if(!CollectionUtil.isEmpty(v)){
|
|
||||||
double asDouble = v.stream().mapToDouble(ThdDataVO::getStatisticalData).average().getAsDouble();
|
|
||||||
ThdDataVO thdDataVO = new ThdDataVO();
|
|
||||||
BeanUtils.copyProperties(v.get(0),thdDataVO);
|
|
||||||
thdDataVO.setStatisticalData(Double.valueOf(df.format(asDouble)));
|
|
||||||
thdDataVO.setPhase("avg");
|
|
||||||
result.add(thdDataVO);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
List<ThdDataVO> apfRmsI = tempList.stream().filter(temp -> Objects.equals(temp.getStatisticalName(), "Apf_RmsI_TolOut(A)")).collect(Collectors.toList());
|
|
||||||
Map<String, List<ThdDataVO>> collect2 = apfRmsI.stream().collect(Collectors.groupingBy(ThdDataVO::getLineId));
|
|
||||||
collect2.forEach((k,v)->{
|
|
||||||
if(!CollectionUtil.isEmpty(v)){
|
|
||||||
double asDouble = v.stream().mapToDouble(ThdDataVO::getStatisticalData).average().getAsDouble();
|
|
||||||
ThdDataVO thdDataVO = new ThdDataVO();
|
|
||||||
BeanUtils.copyProperties(v.get(0),thdDataVO);
|
|
||||||
thdDataVO.setStatisticalData(Double.valueOf(df.format(asDouble)));
|
|
||||||
thdDataVO.setPhase("avg");
|
|
||||||
result.add(thdDataVO);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
List<ThdDataVO> apfThdISys = tempList.stream().filter(temp -> Objects.equals(temp.getStatisticalName(), "Apf_ThdA_Sys(%)")).collect(Collectors.toList());
|
|
||||||
Map<String, List<ThdDataVO>> collect4 = apfThdISys.stream().collect(Collectors.groupingBy(ThdDataVO::getLineId));
|
|
||||||
collect4.forEach((k,v)->{
|
|
||||||
if(!CollectionUtil.isEmpty(v)){
|
|
||||||
double asDouble = v.stream().mapToDouble(ThdDataVO::getStatisticalData).average().getAsDouble();
|
|
||||||
ThdDataVO thdDataVO = new ThdDataVO();
|
|
||||||
BeanUtils.copyProperties(v.get(0),thdDataVO);
|
|
||||||
thdDataVO.setStatisticalData(Double.valueOf(df.format(asDouble)));
|
|
||||||
thdDataVO.setPhase("avg");
|
|
||||||
result.add(thdDataVO);
|
|
||||||
|
|
||||||
}
|
//过滤M相
|
||||||
});
|
List<ThdDataVO> m = tempList.stream().filter(temp -> Objects.equals(temp.getPhase(), "M")).collect(Collectors.toList());
|
||||||
Double capacity = devCapacityFeignClient.getDevCapacity(devId).getData();
|
m.stream().forEach(temp->{
|
||||||
apfRmsI.forEach(temp->{
|
Stream.of("A","B","C").forEach(phase->{
|
||||||
ThdDataVO thdDataVO = new ThdDataVO();
|
ThdDataVO thdDataVO = new ThdDataVO();
|
||||||
BeanUtils.copyProperties(temp,thdDataVO);
|
BeanUtils.copyProperties(temp,thdDataVO);
|
||||||
thdDataVO.setUnit("%");
|
thdDataVO.setPhase(phase);
|
||||||
thdDataVO.setStatisticalName("load_Rate");
|
result.add(thdDataVO);
|
||||||
thdDataVO.setAnotherName("负载率");
|
});
|
||||||
if (capacity<=0){
|
});
|
||||||
thdDataVO.setStatisticalData(3.1415926);
|
//如果是基础数据则添加拓扑图的数据
|
||||||
}else {
|
if(Objects.equals("fc8c86dbc3f2d9810f5cd8f53c295415",typeId)){
|
||||||
double v = temp.getStatisticalData()*100 / capacity;
|
List<ThdDataVO> apfThdI = tempList.stream().filter(temp -> Objects.equals(temp.getStatisticalName(), "Apf_ThdA_Load(%)")).collect(Collectors.toList());
|
||||||
thdDataVO.setStatisticalData(Double.valueOf(df.format(v)));
|
Map<String, List<ThdDataVO>> collect3 = apfThdI.stream().collect(Collectors.groupingBy(ThdDataVO::getLineId));
|
||||||
}
|
collect3.forEach((k,v)->{
|
||||||
result.add(thdDataVO);
|
if(!CollectionUtil.isEmpty(v)){
|
||||||
});
|
double asDouble = v.stream().mapToDouble(ThdDataVO::getStatisticalData).average().getAsDouble();
|
||||||
List<ThdDataVO> notM = tempList.stream().filter(temp -> !Objects.equals(temp.getPhase(), "M")).collect(Collectors.toList());
|
ThdDataVO thdDataVO = new ThdDataVO();
|
||||||
result.addAll(notM);
|
BeanUtils.copyProperties(v.get(0),thdDataVO);
|
||||||
Gson gson = new Gson();
|
thdDataVO.setStatisticalData(Double.valueOf(df.format(asDouble)));
|
||||||
topoDataJson = gson.toJson(result);
|
thdDataVO.setPhase("avg");
|
||||||
redisUtil.saveByKeyWithExpire(devId, (Object) topoDataJson, 30L);
|
result.add(thdDataVO);
|
||||||
}
|
}
|
||||||
publisher.send("/zl/devData/"+devId,topoDataJson,1,false);
|
});
|
||||||
|
List<ThdDataVO> apfRmsI = tempList.stream().filter(temp -> Objects.equals(temp.getStatisticalName(), "Apf_RmsI_TolOut(A)")).collect(Collectors.toList());
|
||||||
|
Map<String, List<ThdDataVO>> collect2 = apfRmsI.stream().collect(Collectors.groupingBy(ThdDataVO::getLineId));
|
||||||
|
collect2.forEach((k,v)->{
|
||||||
|
if(!CollectionUtil.isEmpty(v)){
|
||||||
|
double asDouble = v.stream().mapToDouble(ThdDataVO::getStatisticalData).average().getAsDouble();
|
||||||
|
ThdDataVO thdDataVO = new ThdDataVO();
|
||||||
|
BeanUtils.copyProperties(v.get(0),thdDataVO);
|
||||||
|
thdDataVO.setStatisticalData(Double.valueOf(df.format(asDouble)));
|
||||||
|
thdDataVO.setPhase("avg");
|
||||||
|
result.add(thdDataVO);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
List<ThdDataVO> apfThdISys = tempList.stream().filter(temp -> Objects.equals(temp.getStatisticalName(), "Apf_ThdA_Sys(%)")).collect(Collectors.toList());
|
||||||
|
Map<String, List<ThdDataVO>> collect4 = apfThdISys.stream().collect(Collectors.groupingBy(ThdDataVO::getLineId));
|
||||||
|
collect4.forEach((k,v)->{
|
||||||
|
if(!CollectionUtil.isEmpty(v)){
|
||||||
|
double asDouble = v.stream().mapToDouble(ThdDataVO::getStatisticalData).average().getAsDouble();
|
||||||
|
ThdDataVO thdDataVO = new ThdDataVO();
|
||||||
|
BeanUtils.copyProperties(v.get(0),thdDataVO);
|
||||||
|
thdDataVO.setStatisticalData(Double.valueOf(df.format(asDouble)));
|
||||||
|
thdDataVO.setPhase("avg");
|
||||||
|
result.add(thdDataVO);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Double capacity = devCapacityFeignClient.getDevCapacity(devId).getData();
|
||||||
|
apfRmsI.forEach(temp->{
|
||||||
|
ThdDataVO thdDataVO = new ThdDataVO();
|
||||||
|
BeanUtils.copyProperties(temp,thdDataVO);
|
||||||
|
thdDataVO.setUnit("%");
|
||||||
|
thdDataVO.setStatisticalName("load_Rate");
|
||||||
|
thdDataVO.setAnotherName("负载率");
|
||||||
|
if (capacity<=0){
|
||||||
|
thdDataVO.setStatisticalData(3.1415926);
|
||||||
|
}else {
|
||||||
|
double v = temp.getStatisticalData()*100 / capacity;
|
||||||
|
thdDataVO.setStatisticalData(Double.valueOf(df.format(v)));
|
||||||
|
}
|
||||||
|
result.add(thdDataVO);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ThdDataVO> notM = tempList.stream().filter(temp -> !Objects.equals(temp.getPhase(), "M")).collect(Collectors.toList());
|
||||||
|
result.addAll(notM);
|
||||||
|
Gson gson = new Gson();
|
||||||
|
topoDataJson = gson.toJson(result);
|
||||||
|
redisUtil.saveByKeyWithExpire(devId+"#"+typeId, (Object) topoDataJson, 30L);
|
||||||
|
}
|
||||||
|
publisher.send("/zl/devData/"+devId+"/"+typeId,topoDataJson,1,false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @MqttSubscribe(value = "/zl/askDvrData/{devId}",qos = 1)
|
|
||||||
// public void responseDvrData(String topic, @NamedValue("devId") String devId, MqttMessage message, @Payload String payload) {
|
|
||||||
// String topoDataJson =redisUtil.getStringByKey (devId+"DVR");
|
|
||||||
// if(StringUtils.isEmpty(topoDataJson)){
|
|
||||||
// List<ThdDataVO> result = new ArrayList<>();
|
|
||||||
// List<ThdDataVO> tempList = new ArrayList<>();
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// //1.查询DVR配置的指标:DVR配置:9fc1de386b623a1339977e168a23ad97
|
|
||||||
// List<EleEpdPqd> data = csStatisticalSetFeignClient.queryStatisticalSelect("9fc1de386b623a1339977e168a23ad97").getData();
|
|
||||||
// data.forEach(temp->{
|
|
||||||
// if(Objects.nonNull(temp.getHarmStart())&&Objects.nonNull(temp.getHarmEnd())){
|
|
||||||
//
|
|
||||||
// FrequencyStatisticalQueryParam frequencyStatisticalQueryParam = new FrequencyStatisticalQueryParam();
|
|
||||||
// frequencyStatisticalQueryParam.setDevId(devId);
|
|
||||||
// frequencyStatisticalQueryParam.setStatisticalId(temp.getId());
|
|
||||||
// frequencyStatisticalQueryParam.setValueType("avg");
|
|
||||||
// frequencyStatisticalQueryParam.setFrequencyStart(temp.getHarmStart());
|
|
||||||
// frequencyStatisticalQueryParam.setFrequencyEnd(temp.getHarmEnd());
|
|
||||||
// List<ThdDataVO> thdDataVOList = stableDataService.QuerySqlData(frequencyStatisticalQueryParam);
|
|
||||||
// tempList.addAll(thdDataVOList);
|
|
||||||
//
|
|
||||||
// }else {
|
|
||||||
// CommonStatisticalQueryParam commonStatisticalQueryParam = new CommonStatisticalQueryParam();
|
|
||||||
// commonStatisticalQueryParam.setDevId(devId);
|
|
||||||
// commonStatisticalQueryParam.setStatisticalId(temp.getId());
|
|
||||||
// commonStatisticalQueryParam.setValueType("avg");
|
|
||||||
// List<ThdDataVO> listFuture= stableDataService.queryFisrtCommonStatistical(commonStatisticalQueryParam);
|
|
||||||
// tempList.addAll(listFuture);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// //过滤M相
|
|
||||||
//// List<ThdDataVO> m = tempList.stream().filter(temp -> Objects.equals(temp.getPhase(), "M")).collect(Collectors.toList());
|
|
||||||
//// m.stream().forEach(temp->{
|
|
||||||
//// Stream.of("A","B","C").forEach(phase->{
|
|
||||||
//// ThdDataVO thdDataVO = new ThdDataVO();
|
|
||||||
//// BeanUtils.copyProperties(temp,thdDataVO);
|
|
||||||
//// thdDataVO.setPhase(phase);
|
|
||||||
//// result.add(thdDataVO);
|
|
||||||
//// });
|
|
||||||
//// });
|
|
||||||
//// //过滤谐波电流,谐波电压畸变率求平均值
|
|
||||||
//// List<ThdDataVO> thdI = tempList.stream().filter(temp -> Objects.equals(temp.getStatisticalName(), "Pq_ThdU(%)")).collect(Collectors.toList());
|
|
||||||
//// Map<String, List<ThdDataVO>> collect = thdI.stream().collect(Collectors.groupingBy(ThdDataVO::getLineId));
|
|
||||||
//// collect.forEach((k,v)->{
|
|
||||||
//// if(!CollectionUtil.isEmpty(v)){
|
|
||||||
//// double asDouble = v.stream().mapToDouble(ThdDataVO::getStatisticalData).average().getAsDouble();
|
|
||||||
//// ThdDataVO thdDataVO = new ThdDataVO();
|
|
||||||
//// BeanUtils.copyProperties(v.get(0),thdDataVO);
|
|
||||||
//// thdDataVO.setStatisticalData(Double.valueOf(df.format(asDouble)));
|
|
||||||
//// thdDataVO.setPhase("avg");
|
|
||||||
//// result.add(thdDataVO);
|
|
||||||
////
|
|
||||||
//// }
|
|
||||||
//// });
|
|
||||||
////
|
|
||||||
//// List<ThdDataVO> thdV = tempList.stream().filter(temp -> Objects.equals(temp.getStatisticalName(), "Pq_ThdI(%)")).collect(Collectors.toList());
|
|
||||||
//// Map<String, List<ThdDataVO>> collect1 = thdV.stream().collect(Collectors.groupingBy(ThdDataVO::getLineId));
|
|
||||||
//// collect1.forEach((k,v)->{
|
|
||||||
//// if(!CollectionUtil.isEmpty(v)){
|
|
||||||
//// double asDouble = v.stream().mapToDouble(ThdDataVO::getStatisticalData).average().getAsDouble();
|
|
||||||
//// ThdDataVO thdDataVO = new ThdDataVO();
|
|
||||||
//// BeanUtils.copyProperties(v.get(0),thdDataVO);
|
|
||||||
//// thdDataVO.setStatisticalData(Double.valueOf(df.format(asDouble)));
|
|
||||||
//// thdDataVO.setPhase("avg");
|
|
||||||
//// result.add(thdDataVO);
|
|
||||||
////
|
|
||||||
//// }
|
|
||||||
//// });
|
|
||||||
//// List<ThdDataVO> apfThdI = tempList.stream().filter(temp -> Objects.equals(temp.getStatisticalName(), "Apf_ThdA_Load(%)")).collect(Collectors.toList());
|
|
||||||
//// Map<String, List<ThdDataVO>> collect3 = apfThdI.stream().collect(Collectors.groupingBy(ThdDataVO::getLineId));
|
|
||||||
//// collect3.forEach((k,v)->{
|
|
||||||
//// if(!CollectionUtil.isEmpty(v)){
|
|
||||||
//// double asDouble = v.stream().mapToDouble(ThdDataVO::getStatisticalData).average().getAsDouble();
|
|
||||||
//// ThdDataVO thdDataVO = new ThdDataVO();
|
|
||||||
//// BeanUtils.copyProperties(v.get(0),thdDataVO);
|
|
||||||
//// thdDataVO.setStatisticalData(Double.valueOf(df.format(asDouble)));
|
|
||||||
//// thdDataVO.setPhase("avg");
|
|
||||||
//// result.add(thdDataVO);
|
|
||||||
////
|
|
||||||
//// }
|
|
||||||
//// });
|
|
||||||
//// List<ThdDataVO> apfRmsI = tempList.stream().filter(temp -> Objects.equals(temp.getStatisticalName(), "Apf_RmsI_TolOut(A)")).collect(Collectors.toList());
|
|
||||||
//// Map<String, List<ThdDataVO>> collect2 = apfRmsI.stream().collect(Collectors.groupingBy(ThdDataVO::getLineId));
|
|
||||||
//// collect2.forEach((k,v)->{
|
|
||||||
//// if(!CollectionUtil.isEmpty(v)){
|
|
||||||
//// double asDouble = v.stream().mapToDouble(ThdDataVO::getStatisticalData).average().getAsDouble();
|
|
||||||
//// ThdDataVO thdDataVO = new ThdDataVO();
|
|
||||||
//// BeanUtils.copyProperties(v.get(0),thdDataVO);
|
|
||||||
//// thdDataVO.setStatisticalData(Double.valueOf(df.format(asDouble)));
|
|
||||||
//// thdDataVO.setPhase("avg");
|
|
||||||
//// result.add(thdDataVO);
|
|
||||||
////
|
|
||||||
//// }
|
|
||||||
//// });
|
|
||||||
//// List<ThdDataVO> apfThdISys = tempList.stream().filter(temp -> Objects.equals(temp.getStatisticalName(), "Apf_ThdA_Sys(%)")).collect(Collectors.toList());
|
|
||||||
//// Map<String, List<ThdDataVO>> collect4 = apfThdISys.stream().collect(Collectors.groupingBy(ThdDataVO::getLineId));
|
|
||||||
//// collect4.forEach((k,v)->{
|
|
||||||
//// if(!CollectionUtil.isEmpty(v)){
|
|
||||||
//// double asDouble = v.stream().mapToDouble(ThdDataVO::getStatisticalData).average().getAsDouble();
|
|
||||||
//// ThdDataVO thdDataVO = new ThdDataVO();
|
|
||||||
//// BeanUtils.copyProperties(v.get(0),thdDataVO);
|
|
||||||
//// thdDataVO.setStatisticalData(Double.valueOf(df.format(asDouble)));
|
|
||||||
//// thdDataVO.setPhase("avg");
|
|
||||||
//// result.add(thdDataVO);
|
|
||||||
////
|
|
||||||
//// }
|
|
||||||
//// });
|
|
||||||
////
|
|
||||||
//// List<ThdDataVO> notM = tempList.stream().filter(temp -> !Objects.equals(temp.getPhase(), "M")).collect(Collectors.toList());
|
|
||||||
//
|
|
||||||
// result.addAll(tempList);
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Gson gson = new Gson();
|
|
||||||
// topoDataJson = gson.toJson(result);
|
|
||||||
// redisUtil.saveByKeyWithExpire(devId+"DVR", (Object) topoDataJson,Long.valueOf(10*60));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// publisher.send("/zl/DvrData/"+devId,topoDataJson,1,false);
|
|
||||||
// }
|
|
||||||
|
|
||||||
public String getCldidName( String cldid) {
|
public String getCldidName( String cldid) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user