二楼生成报告谐波电流值有误bug

This commit is contained in:
caozehui
2025-06-30 14:15:35 +08:00
parent 73028c70d2
commit 757501efa8

View File

@@ -98,9 +98,11 @@ import java.math.RoundingMode;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.*;
import java.util.List; import java.util.List;
import java.util.concurrent.*; import java.util.*;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -615,7 +617,6 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
} }
/** /**
* 处理检测报告上传云服务器并生成二维码下装到装置 * 处理检测报告上传云服务器并生成二维码下装到装置
* 做成异步执行 * 做成异步执行
@@ -1506,7 +1507,7 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
fillHarm(dataModelMap, adHarmonicResult, index, key, 57.74, 100); fillHarm(dataModelMap, adHarmonicResult, index, key, 57.74, 100);
} }
if (DetectionCodeEnum.I2_50.getCode().equals(key) || DetectionCodeEnum.SI_1_49.getCode().equals(key)) { if (DetectionCodeEnum.I2_50.getCode().equals(key) || DetectionCodeEnum.SI_1_49.getCode().equals(key)) {
fillHarm(dataModelMap, adHarmonicResult, index, key, 1, 100); fillHarm(dataModelMap, adHarmonicResult, index, key, 1, 1);
} }
} }
} }
@@ -1525,7 +1526,7 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
*/ */
private void fillHarm(Map<String, String> dataModelMap, AdHarmonicResult adHarmonicResult, String index, String key, double baseValue, int percent) { private void fillHarm(Map<String, String> dataModelMap, AdHarmonicResult adHarmonicResult, String index, String key, double baseValue, int percent) {
// 要处理 2 5 7 11 23 35 43 50 // 要处理 2 5 7 11 23 35 43 50
// 基波
String aBase = devValue(adHarmonicResult.getAValue1(), 1, 1); String aBase = devValue(adHarmonicResult.getAValue1(), 1, 1);
String bBase = devValue(adHarmonicResult.getBValue1(), 1, 1); String bBase = devValue(adHarmonicResult.getBValue1(), 1, 1);
String cBase = devValue(adHarmonicResult.getCValue1(), 1, 1); String cBase = devValue(adHarmonicResult.getCValue1(), 1, 1);
@@ -1533,10 +1534,11 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
dataModelMap.put("${" + index + "#" + key + "#B#1}", bBase); dataModelMap.put("${" + index + "#" + key + "#B#1}", bBase);
dataModelMap.put("${" + index + "#" + key + "#C#1}", cBase); dataModelMap.put("${" + index + "#" + key + "#C#1}", cBase);
// 基波
double aBaseValue = baseValue; double aBaseValue = baseValue;
double bBaseValue = baseValue; double bBaseValue = baseValue;
double cBaseValue = baseValue; double cBaseValue = baseValue;
if (!DetectionCodeEnum.I2_50.getCode().equals(adHarmonicResult.getAdType())) {
if (!aBase.equals(StrPool.SLASH)) { if (!aBase.equals(StrPool.SLASH)) {
aBaseValue = Double.parseDouble(aBase); aBaseValue = Double.parseDouble(aBase);
} }
@@ -1546,6 +1548,7 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
if (!cBase.equals(StrPool.SLASH)) { if (!cBase.equals(StrPool.SLASH)) {
cBaseValue = Double.parseDouble(cBase); cBaseValue = Double.parseDouble(cBase);
} }
}
dataModelMap.put("${" + index + "#" + key + "#A#2}", devValue(adHarmonicResult.getAValue2(), aBaseValue, percent)); dataModelMap.put("${" + index + "#" + key + "#A#2}", devValue(adHarmonicResult.getAValue2(), aBaseValue, percent));
dataModelMap.put("${" + index + "#" + key + "#B#2}", devValue(adHarmonicResult.getBValue2(), bBaseValue, percent)); dataModelMap.put("${" + index + "#" + key + "#B#2}", devValue(adHarmonicResult.getBValue2(), bBaseValue, percent));