feat: sync vehicle monitoring and accumulated platform updates
Add monitoring metrics, numeric sorting, report-time display, vehicle number labels, and map layout fixes. Include accumulated mileage, hydrogen, OneOS authentication, open platform, ingestion, deployment, and UI updates. Exclude temporary files, generated reports, and credentials. Validate frontend 632 tests and production build, API packages, vehicle-map tests, and release installer tests. Gateway suite has one pre-existing date-sensitive identity throttling test failure reproduced on the parent commit.
This commit is contained in:
@@ -132,6 +132,16 @@ vin,modelName,vehicleType,companyName,operationStatus,accessProvider,firstAccess
|
||||
|
||||
`/api/vehicles/detail` remains available as a compatibility alias. New UI and integrations should use `/api/vehicle-service` to make the vehicle-first boundary explicit.
|
||||
|
||||
The live vehicle workspace sends `includeHistory=0`. It receives identity,
|
||||
profile, business relation, quality and realtime sources without querying
|
||||
historical location, RAW or mileage previews or probing historical source
|
||||
availability. `historyIncluded=false` distinguishes omitted previews from
|
||||
empty history. Omitting the parameter preserves the full-detail response and
|
||||
returns `historyIncluded=true`; historical authorization checks still apply.
|
||||
Latest telemetry allows at most one second for optional historical RAW
|
||||
enrichment, then returns the durable latest projection for any slow source.
|
||||
Frame IDs and timestamps retain their actual evidence and freshness.
|
||||
|
||||
`sourceConsistency` is the vehicle-level diagnosis across GB32960, JT808, and Yutong MQTT sources. The three protocols are source evidence for one vehicle service, so callers should display the diagnosis result instead of asking users to compare protocol rows manually.
|
||||
|
||||
```json
|
||||
@@ -162,6 +172,12 @@ GET /api/realtime/vehicles?keyword=粤AG18312&protocol=JT808&online=online&servi
|
||||
|
||||
Returns VIN-level realtime rows with canonical vehicle-level `serviceStatus`. Protocol is a source filter, not a product boundary.
|
||||
|
||||
The monitor list sends `includeEnergy=1` to include available `hydrogenPressureMpa`, `hydrogenMassKg`, and `hydrogenConsumptionKgPer100Km`. Inputs come from the durable latest GB32960 projection for vehicles on the current authorized page, fetched in batches of at most 200 VINs; map requests do not load this payload. Pressure uses `gb32960.fuel_cell.max_hydrogen_pressure_mpa` (the maximum reported probe pressure), and consumption uses `gb32960.fuel_cell.hydrogen_consumption_kg_per_100km` (the vehicle-reported rate in kg/100km, not the daily SOC-balanced statistic). Remaining mass **always** uses the existing real-gas pressure/temperature conversion with that VIN’s active `vehicle_hydrogen_tank_capacity.tank_capacity_l` (total water volume). All directly reported kg fields are ignored, including zero or invalid readings. No default volume or temperature is assumed; missing or invalid calculation inputs leave kg unavailable with no fallback to reported or previous mass. Valid zero pressure produces zero kg. Available mass has `hydrogenMassSource=ESTIMATED`, and the UI labels estimates. Battery SOC remains `socPercent` with `socAvailable` controlling availability.
|
||||
|
||||
The list accepts `sort=speedKmh|lastSeen|todayMileageKm|totalMileageKm|socPercent|hydrogenPressureMpa` and `sortOrder=asc|desc` for numeric or chronological (`lastSeen`) ordering of all authorized matching vehicles before `limit`/`offset` pagination. Hydrogen ordering uses the MPa pressure value, independent of kg; invalid/missing values sort last in both directions, and equal values use ascending VIN order. `sort=identity` retains the existing plate/VIN ordering. Only the six listed sort keys are accepted, and directions other than `desc` default to ascending. The UI resets to the first page when the selected sort changes and preserves the choice in its monitor URL and vehicle return links.
|
||||
|
||||
Durable energy fields may contain JSON numbers or decimal numeric strings. Both forms are normalized to numeric response values and use the same numeric ordering; nonnumeric strings, booleans, negative values, and missing values remain unavailable.
|
||||
|
||||
### Vehicle Coverage
|
||||
|
||||
```http
|
||||
@@ -498,3 +514,13 @@ Existing callers may still send `vin`. The BFF treats `vin` as a vehicle lookup
|
||||
- Positive subsecond intervals remain continuous telemetry even when their displayed whole-second duration rounds to zero; only invalid/non-increasing timestamps or intervals over ten minutes become `gap`.
|
||||
- Sampling preserves the route endpoints, event points, stop centers and every retained segment boundary. `sampledIndex` fields point directly into the returned `points` array; clients must not approximate an original index by ratio when this field is present.
|
||||
- Playback points and events carry synchronized speed, SOC availability/value, direction and alarm fields. The browser resolves only the paused/current coordinate through the cached reverse-geocode endpoint; playback never triggers one address request per point.
|
||||
|
||||
For pressure sorting with `includeEnergy=1`, the same database statement returns the snapshot payload used by `ORDER BY`, so a live update between sorting and value hydration cannot change the displayed pressure out of order. Mileage sorting honors the corresponding availability flag and casts the selected projection to a number before sorting.
|
||||
|
||||
The monitor list displays `氢气压力(MPa)` and `剩余氢量(Kg)` in separate columns. Speed, report time, pressure, today mileage, total mileage, and SOC support sorting; kg is display-only. Fresh monitor URLs default to `hydrogenPressureMpa` ascending. Explicit URL sorting remains preserved on reload and return navigation.
|
||||
|
||||
The monitor list uses `lastSeen` for the report-time column. Zone-less timestamps are interpreted as Asia/Shanghai. For the current Beijing calendar day, elapsed time under one hour displays `实时`, otherwise whole hours display `x小时前`; the preceding calendar day displays `昨天`, and earlier days display `x天前`. Hover shows `yyyy-MM-dd HH:mm:ss` in Beijing time; missing/invalid timestamps display `—`. Relative labels refresh once per minute even without telemetry changes.
|
||||
|
||||
Report-time colors: `实时` is green; other times today and `昨天` are yellow; older or unavailable report times are red. The text and full hover timestamp remain available alongside color.
|
||||
|
||||
Report-time badges retain the relative text, freshness colors and exact hover timestamp. Clicking a valid badge opens the full `yyyy-MM-DD HH:mm:ss` timestamp in Beijing time; Escape, outside click, or the close button dismisses it. Missing timestamps have no detail trigger.
|
||||
|
||||
Reference in New Issue
Block a user