feat: 实现干扰指标最新小时入库

This commit is contained in:
2026-07-31 16:02:53 +08:00
parent 1c0f0eff62
commit dbe2024b6e
8 changed files with 344 additions and 18 deletions
+4 -2
View File
@@ -10,10 +10,12 @@
- NR CGI uses the source `masterOperatorId` unchanged. Confirm whether the final database should retain this source format or normalize it.
- Output CSV files use UTF-8 with BOM so they open correctly in Excel.
- Source files are read-only. The script writes only below its configured output directory.
- MySQL is the scheduled-run output. The table uses one `metric_time DATETIME` column containing the source KPI start time.
- A successful run transactionally refreshes the selected hour and deletes rows for all other hours. A selected hour older than the newest database hour is rejected to prevent data rollback.
## Pending user decisions
- Target database connection, database name, table name, and credentials.
- Target database host, database name, user, and credentials. The default table name is `interference_hourly_summary` and can be overridden.
- Whether the seven converted full CSV files must be retained after successful database import.
- Whether the `指标(计数器)` metadata sheet must also be stored.
- Final CGI normalization rules, especially for NR `masterOperatorId`.
@@ -23,4 +25,4 @@
## Mock boundary
Automated tests generate seven in-memory XLSX/ZIP sources plus a newer incomplete hour. The mock verifies complete-hour fallback, schema validation, CSV conversion, CGI extraction, summary merging, and cross-midnight windows. No mock credentials or fake database writes are present in production code.
Automated tests generate seven in-memory XLSX/ZIP sources plus a newer incomplete hour. The mock verifies complete-hour fallback, schema validation, CSV conversion, CGI extraction, summary merging, cross-midnight windows, transactional latest-hour replacement, and database rollback protection. No mock credentials or fake database writes are present in production code.