相角180度时特殊处理

This commit is contained in:
caozehui
2026-07-08 10:50:00 +08:00
parent 95544f1dc6
commit 75bc44172b
2 changed files with 15 additions and 0 deletions

View File

@@ -488,6 +488,19 @@ public class DetectionServiceImpl {
.collect(Collectors.toList());
if (CollUtil.isNotEmpty(checkData)) {
List<Double> phaseValue = map.get(phase);
if (ResultUnitEnum.ANGLE.getCode().equals(type)) {
phaseValue = phaseValue.stream().map(x -> {
// 原始误差值
double originDiff = x - checkData.get(0).getValue();
// 转换误差值
double translateDiff = Math.abs(originDiff) - 360;
if (Math.abs(translateDiff) <= 10) {
return Math.abs(x);
} else {
return x;
}
}).collect(Collectors.toList());
}
// 注意如果map中不存在该phase的键phaseValue可能为null需确保map包含该键
DetectionData detectionData = rangeComparisonList(phaseValue, isQualified, pqErrSysDtls, fData, checkData.get(0).getValue(), dataRule, scale);
resultFlag.add(detectionData);

View File

@@ -120,6 +120,8 @@ public class StorageUtil {
*/
case "VA":
case "IA":
case "U1A":
case "I1A":
unit = "°";
break;
/**