refactor: store jt808 mileage as metric diff

This commit is contained in:
lingniu
2026-07-01 02:32:46 +08:00
parent a5f5cc94ee
commit b94780b48c
12 changed files with 73 additions and 40 deletions

View File

@@ -8,11 +8,11 @@ Consume JT808 Kafka location events, keep rolling daily state, and write the der
- Source topic: `vehicle.event.jt808.v1`
- Runtime app: `vehicle-analytics-app`
- State: Redis or in-memory `Jt808MileageStateStore`
- Runtime state: Redis `Jt808MileageStateStore`
- Metric output: `VehicleStatRepository.saveDailyStat(...)`
- Production metric storage: JDBC/MySQL `vehicle_stat_metric`
- Local fallback storage: `VEHICLE_STAT_FILE_PATH/daily-stats.tsv`
- Date boundary: `Asia/Shanghai`
- Calculation method: `JT808_TOTAL_MILEAGE_DIFF`
JT808 daily mileage is calculated only from the GPS total mileage reported by JT808 location additional information: