代码优化
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user