Commit de7a5d62 authored by ankh's avatar ankh

坡度比更正

parent 826142f4
......@@ -288,22 +288,22 @@ public class DbDataServiceImpl extends ServiceImpl<DbDataMapper, DbData> impleme
dbDataPage = dbDataMapper.selectPage(dbDataPage, dbDataQueryWrapper);
List<DbData> records = dbDataPage.getRecords();
// 插入计算 lenth / safeheight * 1000 并 setAngle 的逻辑
for (DbData record : records) {
if (record.getLenth() != null && record.getSafeheight() != null
&& !record.getSafeheight().equals("0")) {
try {
double lenthValue = Double.parseDouble(record.getLenth());
double aDouble = Double.parseDouble(record.getAngle());
double result = (aDouble / lenthValue) * 1000;
record.setSafeheight(String.format("%.4f", result)); // 存入 angle 字段
} catch (NumberFormatException e) {
record.setSafeheight(null);
}
} else {
record.setSafeheight(null);
}
}
// // 插入计算 lenth / safeheight * 1000 并 setAngle 的逻辑
// for (DbData record : records) {
// if (record.getLenth() != null && record.getSafeheight() != null
// && !record.getSafeheight().equals("0")) {
// try {
// double lenthValue = Double.parseDouble(record.getLenth());
// double aDouble = Double.parseDouble(record.getAngle());
// double result = (aDouble / lenthValue) * 1000;
// record.setSafeheight(String.format("%.4f", result)); // 存入 angle 字段
// } catch (NumberFormatException e) {
// record.setSafeheight(null);
// }
// } else {
// record.setSafeheight(null);
// }
// }
long total = dbDataPage.getTotal();
//获取编码-名字map
......
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