正式检测系统加固
This commit is contained in:
@@ -1288,10 +1288,18 @@ public class SocketDevResponseService {
|
|||||||
if (devPhase > 180) {
|
if (devPhase > 180) {
|
||||||
phase = devPhase - 360;
|
phase = devPhase - 360;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Double fPhase = channelListDTO.getFPhase();
|
||||||
|
if (fPhase < -180) {
|
||||||
|
fPhase = fPhase + 360;
|
||||||
|
}
|
||||||
|
if (fPhase > 180) {
|
||||||
|
fPhase = fPhase - 360;
|
||||||
|
}
|
||||||
return
|
return
|
||||||
NumberUtil.isIn(BigDecimal.valueOf(phase),
|
NumberUtil.isIn(BigDecimal.valueOf(phase),
|
||||||
BigDecimal.valueOf(channelListDTO.getFPhase() - 1),
|
BigDecimal.valueOf(fPhase - 1),
|
||||||
BigDecimal.valueOf(channelListDTO.getFPhase() + 1));
|
BigDecimal.valueOf(fPhase + 1));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.njcn.gather.detection.pojo.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2025/2/12 10:15
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum DetectionCodeEnum {
|
||||||
|
|
||||||
|
U1("U1", "基波电压"),
|
||||||
|
V2_50("V2-50", "谐波电压"),
|
||||||
|
SV_1_49("SV_1-49", "间谐波电压"),
|
||||||
|
I1("I1", "基波电流"),
|
||||||
|
I2_50("I2-50", "谐波电流"),
|
||||||
|
SI_1_49("SI_1-49", "间谐波电压"),
|
||||||
|
P2_50("P2-50", "谐波有功功率"),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
private final String code;
|
||||||
|
private final String message;
|
||||||
|
|
||||||
|
DetectionCodeEnum(String code, String message) {
|
||||||
|
this.code = code;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
|
import com.njcn.gather.detection.pojo.enums.DetectionCodeEnum;
|
||||||
import com.njcn.gather.detection.pojo.param.PreDetectionParam;
|
import com.njcn.gather.detection.pojo.param.PreDetectionParam;
|
||||||
import com.njcn.gather.detection.pojo.po.DevData;
|
import com.njcn.gather.detection.pojo.po.DevData;
|
||||||
import com.njcn.gather.detection.pojo.vo.DetectionData;
|
import com.njcn.gather.detection.pojo.vo.DetectionData;
|
||||||
@@ -112,57 +113,81 @@ public class DetectionServiceImpl {
|
|||||||
*/
|
*/
|
||||||
case HV:
|
case HV:
|
||||||
AdHarmonicResult harmV = isHarmQualified(dev, devIdMapComm, errDtlsCheckData, U, sourceIssue, dataRule, 2);
|
AdHarmonicResult harmV = isHarmQualified(dev, devIdMapComm, errDtlsCheckData, U, sourceIssue, dataRule, 2);
|
||||||
|
if (ObjectUtil.isNull(harmV)) {
|
||||||
detectionDataDealService.acceptAdResult(Arrays.asList(harmV), code);
|
detectionDataDealService.acceptAdResult(Arrays.asList(harmV), code);
|
||||||
return harmV.getResultFlag();
|
return harmV.getResultFlag();
|
||||||
|
}
|
||||||
|
return 4;
|
||||||
/**
|
/**
|
||||||
* 谐波电流
|
* 谐波电流
|
||||||
*/
|
*/
|
||||||
case HI:
|
case HI:
|
||||||
AdHarmonicResult harmI = isHarmQualified(dev, devIdMapComm, errDtlsCheckData, I, sourceIssue, dataRule, 2);
|
AdHarmonicResult harmI = isHarmQualified(dev, devIdMapComm, errDtlsCheckData, I, sourceIssue, dataRule, 2);
|
||||||
|
if (ObjectUtil.isNull(harmI)) {
|
||||||
detectionDataDealService.acceptAdResult(Arrays.asList(harmI), code);
|
detectionDataDealService.acceptAdResult(Arrays.asList(harmI), code);
|
||||||
return harmI.getResultFlag();
|
return harmI.getResultFlag();
|
||||||
|
}
|
||||||
|
return 4;
|
||||||
/**
|
/**
|
||||||
* 间谐波电压
|
* 间谐波电压
|
||||||
*/
|
*/
|
||||||
case HSV:
|
case HSV:
|
||||||
AdHarmonicResult harmInV = isHarmQualified(dev, devIdMapComm, errDtlsCheckData, U, sourceIssue, dataRule, 1);
|
AdHarmonicResult harmInV = isHarmQualified(dev, devIdMapComm, errDtlsCheckData, U, sourceIssue, dataRule, 1);
|
||||||
|
if (ObjectUtil.isNull(harmInV)) {
|
||||||
detectionDataDealService.acceptAdResult(Arrays.asList(harmInV), code);
|
detectionDataDealService.acceptAdResult(Arrays.asList(harmInV), code);
|
||||||
return harmInV.getResultFlag();
|
return harmInV.getResultFlag();
|
||||||
|
}
|
||||||
|
return 4;
|
||||||
/**
|
/**
|
||||||
* 间谐波电流
|
* 间谐波电流
|
||||||
*/
|
*/
|
||||||
case HSI:
|
case HSI:
|
||||||
AdHarmonicResult harmInI = isHarmQualified(dev, devIdMapComm, errDtlsCheckData, I, sourceIssue, dataRule, 1);
|
AdHarmonicResult harmInI = isHarmQualified(dev, devIdMapComm, errDtlsCheckData, I, sourceIssue, dataRule, 1);
|
||||||
|
if (ObjectUtil.isNull(harmInI)) {
|
||||||
detectionDataDealService.acceptAdResult(Arrays.asList(harmInI), code);
|
detectionDataDealService.acceptAdResult(Arrays.asList(harmInI), code);
|
||||||
return harmInI.getResultFlag();
|
return harmInI.getResultFlag();
|
||||||
|
}
|
||||||
|
return 4;
|
||||||
/**
|
/**
|
||||||
* 三相电压不平衡度
|
* 三相电压不平衡度
|
||||||
*/
|
*/
|
||||||
case IMBV:
|
case IMBV:
|
||||||
AdNonHarmonicResult vUnban = isUnBalanceOrFlickerQualified(dev, devIdMapComm, errDtlsCheckData, U, sourceIssue, dataRule, "V_UNBAN");
|
AdNonHarmonicResult vUnban = isUnBalanceOrFlickerQualified(dev, devIdMapComm, errDtlsCheckData, U, sourceIssue, dataRule, "V_UNBAN");
|
||||||
|
if (ObjectUtil.isNull(vUnban)) {
|
||||||
detectionDataDealService.acceptAdNonResult(Arrays.asList(vUnban), code);
|
detectionDataDealService.acceptAdNonResult(Arrays.asList(vUnban), code);
|
||||||
return vUnban.getResultFlag();
|
return vUnban.getResultFlag();
|
||||||
|
}
|
||||||
|
return 4;
|
||||||
/**
|
/**
|
||||||
* 三相电流不平衡度
|
* 三相电流不平衡度
|
||||||
*/
|
*/
|
||||||
case IMBA:
|
case IMBA:
|
||||||
AdNonHarmonicResult iUnban = isUnBalanceOrFlickerQualified(dev, devIdMapComm, errDtlsCheckData, I, sourceIssue, dataRule, "I_UNBAN");
|
AdNonHarmonicResult iUnban = isUnBalanceOrFlickerQualified(dev, devIdMapComm, errDtlsCheckData, I, sourceIssue, dataRule, "I_UNBAN");
|
||||||
|
if (ObjectUtil.isNull(iUnban)) {
|
||||||
detectionDataDealService.acceptAdNonResult(Arrays.asList(iUnban), code);
|
detectionDataDealService.acceptAdNonResult(Arrays.asList(iUnban), code);
|
||||||
return iUnban.getResultFlag();
|
return iUnban.getResultFlag();
|
||||||
|
}
|
||||||
|
return 4;
|
||||||
/**
|
/**
|
||||||
* 谐波有功功率
|
* 谐波有功功率
|
||||||
*/
|
*/
|
||||||
case HP:
|
case HP:
|
||||||
AdHarmonicResult harmP = isHarmQualified(dev, devIdMapComm, errDtlsCheckData, P, sourceIssue, dataRule, 2);
|
AdHarmonicResult harmP = isHarmQualified(dev, devIdMapComm, errDtlsCheckData, P, sourceIssue, dataRule, 2);
|
||||||
|
if (ObjectUtil.isNull(harmP)) {
|
||||||
detectionDataDealService.acceptAdResult(Arrays.asList(harmP), code);
|
detectionDataDealService.acceptAdResult(Arrays.asList(harmP), code);
|
||||||
return harmP.getResultFlag();
|
return harmP.getResultFlag();
|
||||||
|
}
|
||||||
|
return 4;
|
||||||
/**
|
/**
|
||||||
* 闪变
|
* 闪变
|
||||||
*/
|
*/
|
||||||
case F:
|
case F:
|
||||||
AdNonHarmonicResult pst = isUnBalanceOrFlickerQualified(dev, devIdMapComm, errDtlsCheckData, null, sourceIssue, dataRule, "PST");
|
AdNonHarmonicResult pst = isUnBalanceOrFlickerQualified(dev, devIdMapComm, errDtlsCheckData, null, sourceIssue, dataRule, "PST");
|
||||||
|
if (ObjectUtil.isNull(pst)) {
|
||||||
detectionDataDealService.acceptAdNonResult(Arrays.asList(pst), code);
|
detectionDataDealService.acceptAdNonResult(Arrays.asList(pst), code);
|
||||||
return pst.getResultFlag();
|
return pst.getResultFlag();
|
||||||
|
}
|
||||||
|
return 4;
|
||||||
/**
|
/**
|
||||||
* 暂态
|
* 暂态
|
||||||
*/
|
*/
|
||||||
@@ -170,8 +195,7 @@ public class DetectionServiceImpl {
|
|||||||
case VOLTAGE_DUR:
|
case VOLTAGE_DUR:
|
||||||
return isVoltageQualified(dev, devIdMapComm, errDtlsCheckData, sourceIssue, dataRule, code);
|
return isVoltageQualified(dev, devIdMapComm, errDtlsCheckData, sourceIssue, dataRule, code);
|
||||||
default:
|
default:
|
||||||
// return isUnknownQualified(dev, devIdMapComm, errDtlsCheckData, sourceIssue, dataRule, code);
|
return isUnknownQualified(dev, devIdMapComm, errDtlsCheckData, sourceIssue, dataRule, code);
|
||||||
return 4;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,10 +206,17 @@ public class DetectionServiceImpl {
|
|||||||
DictDataEnum dataRule,
|
DictDataEnum dataRule,
|
||||||
String code) {
|
String code) {
|
||||||
List<AdNonHarmonicResult> info = new ArrayList<>();
|
List<AdNonHarmonicResult> info = new ArrayList<>();
|
||||||
|
List<AdHarmonicResult> harmonicResultList = new ArrayList<>();
|
||||||
List<String> devValueTypeList = sourceIssue.getDevValueTypeList();
|
List<String> devValueTypeList = sourceIssue.getDevValueTypeList();
|
||||||
|
//非谐波指标
|
||||||
|
List<String> harmDesc = dev.stream().flatMap(x -> x.getSqlData().stream()).map(DevData.SqlDataDTO::getDesc).distinct().collect(Collectors.toList());
|
||||||
|
//谐波类型
|
||||||
|
List<String> inHarm = dev.stream().flatMap(x -> x.getSqlDataHarm().stream()).map(DevData.SqlDataHarmDTO::getDesc).distinct().collect(Collectors.toList());
|
||||||
for (String s : devValueTypeList) {
|
for (String s : devValueTypeList) {
|
||||||
//基本数据
|
String devIndex = s.split("\\$")[1];
|
||||||
Map<String, List<Double>> map = devListMap(dev, dataRule, s.split("\\$")[1]);
|
if (harmDesc.contains(devIndex)) {
|
||||||
|
//基本数据(频率,电压,电流)
|
||||||
|
Map<String, List<Double>> map = devListMap(dev, dataRule, devIndex);
|
||||||
AdNonHarmonicResult result = new AdNonHarmonicResult();
|
AdNonHarmonicResult result = new AdNonHarmonicResult();
|
||||||
String[] split = dev.get(0).getId().split("_");
|
String[] split = dev.get(0).getId().split("_");
|
||||||
String devID = devIdMapComm.get(split[0]);
|
String devID = devIdMapComm.get(split[0]);
|
||||||
@@ -194,10 +225,19 @@ public class DetectionServiceImpl {
|
|||||||
result.setSort(sourceIssue.getIndex());
|
result.setSort(sourceIssue.getIndex());
|
||||||
result.setDataType("avg");
|
result.setDataType("avg");
|
||||||
List<ErrDtlsCheckDataVO> dtlsCheckData = errDtlsCheckData.stream().filter(x -> x.getValueTypeCode().equals(s.split("\\$")[1])).collect(Collectors.toList());
|
List<ErrDtlsCheckDataVO> dtlsCheckData = errDtlsCheckData.stream().filter(x -> x.getValueTypeCode().equals(s.split("\\$")[1])).collect(Collectors.toList());
|
||||||
|
if (CollUtil.isNotEmpty(dtlsCheckData)) {
|
||||||
|
result.setAdType(dtlsCheckData.get(0).getValueType());
|
||||||
|
}
|
||||||
List<DetectionData> resultFlag = new ArrayList<>();
|
List<DetectionData> resultFlag = new ArrayList<>();
|
||||||
map.forEach((key, value) -> {
|
map.forEach((key, value) -> {
|
||||||
List<ErrDtlsCheckDataVO> checkData = dtlsCheckData.stream().filter(x -> key.equals(x.getPhase())).collect(Collectors.toList());
|
List<ErrDtlsCheckDataVO> checkData = dtlsCheckData.stream().filter(x -> key.equals(x.getPhase())).collect(Collectors.toList());
|
||||||
DetectionData detectionData = rangeComparisonList(value, new ArrayList<>(), null, checkData.get(0).getValue(), dataRule);
|
if(CollUtil.isNotEmpty(checkData)){
|
||||||
|
DetectionData detectionData;
|
||||||
|
if (DUR.equals(devIndex)) {
|
||||||
|
detectionData = rangeDURComparisonList(value, new ArrayList<>(), sourceIssue.getFFreq(), checkData.get(0).getValue(), dataRule);
|
||||||
|
} else {
|
||||||
|
detectionData = rangeComparisonList(value, new ArrayList<>(), null, checkData.get(0).getValue(), dataRule);
|
||||||
|
}
|
||||||
if (key.equals(TYPE_T)) {
|
if (key.equals(TYPE_T)) {
|
||||||
result.setTValue(JSON.toJSONString(detectionData));
|
result.setTValue(JSON.toJSONString(detectionData));
|
||||||
}
|
}
|
||||||
@@ -211,20 +251,81 @@ public class DetectionServiceImpl {
|
|||||||
result.setCValue(JSON.toJSONString(detectionData));
|
result.setCValue(JSON.toJSONString(detectionData));
|
||||||
}
|
}
|
||||||
resultFlag.add(detectionData);
|
resultFlag.add(detectionData);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
result.setResultFlag(setResultFlag(resultFlag));
|
result.setResultFlag(setResultFlag(resultFlag));
|
||||||
info.add(result);
|
info.add(result);
|
||||||
//谐波
|
}
|
||||||
Map<String, Map<Double, List<Double>>> devHarmMap = devHarmListMap(dev, sourceIssue, dataRule, 2);
|
|
||||||
List<DetectionData> detectionData = harmRangeComparison(new ArrayList<>(), null, TYPE_T, sourceIssue, dataRule, devHarmMap.get(TYPE_T), sourceIssue.getFUn(), 2);
|
if (inHarm.contains(devIndex)) {
|
||||||
//间谐波
|
String fundCode = "";
|
||||||
Map<String, Map<Double, List<Double>>> devInHarmMap = devHarmListMap(dev, sourceIssue, dataRule, 1);
|
String harmCode = "";
|
||||||
|
Integer num = 1;
|
||||||
|
String type = "";
|
||||||
|
Double fData = 1.0;
|
||||||
|
if (devIndex.contains("V")) {
|
||||||
|
fundCode = DetectionCodeEnum.U1.getCode();
|
||||||
|
num = 2;
|
||||||
|
type = U;
|
||||||
|
fData = sourceIssue.getFUn();
|
||||||
|
if (devIndex.contains("50")) {
|
||||||
|
harmCode = DetectionCodeEnum.V2_50.getCode();
|
||||||
|
}
|
||||||
|
if (devIndex.contains("49")) {
|
||||||
|
harmCode = DetectionCodeEnum.SV_1_49.getCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (devIndex.contains("I")) {
|
||||||
|
fundCode = DetectionCodeEnum.I1.getCode();;
|
||||||
|
type = I;
|
||||||
|
fData = sourceIssue.getFIn();
|
||||||
|
if (devIndex.contains("50")) {
|
||||||
|
harmCode =DetectionCodeEnum.I2_50.getCode();
|
||||||
|
}
|
||||||
|
if (devIndex.contains("49")) {
|
||||||
|
harmCode = DetectionCodeEnum.SI_1_49.getCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (devIndex.contains("P")) {
|
||||||
|
type = P;
|
||||||
|
harmCode = DetectionCodeEnum.P2_50.getCode();
|
||||||
|
fData = sourceIssue.getFIn() * sourceIssue.getFUn() * 0.01;
|
||||||
|
}
|
||||||
|
Map<String, Map<Double, List<Double>>> devHarmMap = devHarmListMap(dev, sourceIssue, dataRule, fundCode, harmCode, num);
|
||||||
|
if(CollUtil.isNotEmpty(devHarmMap)){
|
||||||
|
AdHarmonicResult harmonicResult = new AdHarmonicResult();
|
||||||
|
String[] split = dev.get(0).getId().split("_");
|
||||||
|
String devID = devIdMapComm.get(split[0]);
|
||||||
|
harmonicResult.setMonitorId(devID + "_" + split[1]);
|
||||||
|
harmonicResult.setScriptId(sourceIssue.getScriptId());
|
||||||
|
harmonicResult.setSort(sourceIssue.getIndex());
|
||||||
|
List<ErrDtlsCheckDataVO> dtlsCheckData = errDtlsCheckData.stream().filter(x -> x.getValueTypeCode().equals(s.split("\\$")[1])).collect(Collectors.toList());
|
||||||
|
if (CollUtil.isNotEmpty(dtlsCheckData)) {
|
||||||
|
harmonicResult.setAdType(dtlsCheckData.get(0).getValueType());
|
||||||
|
}
|
||||||
|
List<DetectionData> integerBooleanA = harmRangeComparison(new ArrayList<>(), type, TYPE_A, sourceIssue, dataRule, devHarmMap.get(TYPE_A), fData, num);
|
||||||
|
List<DetectionData> integerBooleanB = harmRangeComparison(new ArrayList<>(), type, TYPE_B, sourceIssue, dataRule, devHarmMap.get(TYPE_B), fData, num);
|
||||||
|
List<DetectionData> integerBooleanC = harmRangeComparison(new ArrayList<>(), type, TYPE_C, sourceIssue, dataRule, devHarmMap.get(TYPE_C), fData, num);
|
||||||
|
harmonicResult.setDataType("avg");
|
||||||
|
reflectHarmonic("a", integerBooleanA, harmonicResult, num);
|
||||||
|
reflectHarmonic("b", integerBooleanB, harmonicResult, num);
|
||||||
|
reflectHarmonic("c", integerBooleanC, harmonicResult, num);
|
||||||
|
List<DetectionData> list = new ArrayList<>();
|
||||||
|
list.addAll(integerBooleanA.stream().distinct().collect(Collectors.toList()));
|
||||||
|
list.addAll(integerBooleanB.stream().distinct().collect(Collectors.toList()));
|
||||||
|
list.addAll(integerBooleanC.stream().distinct().collect(Collectors.toList()));
|
||||||
|
harmonicResult.setResultFlag(setResultFlag(list));
|
||||||
|
harmonicResultList.add(harmonicResult);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(info)) {
|
if (CollUtil.isNotEmpty(info)) {
|
||||||
detectionDataDealService.acceptAdNonResult(info, code);
|
detectionDataDealService.acceptAdNonResult(info, code);
|
||||||
List<Integer> resultFlag = info.stream().filter(x -> 4 != x.getResultFlag()).map(AdNonHarmonicResult::getResultFlag).distinct().collect(Collectors.toList());
|
}
|
||||||
return getInteger(resultFlag);
|
if (CollUtil.isNotEmpty(harmonicResultList)) {
|
||||||
|
detectionDataDealService.acceptAdResult(harmonicResultList, code);
|
||||||
}
|
}
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
@@ -336,19 +437,33 @@ public class DetectionServiceImpl {
|
|||||||
SourceIssue sourceIssue,
|
SourceIssue sourceIssue,
|
||||||
DictDataEnum dataRule,
|
DictDataEnum dataRule,
|
||||||
Integer num) {
|
Integer num) {
|
||||||
Map<String, Map<Double, List<Double>>> devMap = devHarmListMap(dev, sourceIssue, dataRule, num);
|
|
||||||
Double fData = 1.0;
|
Double fData = 1.0;
|
||||||
|
String fundCode = "";
|
||||||
|
String harmCode = "";
|
||||||
if (U.equals(type)) {
|
if (U.equals(type)) {
|
||||||
fData = sourceIssue.getFUn();
|
fData = sourceIssue.getFUn();
|
||||||
|
fundCode = DetectionCodeEnum.U1.getCode();
|
||||||
|
if (num == 1) {
|
||||||
|
harmCode = DetectionCodeEnum.SV_1_49.getCode();
|
||||||
|
} else {
|
||||||
|
harmCode = DetectionCodeEnum.V2_50.getCode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (I.equals(type)) {
|
if (I.equals(type)) {
|
||||||
fData = sourceIssue.getFIn();
|
fData = sourceIssue.getFIn();
|
||||||
|
fundCode = DetectionCodeEnum.I1.getCode();;
|
||||||
|
if (num == 1) {
|
||||||
|
harmCode = DetectionCodeEnum.SI_1_49.getCode();
|
||||||
|
} else {
|
||||||
|
harmCode =DetectionCodeEnum.I2_50.getCode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (P.equals(type)) {
|
if (P.equals(type)) {
|
||||||
fData = sourceIssue.getFIn() * sourceIssue.getFUn() * 0.01;
|
fData = sourceIssue.getFIn() * sourceIssue.getFUn() * 0.01;
|
||||||
|
harmCode = DetectionCodeEnum.P2_50.getCode();
|
||||||
}
|
}
|
||||||
|
Map<String, Map<Double, List<Double>>> devMap = devHarmListMap(dev, sourceIssue, dataRule, fundCode, harmCode, num);
|
||||||
|
if(CollUtil.isNotEmpty(devMap)){
|
||||||
AdHarmonicResult harmonicResult = new AdHarmonicResult();
|
AdHarmonicResult harmonicResult = new AdHarmonicResult();
|
||||||
String[] split = dev.get(0).getId().split("_");
|
String[] split = dev.get(0).getId().split("_");
|
||||||
String devID = devIdMapComm.get(split[0]);
|
String devID = devIdMapComm.get(split[0]);
|
||||||
@@ -376,6 +491,8 @@ public class DetectionServiceImpl {
|
|||||||
harmonicResult.setResultFlag(setResultFlag(list));
|
harmonicResult.setResultFlag(setResultFlag(list));
|
||||||
return harmonicResult;
|
return harmonicResult;
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -400,6 +517,7 @@ public class DetectionServiceImpl {
|
|||||||
.eq(PqScriptCheckData::getScriptId, sourceIssue.getScriptId())
|
.eq(PqScriptCheckData::getScriptId, sourceIssue.getScriptId())
|
||||||
);
|
);
|
||||||
Map<String, List<Double>> map = devListMap(dev, dataRule, code);
|
Map<String, List<Double>> map = devListMap(dev, dataRule, code);
|
||||||
|
if(CollUtil.isNotEmpty(map)){
|
||||||
Double fData = 1.0;
|
Double fData = 1.0;
|
||||||
if (U.equals(type)) {
|
if (U.equals(type)) {
|
||||||
fData = sourceIssue.getFUn();
|
fData = sourceIssue.getFUn();
|
||||||
@@ -452,6 +570,8 @@ public class DetectionServiceImpl {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -788,12 +908,19 @@ public class DetectionServiceImpl {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param dev 原始数据
|
* @param dev 原始数据
|
||||||
* @param sourceIssue
|
* @param sourceIssue 源下发参数
|
||||||
* @param dataRule
|
* @param dataRule 数据处理原则
|
||||||
* @param num
|
* @param fundCode 装置下发基波code
|
||||||
|
* @param harmCode 装置下发谐波信息
|
||||||
|
* @param num 区分谐波还是间谐波1:谐波,2:间谐波
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Map<String, Map<Double, List<Double>>> devHarmListMap(List<DevData> dev, SourceIssue sourceIssue, DictDataEnum dataRule, Integer num) {
|
public Map<String, Map<Double, List<Double>>> devHarmListMap(List<DevData> dev,
|
||||||
|
SourceIssue sourceIssue,
|
||||||
|
DictDataEnum dataRule,
|
||||||
|
String fundCode,
|
||||||
|
String harmCode,
|
||||||
|
Integer num) {
|
||||||
Map<String, Map<Double, List<Double>>> map = new HashMap<>(3);
|
Map<String, Map<Double, List<Double>>> map = new HashMap<>(3);
|
||||||
List<Double> harmNum = new ArrayList<>();
|
List<Double> harmNum = new ArrayList<>();
|
||||||
harmNum.add(1.0);
|
harmNum.add(1.0);
|
||||||
@@ -807,12 +934,12 @@ public class DetectionServiceImpl {
|
|||||||
.sorted().distinct().collect(Collectors.toList()));
|
.sorted().distinct().collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
for (DevData devData : dev) {
|
for (DevData devData : dev) {
|
||||||
Optional<DevData.SqlDataDTO> first = devData.getSqlData().stream().collect(Collectors.toList()).stream().findFirst();
|
Optional<DevData.SqlDataDTO> first = devData.getSqlData().stream().filter(x -> x.getDesc().equals(fundCode)).collect(Collectors.toList()).stream().findFirst();
|
||||||
DevData.SqlDataDTO fund = null;
|
DevData.SqlDataDTO fund = null;
|
||||||
if (first.isPresent()) {
|
if (first.isPresent()) {
|
||||||
fund = devData.getSqlData().stream().collect(Collectors.toList()).stream().findFirst().get();
|
fund = first.get();
|
||||||
}
|
}
|
||||||
List<DevData.SqlDataHarmDTO> harmList = devData.getSqlDataHarm().stream().collect(Collectors.toList());
|
List<DevData.SqlDataHarmDTO> harmList = devData.getSqlDataHarm().stream().filter(x -> x.getDesc().equals(harmCode)).collect(Collectors.toList());
|
||||||
if (CollUtil.isNotEmpty(harmList)) {
|
if (CollUtil.isNotEmpty(harmList)) {
|
||||||
DevData.SqlDataHarmDTO harm = harmList.get(0);
|
DevData.SqlDataHarmDTO harm = harmList.get(0);
|
||||||
if (ObjectUtil.isNotNull(fund)) {
|
if (ObjectUtil.isNotNull(fund)) {
|
||||||
@@ -820,9 +947,9 @@ public class DetectionServiceImpl {
|
|||||||
harmPut(TYPE_B, map, harmNum, harm, String.valueOf(fund.getList().getB()), num);
|
harmPut(TYPE_B, map, harmNum, harm, String.valueOf(fund.getList().getB()), num);
|
||||||
harmPut(TYPE_C, map, harmNum, harm, String.valueOf(fund.getList().getC()), num);
|
harmPut(TYPE_C, map, harmNum, harm, String.valueOf(fund.getList().getC()), num);
|
||||||
} else {
|
} else {
|
||||||
harmPut(TYPE_A, map, harmNum, harm, "1.0", num);
|
harmPut(TYPE_A, map, harmNum, harm, "", num);
|
||||||
harmPut(TYPE_B, map, harmNum, harm, "1.0", num);
|
harmPut(TYPE_B, map, harmNum, harm, "", num);
|
||||||
harmPut(TYPE_C, map, harmNum, harm, "1.0", num);
|
harmPut(TYPE_C, map, harmNum, harm, "", num);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
|
import com.njcn.gather.detection.pojo.enums.DetectionCodeEnum;
|
||||||
import com.njcn.gather.script.mapper.PqScriptCheckDataMapper;
|
import com.njcn.gather.script.mapper.PqScriptCheckDataMapper;
|
||||||
import com.njcn.gather.script.pojo.param.PqScriptCheckDataParam;
|
import com.njcn.gather.script.pojo.param.PqScriptCheckDataParam;
|
||||||
import com.njcn.gather.script.pojo.po.PqScriptCheckData;
|
import com.njcn.gather.script.pojo.po.PqScriptCheckData;
|
||||||
@@ -32,10 +33,7 @@ import java.util.stream.Collectors;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class PqScriptCheckDataServiceImpl extends ServiceImpl<PqScriptCheckDataMapper, PqScriptCheckData> implements IPqScriptCheckDataService {
|
public class PqScriptCheckDataServiceImpl extends ServiceImpl<PqScriptCheckDataMapper, PqScriptCheckData> implements IPqScriptCheckDataService {
|
||||||
|
|
||||||
private final String V="real$V2-50";
|
private final String REAL="real$";
|
||||||
private final String SV="real$SV_1-49";
|
|
||||||
private final String I="real$I2-50";
|
|
||||||
private final String IV="real$SI_1-49";
|
|
||||||
|
|
||||||
private final DictTreeMapper dictTreeMapper;
|
private final DictTreeMapper dictTreeMapper;
|
||||||
|
|
||||||
@@ -54,17 +52,21 @@ public class PqScriptCheckDataServiceImpl extends ServiceImpl<PqScriptCheckDataM
|
|||||||
if(CollUtil.isNotEmpty(pqScriptCheckData)){
|
if(CollUtil.isNotEmpty(pqScriptCheckData)){
|
||||||
if (param.getIsValueTypeName()) {
|
if (param.getIsValueTypeName()) {
|
||||||
List<String> checkData = pqScriptCheckData.stream().map(x -> x.getDataType() + "$" + x.getValueType()).distinct().collect(Collectors.toList());
|
List<String> checkData = pqScriptCheckData.stream().map(x -> x.getDataType() + "$" + x.getValueType()).distinct().collect(Collectors.toList());
|
||||||
if(!checkData.contains("real$U1")){
|
String U = REAL + DetectionCodeEnum.U1.getCode();
|
||||||
if(checkData.contains(V)||checkData.contains(SV)){
|
if(!checkData.contains(U)){
|
||||||
checkData.add("real$U1");
|
if(checkData.contains(REAL+DetectionCodeEnum.V2_50.getCode())||
|
||||||
|
checkData.contains(REAL+DetectionCodeEnum.SV_1_49.getCode())){
|
||||||
|
checkData.add(U);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!checkData.contains("real$I1")){
|
String I = REAL + DetectionCodeEnum.I1.getCode();
|
||||||
if(checkData.contains(I)||checkData.contains(IV)){
|
if(!checkData.contains(I)){
|
||||||
checkData.add("real$I1");
|
if(checkData.contains(REAL+DetectionCodeEnum.I2_50.getCode())||
|
||||||
|
checkData.contains(REAL+DetectionCodeEnum.SI_1_49.getCode())){
|
||||||
|
checkData.add(I);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return checkData;
|
return checkData.stream().distinct().collect(Collectors.toList());
|
||||||
} else {
|
} else {
|
||||||
return pqScriptCheckData.stream().map(PqScriptCheckData::getValueType).distinct().collect(Collectors.toList());
|
return pqScriptCheckData.stream().map(PqScriptCheckData::getValueType).distinct().collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user