bug调整

This commit is contained in:
xy
2024-12-19 10:29:02 +08:00
parent 86d21f984c
commit c28724bb05
3 changed files with 144 additions and 51 deletions

View File

@@ -205,30 +205,53 @@ public class DataServiceImpl implements IDataService {
vo.setAvgValue(Objects.isNull(statisticalDataDTO) ? 3.14159 : Double.parseDouble(df.format(statisticalDataDTO.getValue())));
unit = item2.getUnit();
} else {
if (HarmonicConstant.POWER_LIST.contains(item2.getShowName())) {
if (Objects.isNull(statisticalDataDTO)) {
vo.setAvgValue(3.14159);
} else {
re = DataChangeUtil.secondaryToPrimary(item2.getPrimaryFormula(), statisticalDataDTO.getValue(), pt, ct) / 1000;
vo.setAvgValue(Double.valueOf(df.format(re)));
if(Objects.nonNull(item2.getPrimaryFormula())){
switch (item2.getPrimaryFormula()) {
case "*PT":
re = Objects.isNull(statisticalDataDTO) ? 3.14159 : statisticalDataDTO.getValue() * pt / 1000;
unit = "k" + item2.getUnit();
break;
case "*CT":
re = Objects.isNull(statisticalDataDTO) ? 3.14159 : statisticalDataDTO.getValue() * ct;
unit = item2.getUnit();
break;
case "*PT*CT":
re = Objects.isNull(statisticalDataDTO) ? 3.14159 : statisticalDataDTO.getValue() * pt * ct / 1000;
unit = "k" + item2.getUnit();
break;
default:
re = statisticalDataDTO.getValue();
unit = item2.getUnit();
break;
}
unit = "k" + item2.getUnit();
} else {
vo.setAvgValue(Objects.isNull(statisticalDataDTO) ? 3.14159 : Double.parseDouble(df.format(statisticalDataDTO.getValue())));
vo.setAvgValue(Double.valueOf(df.format(re)));
}else {
re = statisticalDataDTO.getValue();
unit = item2.getUnit();
vo.setAvgValue(Double.valueOf(df.format(re)));
}
}
} else {
if (Objects.equals("Primary",csDataSetLevel)) {
if (HarmonicConstant.POWER_LIST.contains(item2.getShowName())) {
if (Objects.isNull(statisticalDataDTO)) {
vo.setAvgValue(3.14159);
} else {
re = DataChangeUtil.primaryToSecondary(item2.getPrimaryFormula(), statisticalDataDTO.getValue(), pt, ct);
vo.setAvgValue(Double.valueOf(df.format(re)));
if(Objects.nonNull(item2.getPrimaryFormula())) {
switch (item2.getPrimaryFormula()) {
case "*PT":
re = Objects.isNull(statisticalDataDTO) ? 3.14159 : statisticalDataDTO.getValue() / pt;
break;
case "*CT":
re = Objects.isNull(statisticalDataDTO) ? 3.14159 : statisticalDataDTO.getValue() / ct;
break;
case "*PT*CT":
re = Objects.isNull(statisticalDataDTO) ? 3.14159 : statisticalDataDTO.getValue() / pt / ct / 1000;
break;
default:
re = statisticalDataDTO.getValue();
break;
}
} else {
vo.setAvgValue(Objects.isNull(statisticalDataDTO) ? 3.14159 : Double.parseDouble(df.format(statisticalDataDTO.getValue())));
vo.setAvgValue(Double.valueOf(df.format(re)));
}else {
re = statisticalDataDTO.getValue();
vo.setAvgValue(Double.valueOf(df.format(re)));
}
} else {
vo.setAvgValue(Objects.isNull(statisticalDataDTO) ? 3.14159 : Double.parseDouble(df.format(statisticalDataDTO.getValue())));