refactor: simplify jt808 daily mileage strategy

This commit is contained in:
lingniu
2026-07-01 08:01:12 +08:00
parent 59e8315fe6
commit 80d3afa80a
3 changed files with 12 additions and 21 deletions

View File

@@ -337,23 +337,18 @@ Validation:
### Daily Mileage
Preferred:
```text
dailyMileage = today.lastTotalMileage - previousDay.lastTotalMileage
```
Fallback:
JT808 daily mileage uses the GPS total mileage reported in location additional
information. The first valid sample of the local day is the baseline and the
latest valid total mileage rewrites the same metric row.
```text
dailyMileage = today.lastTotalMileage - today.firstTotalMileage
calculationMethod = JT808_TOTAL_MILEAGE_DIFF
```
Quality:
- `PREVIOUS_DAY_BASELINE` when previous day baseline exists;
- `INTRADAY_DELTA` when only same-day baseline exists;
- `INSUFFICIENT_DATA` when neither is reliable.
The result is stored in `vehicle_stat_metric` with
`metric_key=daily_mileage_km`. There is no JT808-specific daily mileage table,
no Redis mileage state, and no previous-day baseline calculation.
### Daily Power Consumption