Commit 826142f4 authored by ankh's avatar ankh

坡度比字段更正

parent e52ceb3d
......@@ -294,14 +294,14 @@ public class DbDataServiceImpl extends ServiceImpl<DbDataMapper, DbData> impleme
&& !record.getSafeheight().equals("0")) {
try {
double lenthValue = Double.parseDouble(record.getLenth());
double safeheightValue = Double.parseDouble(record.getSafeheight());
double result = (safeheightValue / lenthValue) * 1000;
record.setAngle(String.format("%.4f", result)); // 存入 angle 字段
double aDouble = Double.parseDouble(record.getAngle());
double result = (aDouble / lenthValue) * 1000;
record.setSafeheight(String.format("%.4f", result)); // 存入 angle 字段
} catch (NumberFormatException e) {
record.setAngle(null);
record.setSafeheight(null);
}
} else {
record.setAngle(null);
record.setSafeheight(null);
}
}
......
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