Files
lingniu-vehicle-ingest/.codex-audit/station-cooperation-diagnosis/artifact.json
T

161 lines
6.6 KiB
JSON

{
"surface": "report",
"manifest": {
"version": 1,
"surface": "report",
"title": "合作加氢站数量口径诊断",
"description": "解释地图为何仍显示 88 座合作站,并给出统一口径建议。",
"generatedAt": "2026-08-03T23:13:59+08:00",
"charts": [
{
"id": "cooperation_count_comparison",
"title": "不同合作站点口径的数量对比",
"subtitle": "88 是旧关联口径;地图若切换到新版有效合作状态,应显示 131 座。",
"type": "bar",
"dataset": "countComparison",
"sourceId": "station_reconciliation_sql",
"encodings": {
"x": {
"field": "definition",
"type": "nominal",
"label": "统计口径"
},
"y": {
"field": "stationCount",
"type": "quantitative",
"label": "站点数"
}
},
"yAxisTitle": "站点数(座)",
"valueFormat": "number",
"layout": "full"
}
],
"sources": [
{
"id": "station_reconciliation_sql",
"label": "生产站点表只读对账",
"path": "queries/station-cooperation-reconciliation.sql"
},
{
"id": "open_platform_code",
"label": "开放平台合作站点查询实现",
"path": "vehicle-data-platform/apps/api/internal/openplatform/mysql.go"
}
],
"blocks": [
{
"id": "title",
"type": "markdown",
"body": "# 合作加氢站数量口径诊断"
},
{
"id": "executive_summary",
"type": "markdown",
"sourceId": "station_reconciliation_sql",
"body": "## Executive Summary\n\n页面的 **88 座**不是缓存,也不是本次导入失败,而是开放接口仍按旧表的内部站点关联是否存在来判断合作。新版站点表当前共有 **132 座**有效合作站,其中 **131 座**具备有效经纬度,可进入地图展示;本次文件中的 **87 座**均已在新版表生效。"
},
{
"id": "comparison_chart",
"type": "chart",
"chartId": "cooperation_count_comparison",
"layout": "full"
},
{
"id": "recommendation",
"type": "markdown",
"sourceId": "station_reconciliation_sql",
"body": "## 建议\n\n把开放接口的合作判断统一切换到新版权威口径:站点状态为“已签约”,且合作结束日期为空或不早于当天;地图展示还应要求经纬度有效。按当前生产数据,切换后合作站点应为 **131 座**。不建议长期使用名称匹配并集方案,因为站名差异会造成漏配或重复。"
},
{
"id": "caveats",
"type": "markdown",
"sourceId": "station_reconciliation_sql",
"body": "## 注意事项\n\n新版表有效坐标站点总数为 **450 座**,旧接口为 **448 座**;正式切换前应核对这 2 座差异。文件内 87 座站中,只有 76 座能按名称精确命中旧表,说明不能把名称关联当作长期主键。"
}
]
},
"snapshot": {
"version": 1,
"generatedAt": "2026-08-03T23:13:59+08:00",
"status": "ready",
"datasets": {
"summary": [
{
"legacyLinked": 88,
"authoritativeActive": 132,
"authoritativeWithCoordinates": 131,
"spreadsheetActive": 87,
"legacyValidCoordinates": 448,
"authoritativeValidCoordinates": 450,
"transitionalUnion": 140
}
],
"countComparison": [
{
"definition": "旧接口",
"stationCount": 88,
"meaning": "旧表 inner_site_id 非空;当前页面口径"
},
{
"definition": "新版有效",
"stationCount": 132,
"meaning": "新版表 SIGNED 且仍在有效期内"
},
{
"definition": "新版可展示",
"stationCount": 131,
"meaning": "建议地图采用的权威展示口径"
},
{
"definition": "过渡并集",
"stationCount": 140,
"meaning": "仅用于过渡评估,不建议长期采用"
}
]
}
},
"sources": [
{
"id": "station_reconciliation_sql",
"label": "生产站点表只读对账",
"path": "queries/station-cooperation-reconciliation.sql",
"query": {
"engine": "mysql",
"language": "sql",
"description": "对账旧接口关联口径、新版当前合作口径、有效坐标与名称匹配过渡口径。",
"executed_at": "2026-08-03T23:09:44+08:00",
"tables_used": [
"ln_asset_management.new_hydrogen_site",
"ln_asset_management.tab_outside_hydrogen_site"
],
"filters": [
"new_hydrogen_site.del_flag = '0'",
"合作有效期为空或不早于 CURDATE()",
"地图口径排除零坐标及越界坐标"
],
"metric_definitions": {
"旧接口已关联": "tab_outside_hydrogen_site 中有效坐标行且 inner_site_id IS NOT NULL 的数量。",
"新版当前合作": "new_hydrogen_site 中未删除、site_type='SIGNED' 且合作结束日期为空或不早于当天的数量。",
"新版合作且有坐标": "新版当前合作口径进一步要求经纬度合法且不同时为零。"
},
"sql": "SELECT COUNT(*) AS total, SUM(site_type='SIGNED' AND (cooperation_end_date IS NULL OR cooperation_end_date >= CURDATE())) AS current_cooperation, SUM(site_type='SIGNED' AND (cooperation_end_date IS NULL OR cooperation_end_date >= CURDATE()) AND longitude BETWEEN -180 AND 180 AND latitude BETWEEN -90 AND 90 AND NOT (longitude=0 AND latitude=0)) AS current_cooperation_with_coordinates FROM ln_asset_management.new_hydrogen_site WHERE del_flag='0'; SELECT COUNT(*) AS valid_coordinate_rows, SUM(inner_site_id IS NOT NULL) AS inner_site_linked_rows FROM ln_asset_management.tab_outside_hydrogen_site WHERE longitude BETWEEN -180 AND 180 AND latitude BETWEEN -90 AND 90 AND NOT (longitude=0 AND latitude=0);"
}
},
{
"id": "open_platform_code",
"label": "开放平台合作站点查询实现",
"path": "vehicle-data-platform/apps/api/internal/openplatform/mysql.go",
"query": {
"engine": "source-code",
"language": "go",
"description": "查询接口读取旧站点表,并以 inner_site_id 是否为空定义 cooperative。",
"executed_at": "2026-08-03T23:08:00+08:00",
"tables_used": [
"ln_asset_management.tab_outside_hydrogen_site"
]
}
}
]
}