Commit 1443df53 authored by duwei's avatar duwei

停车次数精确到小数两位

parent a07ba048
...@@ -1563,7 +1563,9 @@ public class TrendServiceImpl implements TrendService { ...@@ -1563,7 +1563,9 @@ public class TrendServiceImpl implements TrendService {
// vo.setEfficiencyEvaluateLevel(0.0); // vo.setEfficiencyEvaluateLevel(0.0);
Double stopTimes = po.getStopTimes(); Double stopTimes = po.getStopTimes();
vo.setStopTimes(Math.round(stopTimes *100)/100.0); if (stopTimes != null) {
vo.setStopTimes(Math.round(stopTimes * 100) / 100.0);
}
Double vehheadTime = po.getVehheadTime(); Double vehheadTime = po.getVehheadTime();
vo.setVehheadTime(Math.round(vehheadTime*100)/100.0); vo.setVehheadTime(Math.round(vehheadTime*100)/100.0);
//饱和度 sturation //饱和度 sturation
...@@ -1692,7 +1694,9 @@ public class TrendServiceImpl implements TrendService { ...@@ -1692,7 +1694,9 @@ public class TrendServiceImpl implements TrendService {
Double queueLength = po.getQueueLength(); Double queueLength = po.getQueueLength();
vo.setQueueLength(Math.round(queueLength *100)/100.0); vo.setQueueLength(Math.round(queueLength *100)/100.0);
Double stopTimes = po.getStopTimes(); Double stopTimes = po.getStopTimes();
vo.setStopTimes(Math.round(stopTimes*100)/100.0); if (stopTimes != null) {
vo.setStopTimes(Math.round(stopTimes * 100) / 100.0);
}
if (po.getVehheadTime() != null) { if (po.getVehheadTime() != null) {
vo.setVehheadTime(Math.round(po.getVehheadTime()*100)/100.0); vo.setVehheadTime(Math.round(po.getVehheadTime()*100)/100.0);
}else { }else {
...@@ -1847,7 +1851,9 @@ public class TrendServiceImpl implements TrendService { ...@@ -1847,7 +1851,9 @@ public class TrendServiceImpl implements TrendService {
Double queueLength = po.getQueueLength(); Double queueLength = po.getQueueLength();
vo.setQueueLength(Math.round(queueLength*100)/100.0); vo.setQueueLength(Math.round(queueLength*100)/100.0);
Double stopTimes = po.getStopTimes();//停车次数 Double stopTimes = po.getStopTimes();//停车次数
vo.setStopTimes( Math.round(stopTimes *100)/100.0); if (stopTimes != null) {
vo.setStopTimes(Math.round(stopTimes * 100) / 100.0);
}
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
// if (po.getId().contains(crossId.concat(Constants.SystemParam.SEPARATOR_MINUS))) { // if (po.getId().contains(crossId.concat(Constants.SystemParam.SEPARATOR_MINUS))) {
...@@ -3326,4 +3332,9 @@ public class TrendServiceImpl implements TrendService { ...@@ -3326,4 +3332,9 @@ public class TrendServiceImpl implements TrendService {
} }
} }
public static void main(String[] args) {
double v = Math.round(1 * 100) / 100.0;
System.out.println(v);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment