正式检测增加装置空数据判断
This commit is contained in:
@@ -480,14 +480,19 @@ public class DetectionServiceImpl {
|
||||
|
||||
|
||||
private Integer setResultFlag(List<Integer> numbers) {
|
||||
if (numbers.size() > 1) {
|
||||
if (numbers.contains(4)) {
|
||||
return 4;
|
||||
} else if (numbers.contains(2)) {
|
||||
return 2;
|
||||
numbers = numbers.stream().filter(x -> ObjectUtil.isNotNull(x)).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(numbers)) {
|
||||
if (numbers.size() > 1) {
|
||||
if (numbers.contains(4)) {
|
||||
return 4;
|
||||
} else if (numbers.contains(2)) {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
return numbers.get(0);
|
||||
} else {
|
||||
return 4;
|
||||
}
|
||||
return numbers.get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -668,7 +673,6 @@ public class DetectionServiceImpl {
|
||||
.filter(x -> v == 0 ? x == v : x > 0 && NumberUtil.isIn(devSubtractChannelData(x, v, errSysDtl.getErrorValueType()),
|
||||
BigDecimal.valueOf(-errSysDtl.getMaxErrorValue()),
|
||||
BigDecimal.valueOf(errSysDtl.getMaxErrorValue()))).collect(Collectors.toList());
|
||||
data.setRadius(-errSysDtl.getMaxErrorValue() + "~" + errSysDtl.getMaxErrorValue());
|
||||
isData(dataRule, harmDataList, data, qualifiedList);
|
||||
}
|
||||
|
||||
@@ -764,7 +768,6 @@ public class DetectionServiceImpl {
|
||||
public DetectionData rangeComparisonList(List<Double> list, List<PqErrSysDtls> pqErrSysDtls, Double data, Double channelData, DictDataEnum dataRule) {
|
||||
DetectionData detectionData = new DetectionData();
|
||||
detectionData.setIsData(4);
|
||||
detectionData.setData(CollUtil.isNotEmpty(list) ? list.get(0) : null);
|
||||
//先根据源所下发的数据,是否在误差体系范围内在则可以进行误差体系判断
|
||||
//获得误差体系
|
||||
List<PqErrSysDtls> errSysDtls = pqErrSysDtls.stream().filter(x -> rangeComparison(multiply(x.getStartValue(), data, x.getConditionType()),
|
||||
@@ -775,21 +778,28 @@ public class DetectionServiceImpl {
|
||||
if (CollUtil.isNotEmpty(errSysDtls)) {
|
||||
PqErrSysDtls errSysDtl = BeanUtil.copyProperties(errSysDtls.get(0), PqErrSysDtls.class);
|
||||
if (DUR.equals(errSysDtl.getScriptType())) {
|
||||
List<Double> qualifiedList = list.stream()
|
||||
.filter(x -> NumberUtil.isIn(BigDecimal.valueOf(x.doubleValue()),
|
||||
BigDecimal.valueOf(1.0 / data * (channelData - errSysDtl.getMaxErrorValue())),
|
||||
BigDecimal.valueOf(1.0 / data * (channelData + errSysDtl.getMaxErrorValue())))
|
||||
).collect(Collectors.toList());
|
||||
detectionData.setResultData(BigDecimal.valueOf(1.0 / data).doubleValue() * channelData);
|
||||
detectionData.setRadius(BigDecimal.valueOf(1.0 / data * (channelData - errSysDtl.getMaxErrorValue()))
|
||||
+ "~" + BigDecimal.valueOf(1.0 / data * (channelData + errSysDtl.getMaxErrorValue())));
|
||||
isData(dataRule, qualifiedList, detectionData, qualifiedList);
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
detectionData.setData(list.get(0));
|
||||
List<Double> qualifiedList = list.stream()
|
||||
.filter(x -> NumberUtil.isIn(BigDecimal.valueOf(x.doubleValue()),
|
||||
BigDecimal.valueOf(1.0 / data * (channelData - errSysDtl.getMaxErrorValue())),
|
||||
BigDecimal.valueOf(1.0 / data * (channelData + errSysDtl.getMaxErrorValue())))
|
||||
).collect(Collectors.toList());
|
||||
isData(dataRule, qualifiedList, detectionData, qualifiedList);
|
||||
}
|
||||
} else {
|
||||
if (0 == errSysDtl.getErrorValueType()) {
|
||||
errSysDtl.setMaxErrorValue(multiply(errSysDtl.getMaxErrorValue(), data, 0));
|
||||
}
|
||||
detectionData.setResultData(channelData);
|
||||
setDetection(dataRule, list, errSysDtl, detectionData, channelData);
|
||||
detectionData.setRadius(-errSysDtl.getMaxErrorValue() + "~" + errSysDtl.getMaxErrorValue());
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
detectionData.setData(list.get(0));
|
||||
setDetection(dataRule, list, errSysDtl, detectionData, channelData);
|
||||
}
|
||||
}
|
||||
}
|
||||
return detectionData;
|
||||
|
||||
Reference in New Issue
Block a user