代码优化

This commit is contained in:
xy
2025-01-08 15:44:26 +08:00
parent 81da6e54ca
commit 2df06d9597

View File

@@ -243,11 +243,11 @@ public class DataServiceImpl implements IDataService {
unit = "k" + item2.getUnit();
break;
default:
re = statisticalDataDTO.getValue();
re = Objects.isNull(statisticalDataDTO) ? 3.14159 : statisticalDataDTO.getValue();
unit = item2.getUnit();
break;
}
vo.setAvgValue(Double.valueOf(df.format(re)));
vo.setAvgValue(Objects.equals(re,3.14159) ? 3.14159 : Double.parseDouble(df.format(re)));
}else {
if (Objects.nonNull(statisticalDataDTO)) {
re = statisticalDataDTO.getValue();
@@ -270,10 +270,10 @@ public class DataServiceImpl implements IDataService {
re = Objects.isNull(statisticalDataDTO) ? 3.14159 : statisticalDataDTO.getValue() / pt / ct / 1000;
break;
default:
re = statisticalDataDTO.getValue();
re = Objects.isNull(statisticalDataDTO) ? 3.14159 : statisticalDataDTO.getValue();
break;
}
vo.setAvgValue(Double.valueOf(df.format(re)));
vo.setAvgValue(Objects.equals(re,3.14159) ? 3.14159 : Double.parseDouble(df.format(re)));
}else {
if (Objects.nonNull(statisticalDataDTO)) {
re = statisticalDataDTO.getValue();