二楼生成报告谐波电流值有误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.Path;
import java.nio.file.Paths;
import java.util.*;
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.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);
}
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) {
// 要处理 2 5 7 11 23 35 43 50
// 基波
String aBase = devValue(adHarmonicResult.getAValue1(), 1, 1);
String bBase = devValue(adHarmonicResult.getBValue1(), 1, 1);
String cBase = devValue(adHarmonicResult.getCValue1(), 1, 1);
@@ -1533,18 +1534,20 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
dataModelMap.put("${" + index + "#" + key + "#B#1}", bBase);
dataModelMap.put("${" + index + "#" + key + "#C#1}", cBase);
// 基波
double aBaseValue = baseValue;
double bBaseValue = baseValue;
double cBaseValue = baseValue;
if (!aBase.equals(StrPool.SLASH)) {
aBaseValue = Double.parseDouble(aBase);
}
if (!bBase.equals(StrPool.SLASH)) {
bBaseValue = Double.parseDouble(bBase);
}
if (!cBase.equals(StrPool.SLASH)) {
cBaseValue = Double.parseDouble(cBase);
if (!DetectionCodeEnum.I2_50.getCode().equals(adHarmonicResult.getAdType())) {
if (!aBase.equals(StrPool.SLASH)) {
aBaseValue = Double.parseDouble(aBase);
}
if (!bBase.equals(StrPool.SLASH)) {
bBaseValue = Double.parseDouble(bBase);
}
if (!cBase.equals(StrPool.SLASH)) {
cBaseValue = Double.parseDouble(cBase);
}
}
dataModelMap.put("${" + index + "#" + key + "#A#2}", devValue(adHarmonicResult.getAValue2(), aBaseValue, percent));