This commit is contained in:
wr
2025-01-06 10:28:04 +08:00
parent 83f5c10532
commit 6b6ec07be2
2 changed files with 7 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
package com.njcn.gather.detection.service.impl; package com.njcn.gather.detection.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
@@ -653,12 +654,13 @@ public class DetectionServiceImpl {
data.setData(harmDataList.get(0)); data.setData(harmDataList.get(0));
if (ObjectUtil.isNotNull(errSysDtl)) { if (ObjectUtil.isNotNull(errSysDtl)) {
if (0 == errSysDtl.getErrorValueType()) { PqErrSysDtls errSys = BeanUtil.copyProperties(errSysDtl, PqErrSysDtls.class);
errSysDtl.setMaxErrorValue(multiply(errSysDtl.getMaxErrorValue(), fData, 0)); if (0 == errSys.getErrorValueType()) {
errSys.setMaxErrorValue(multiply(errSys.getMaxErrorValue(), fData, 0));
} }
Double v = issueHarmMap.get(harm); Double v = issueHarmMap.get(harm);
data.setResultData(v); data.setResultData(v);
setDetection(dataRule, harmDataList, errSysDtl, data, v); setDetection(dataRule, harmDataList, errSys, data, v);
} }
info.add(data); info.add(data);
}); });
@@ -781,7 +783,7 @@ public class DetectionServiceImpl {
x.getEndFlag(), x.getEndFlag(),
channelData)).collect(Collectors.toList()); channelData)).collect(Collectors.toList());
if (CollUtil.isNotEmpty(errSysDtls)) { if (CollUtil.isNotEmpty(errSysDtls)) {
PqErrSysDtls errSysDtl = errSysDtls.get(0); PqErrSysDtls errSysDtl = BeanUtil.copyProperties(errSysDtls.get(0), PqErrSysDtls.class);
if (DUR.equals(errSysDtl.getScriptType())) { if (DUR.equals(errSysDtl.getScriptType())) {
List<Double> qualifiedList = list.stream() List<Double> qualifiedList = list.stream()
.filter(x -> NumberUtil.isIn(BigDecimal.valueOf(x.doubleValue()), .filter(x -> NumberUtil.isIn(BigDecimal.valueOf(x.doubleValue()),

View File

@@ -790,6 +790,7 @@ public class ResultServiceImpl implements IResultService {
.distinct() .distinct()
.select(PqScriptCheckData::getHarmNum) .select(PqScriptCheckData::getHarmNum)
.eq(PqScriptCheckData::getScriptId, param.getScriptId()) .eq(PqScriptCheckData::getScriptId, param.getScriptId())
.isNotNull(PqScriptCheckData::getHarmNum)
.eq(PqScriptCheckData::getIndex, param.getIndex()) .eq(PqScriptCheckData::getIndex, param.getIndex())
); );
List<Double> harmNum = list.stream().map(PqScriptCheckData::getHarmNum).distinct().collect(Collectors.toList()); List<Double> harmNum = list.stream().map(PqScriptCheckData::getHarmNum).distinct().collect(Collectors.toList());