소스 검색

王耀栋--工作台模块代码,修改打包下载功能,查询场景信息修改为同时查询已删除信息

wangyaodong 3 년 전
부모
커밋
280336e137

+ 10 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/project/impl/SimulationProjectServiceImpl.java

@@ -896,6 +896,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
 
             //平均速度
             Double pjsd = lc/time_list.get(time_list.size()-1);
+            pjsd = saveTwoDecimalPlaces(pjsd, 4);
 
             //最大速度
             Double zdsd = Collections.max(longitudinal_velocity_list);
@@ -918,6 +919,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
                 zcsdfc +=Math.pow(d-pjsd,2);
             }
             zcsdfc = zcsdfc/longitudinal_velocity_list.size();
+            zcsdfc = saveTwoDecimalPlaces(zcsdfc, 4);
 
             //自车横摆角速度均方根
             Double zchbjsdjfg = 0D;
@@ -925,6 +927,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
                 zchbjsdjfg += Math.pow(d-pjsd,2);
             }
             zchbjsdjfg = Math.sqrt(zchbjsdjfg/yawrate_list.size());
+            zchbjsdjfg = saveTwoDecimalPlaces(zchbjsdjfg, 4);
 
             for(int i=0; i<lateral_acceleration.size(); i++){
                 Double aDouble = lateral_acceleration.get(i);
@@ -1354,6 +1357,13 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         return new BigDecimal(d).setScale(2, RoundingMode.UP).doubleValue();
     }
 
+    private Double saveTwoDecimalPlaces(Double d, int num){
+        if(d == null){
+            return null;
+        }
+        return new BigDecimal(d).setScale(num, RoundingMode.UP).doubleValue();
+    }
+
     /**
      * 设置场景基本字段
      */