代码提交点位地图1

This commit is contained in:
lilin 2025-07-31 14:24:29 +08:00
parent d145df182a
commit 694e16240c

View File

@ -5461,8 +5461,12 @@ public class TsFilesServiceImpl extends ServiceImpl<TsFilesMapper, TsFiles> impl
// 假设 UtcTime String 类型首先转换为 double 类型
double time1 = Double.parseDouble(data1.getUtcTime()); // 如果 getUtcTime() 返回 String 类型
double time2 = Double.parseDouble(data2.getUtcTime()); // 如果 getUtcTime() 返回 String 类型
// 保留小数点后六位
double formattedTime1 = Double.parseDouble(String.format("%.6f", time1));
double formattedTime2 = Double.parseDouble(String.format("%.6f", time2));
// 计算差值
double diff = time2 - time1;
double diff = formattedTime2 - formattedTime1;
// 确保差值不为零以避免除以零错误
if (diff != 0) {
result = (int) Math.floor(1 / diff);