Commit de7a5d62 authored by ankh's avatar ankh

坡度比更正

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