调整检测结果信息,将无法处理的数据相进行排除在计算

This commit is contained in:
wr
2025-01-13 21:09:13 +08:00
parent 9b6543bbb6
commit f9c8c812ee
4 changed files with 23 additions and 23 deletions

View File

@@ -55,7 +55,7 @@ public class AdHarmonicResult {
private String dataType;
/**
* 0.不合格 1.合格
* 1.合格 2.合格 4.无法处理
*/
private Integer resultFlag;

View File

@@ -1,6 +1,5 @@
package com.njcn.gather.storage.pojo.po;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
@@ -53,7 +52,7 @@ public class AdNonHarmonicResult {
private String dataType;
/**
* 0.不合格 1.合格
* 1.合格 2.合格 4.无法处理
*/
private Integer resultFlag;

View File

@@ -133,18 +133,20 @@ public class DetectionDataServiceImpl extends ReplenishMybatisServiceImpl<Detect
private static Integer isResultFlag(List<Integer> resultFlags) {
// 检测结果0:不符合 1:符合 2:/[未检测无结果])
resultFlags = resultFlags.stream().distinct().collect(Collectors.toList());
resultFlags = resultFlags.stream().filter(x->4!=x).distinct().collect(Collectors.toList());
if (CollUtil.isNotEmpty(resultFlags)) {
if (resultFlags.size() > 1) {
if (resultFlags.contains(4)) {
return 2;
} else if (resultFlags.contains(2)) {
return 0;
}
}
return resultFlags.get(0);
} else {
return 2;
if (resultFlags.contains(2)) {
return 0;
}else{
switch (resultFlags.get(0)){
case 1:
return 1;
case 2:
return 0;
}
}
}
return 1;
}
}