修改bug
This commit is contained in:
@@ -145,19 +145,19 @@ public class MqttMessageHandler {
|
||||
});
|
||||
});
|
||||
//过滤谐波电流,谐波电压畸变率求平均值
|
||||
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> 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));
|
||||
@@ -212,17 +212,16 @@ public class MqttMessageHandler {
|
||||
}
|
||||
});
|
||||
Double capacity = devCapacityFeignClient.getDevCapacity(devId).getData();
|
||||
//获取输出电流计算负载率
|
||||
List<ThdDataVO> iTolOut = tempList.stream().filter(temp -> Objects.equals(temp.getStatisticalName(), "Apf_RmsI_TolOut(A)")).collect(Collectors.toList());
|
||||
result.addAll(iTolOut);
|
||||
|
||||
iTolOut.forEach(temp->{
|
||||
|
||||
apfRmsI.forEach(temp->{
|
||||
ThdDataVO thdDataVO = new ThdDataVO();
|
||||
BeanUtils.copyProperties(temp,thdDataVO);
|
||||
temp.setUnit("%");
|
||||
temp.setStatisticalName("load_Rate");
|
||||
thdDataVO.setUnit("%");
|
||||
thdDataVO.setStatisticalName("load_Rate");
|
||||
thdDataVO.setAnotherName("负载率");
|
||||
if (capacity<=0){
|
||||
temp.setStatisticalData(3.1415926);
|
||||
thdDataVO.setStatisticalData(3.1415926);
|
||||
}else {
|
||||
double v = temp.getStatisticalData() / capacity;
|
||||
thdDataVO.setStatisticalData(Double.valueOf(df.format(v)));
|
||||
|
||||
Reference in New Issue
Block a user