1.功能bug调整

2.算法添加部分指标异常数据判断
This commit is contained in:
xy
2024-05-21 14:01:31 +08:00
parent e2b84c275e
commit 2618f4cc33
7 changed files with 133 additions and 73 deletions

View File

@@ -3,6 +3,7 @@ package com.njcn.prepare.harmonic.service.mysql.Impl.line;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.util.ObjUtil;
import com.alibaba.nacos.client.naming.utils.CollectionUtils;
import com.njcn.common.utils.HarmonicTimesUtil;
import com.njcn.harmonic.pojo.po.day.*;
@@ -19,7 +20,6 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.ListUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@@ -113,7 +113,10 @@ public class DayDataServiceImpl implements DayDataService {
RStatDataVDPO po1 = new RStatDataVDPO();
BeanUtils.copyProperties(item, po1);
po1.setTime(LocalDate.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_FORMATTER));
//todo 此数据质量标记为influxdb查询得出,数据转换时未做数据异常判断,因前置那边未做判断,系统先做判断拦截,后期前置应该加判断
po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
//fixme 因现场数据异常,先处理频率偏差、电压偏差、电压总谐波畸变率、三相电压不平衡度、长时闪变异常数据拦截
po1.setQualityFlag(DataAnomalyDetectio(po1,null));
dataVPOList.add(po1);
DayV dayV = new DayV();
BeanUtils.copyProperties(item, dayV);
@@ -580,6 +583,7 @@ public class DayDataServiceImpl implements DayDataService {
BeanUtils.copyProperties(item, po1);
po1.setTime(LocalDate.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_FORMATTER));
po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
po1.setQualityFlag(DataAnomalyDetectio(null,po1));
dataPltPOList.add(po1);
DayPlt dayPlt = new DayPlt();
@@ -1864,4 +1868,23 @@ public class DayDataServiceImpl implements DayDataService {
result.addAll(result4);
return result;
}
public Integer DataAnomalyDetectio(RStatDataVDPO po1, RStatDataPltDPO po2) {
int result = 0;
if (ObjUtil.isNotNull(po1)) {
if (Math.abs(po1.getFreqDev()) > 7.5
|| Math.abs(po1.getVlDev()) > 20
|| Math.abs(po1.getVuDev()) > 20
|| po1.getVThd() > 30
|| po1.getVUnbalance() > 40) {
result = 1;
}
}
if (ObjUtil.isNotNull(po2)) {
if (po2.getPlt() > 20) {
result = 1;
}
}
return result;
}
}