修正默认参与比较值逻辑,增加不参与误差比较状态
This commit is contained in:
@@ -250,21 +250,34 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
||||
}
|
||||
|
||||
private Integer setResultFlag(List<RawResultDataVO.DetectionData> numbers) {
|
||||
List<Integer> isData = numbers.stream().filter(Objects::nonNull).filter(x -> ObjectUtil.isNotNull(x.getData())).filter(x -> 4 != x.getIsData()).map(RawResultDataVO.DetectionData::getIsData).distinct().collect(Collectors.toList());
|
||||
List<Integer> isData = numbers.stream().filter(Objects::nonNull)
|
||||
.filter(x -> ObjectUtil.isNotNull(x.getData()))
|
||||
.map(RawResultDataVO.DetectionData::getIsData)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
return getInteger(isData);
|
||||
}
|
||||
|
||||
private static Integer getInteger(List<Integer> isData) {
|
||||
if (CollUtil.isNotEmpty(isData)) {
|
||||
if (isData.size() > 1) {
|
||||
if (isData.contains(2)) {
|
||||
return 2;
|
||||
List<Integer> isQualified = isData.stream().filter(x -> 1 == x || 2 == x).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(isQualified)) {
|
||||
if (isQualified.size() > 1) {
|
||||
if (isQualified.contains(2)) {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
return isData.get(0);
|
||||
} else {
|
||||
if (isData.contains(4)) {
|
||||
return 4;
|
||||
}
|
||||
if (isData.contains(5)) {
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
return isData.get(0);
|
||||
} else {
|
||||
return 4;
|
||||
}
|
||||
return 4;
|
||||
}
|
||||
|
||||
public Double isHarmOrInHarm(Double value) {
|
||||
|
||||
@@ -108,6 +108,7 @@ public class AdNonHarmonicServiceImpl extends ServiceImpl<AdNonHarmonicMapper, A
|
||||
List<DictTree> dictTreeById = dictTreeService.getDictTreeById(new ArrayList<>(adTypeMap.keySet()));
|
||||
|
||||
Map<String, DictTree> dictTreeByName = dictTreeById.stream().collect(Collectors.toMap(DictTree::getId, Function.identity()));
|
||||
|
||||
adTypeMap.forEach((key, result) -> {
|
||||
if (dictTreeByName.containsKey(key)) {
|
||||
DictTree treeName = dictTreeByName.get(key);
|
||||
|
||||
@@ -137,8 +137,8 @@ public class DetectionDataServiceImpl extends ReplenishMybatisServiceImpl<Detect
|
||||
|
||||
private static Integer isResultFlag(List<Integer> resultFlags) {
|
||||
// 检测结果(0:不符合 1:符合 2:/[未检测无结果])
|
||||
//脚本结果是 1.符合 2.不符合 4.未检测无结果
|
||||
resultFlags = resultFlags.stream().filter(x -> 4 != x).distinct().collect(Collectors.toList());
|
||||
//脚本结果是 1.符合 2.不符合 4.未检测无结果 5.不参与误差比较
|
||||
resultFlags = resultFlags.stream().filter(x -> 4 != x && 5 != x).distinct().collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(resultFlags)) {
|
||||
if (resultFlags.contains(2)) {
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user