重新计算接口调整

This commit is contained in:
caozehui
2025-04-21 09:02:28 +08:00
parent be3df5c497
commit a42dcd1d4b
6 changed files with 66 additions and 18 deletions

View File

@@ -1132,8 +1132,8 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
return obj.substring(index1, obj.indexOf("#", index1));
}, Collectors.toSet()))); //key为indexvalue为该index下所有测试项对应的code
List<AdNonHarmonicResult> adNonHarmonicResultList = adNonHarmonicService.listAll(devReportParam.getScriptId(), devReportParam.getPlanCode(), devReportParam.getDevId() + "_" + i);
List<AdHarmonicResult> adHarmonicResultList = adHarmonicService.listAll(devReportParam.getScriptId(), devReportParam.getPlanCode(), devReportParam.getDevId() + "_" + i);
List<AdNonHarmonicResult> adNonHarmonicResultList = adNonHarmonicService.listAllResultData(devReportParam.getScriptId(), devReportParam.getPlanCode(), devReportParam.getDevId() + "_" + i);
List<AdHarmonicResult> adHarmonicResultList = adHarmonicService.listAllResultData(devReportParam.getScriptId(), devReportParam.getPlanCode(), devReportParam.getDevId() + "_" + i);
// 填充数据
indexKeysMap.forEach((index, keys) -> {

View File

@@ -1014,11 +1014,11 @@ public class ResultServiceImpl implements IResultService {
int timeInt = (int) timeDouble;
// 填充结果数据
fillThreePhaseData(singleResult, timeInt, keyFillMap);
if(!keyFillMap.get(ItemReportKeyEnum.ERROR_SCOPE.getKey()).equals("/")){
if (!keyFillMap.get(ItemReportKeyEnum.ERROR_SCOPE.getKey()).equals("/")) {
keyFillMapList.add(keyFillMap);
}
});
if(CollUtil.isNotEmpty(keyFillMapList)){
if (CollUtil.isNotEmpty(keyFillMapList)) {
// 按次数排序
PubUtils.sortByDoubleValue(keyFillMapList, ItemReportKeyEnum.TIME.getKey());
// 取出任意一次谐波数据的误差范围作为key
@@ -1044,11 +1044,11 @@ public class ResultServiceImpl implements IResultService {
for (AdNonHarmonicResult adNonHarmonicResult : nonHarmList) {
Map<String, String> keyFillMap = new HashMap<>(16);
fillThreePhaseData(adNonHarmonicResult, null, keyFillMap);
if(!keyFillMap.get(ItemReportKeyEnum.ERROR_SCOPE.getKey()).equals("/")){
if (!keyFillMap.get(ItemReportKeyEnum.ERROR_SCOPE.getKey()).equals("/")) {
keyFillMapList.add(keyFillMap);
}
}
if(CollUtil.isNotEmpty(keyFillMapList)){
if (CollUtil.isNotEmpty(keyFillMapList)) {
// 需要对所有的填充进行按误差范围分组
Map<String, List<Map<String, String>>> errorScoperMap = keyFillMapList.stream()
.collect(Collectors.groupingBy(map -> map.get(ItemReportKeyEnum.ERROR_SCOPE.getKey())));
@@ -1073,12 +1073,12 @@ public class ResultServiceImpl implements IResultService {
for (AdNonHarmonicResult adNonHarmonicResult : nonHarmList) {
Map<String, String> keyFillMap = new HashMap<>(8);
fillTPhaseData(adNonHarmonicResult, null, keyFillMap);
if(!keyFillMap.get(ItemReportKeyEnum.ERROR_SCOPE.getKey()).equals("/")){
if (!keyFillMap.get(ItemReportKeyEnum.ERROR_SCOPE.getKey()).equals("/")) {
keyFillMapList.add(keyFillMap);
}
}
}
if(CollUtil.isNotEmpty(keyFillMapList)){
if (CollUtil.isNotEmpty(keyFillMapList)) {
// 需要对所有填充进行按误差范围分组
Map<String, List<Map<String, String>>> errorScoperMap = keyFillMapList.stream()
.collect(Collectors.groupingBy(map -> map.get(ItemReportKeyEnum.ERROR_SCOPE.getKey())));
@@ -1518,10 +1518,10 @@ public class ResultServiceImpl implements IResultService {
dataRule = DictDataEnum.AT_WILL_VALUE;
}
List<AdNonHarmonicResult> allNonHarmonicRawData = adNonHarmonicService.listAll(scriptId, oldCode, devId);
List<AdNonHarmonicResult> allNonHarmonicRawData = adNonHarmonicService.listAllRawData(scriptId, oldCode, devId);
LinkedHashMap<Integer, List<AdNonHarmonicResult>> nonHarmonicMap = allNonHarmonicRawData.stream().sorted(Comparator.comparing(AdNonHarmonicResult::getSort))
.collect(Collectors.groupingBy(AdNonHarmonicResult::getSort, LinkedHashMap::new, Collectors.toList()));
List<AdHarmonicResult> allHarmonicRawData = adHarmonicService.listAll(scriptId, oldCode, devId);
List<AdHarmonicResult> allHarmonicRawData = adHarmonicService.listAllRawData(scriptId, oldCode, devId);
LinkedHashMap<Integer, List<AdHarmonicResult>> harmonicMap = allHarmonicRawData.stream().sorted(Comparator.comparing(AdHarmonicResult::getSort))
.collect(Collectors.groupingBy(AdHarmonicResult::getSort, LinkedHashMap::new, Collectors.toList()));
@@ -1574,8 +1574,7 @@ public class ResultServiceImpl implements IResultService {
for (AdNonHarmonicResult result : value) {
sqlDataDTO = new DevData.SqlDataDTO();
sqlDataDTO.setType(result.getDataType());
DictTree dictTree = dictTreeService.getById(result.getAdType());
sqlDataDTO.setDesc(dictTree.getCode());
sqlDataDTO.setDesc(result.getAdType());
DevData.SqlDataDTO.ListDTO listDTO = new DevData.SqlDataDTO.ListDTO();
listDTO.setA(StrUtil.isNotBlank(result.getAValue()) ? Double.valueOf(result.getAValue()) : null);
listDTO.setB(StrUtil.isNotBlank(result.getBValue()) ? Double.valueOf(result.getBValue()) : null);