fix: calculate jt808 daily mileage from metric endpoints
This commit is contained in:
@@ -60,7 +60,7 @@ public final class JdbcVehicleStatMetricRepository implements VehicleStatReposit
|
||||
DailyMileageState existingState = findDailyMileageState(normalizedVin, date).orElse(null);
|
||||
double firstTotalMileage = existingState == null || !Double.isFinite(existingState.firstTotalMileageKm())
|
||||
? totalMileageKm
|
||||
: existingState.firstTotalMileageKm();
|
||||
: Math.min(existingState.firstTotalMileageKm(), totalMileageKm);
|
||||
double latestTotalMileage = existingState == null || !Double.isFinite(existingState.latestTotalMileageKm())
|
||||
? totalMileageKm
|
||||
: Math.max(existingState.latestTotalMileageKm(), totalMileageKm);
|
||||
|
||||
Reference in New Issue
Block a user