代码优化
This commit is contained in:
@@ -243,11 +243,11 @@ public class DataServiceImpl implements IDataService {
|
|||||||
unit = "k" + item2.getUnit();
|
unit = "k" + item2.getUnit();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
re = statisticalDataDTO.getValue();
|
re = Objects.isNull(statisticalDataDTO) ? 3.14159 : statisticalDataDTO.getValue();
|
||||||
unit = item2.getUnit();
|
unit = item2.getUnit();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
vo.setAvgValue(Double.valueOf(df.format(re)));
|
vo.setAvgValue(Objects.equals(re,3.14159) ? 3.14159 : Double.parseDouble(df.format(re)));
|
||||||
}else {
|
}else {
|
||||||
if (Objects.nonNull(statisticalDataDTO)) {
|
if (Objects.nonNull(statisticalDataDTO)) {
|
||||||
re = statisticalDataDTO.getValue();
|
re = statisticalDataDTO.getValue();
|
||||||
@@ -270,10 +270,10 @@ public class DataServiceImpl implements IDataService {
|
|||||||
re = Objects.isNull(statisticalDataDTO) ? 3.14159 : statisticalDataDTO.getValue() / pt / ct / 1000;
|
re = Objects.isNull(statisticalDataDTO) ? 3.14159 : statisticalDataDTO.getValue() / pt / ct / 1000;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
re = statisticalDataDTO.getValue();
|
re = Objects.isNull(statisticalDataDTO) ? 3.14159 : statisticalDataDTO.getValue();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
vo.setAvgValue(Double.valueOf(df.format(re)));
|
vo.setAvgValue(Objects.equals(re,3.14159) ? 3.14159 : Double.parseDouble(df.format(re)));
|
||||||
}else {
|
}else {
|
||||||
if (Objects.nonNull(statisticalDataDTO)) {
|
if (Objects.nonNull(statisticalDataDTO)) {
|
||||||
re = statisticalDataDTO.getValue();
|
re = statisticalDataDTO.getValue();
|
||||||
|
|||||||
Reference in New Issue
Block a user