feat(turnstile): двухконтурный учет СКУД, реестры исключений с автокомплитом 1С и калибровка таймзон

This commit is contained in:
2026-09-10 15:36:32 +03:00
parent 6c9b131cf2
commit 74332aa38a
31 changed files with 4509 additions and 10769 deletions
+23 -6
View File
@@ -2,7 +2,7 @@
"""
===============================================================================
FILE: scripts/diagnostics/make_etl_snapshot.py
ROLE: Генерация компактного слепка ETL-конвейера, БД и сервисов СКУД.
ROLE: Генерация компактного слепка ETL-конвейера, генераторов отчетов и БД.
===============================================================================
"""
@@ -11,30 +11,42 @@ import os
ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
OUTPUT_FILE = os.path.join(ROOT_DIR, "etl_code_snapshot.md")
# Строгий целевой список файлов для ETL-слепка
TARGET_FILES = [
# Конфигурация и точка входа
"config.py",
"exceptions.json",
"main_etl.py",
"run_cron_etl.sh",
"scripts/db_cli.py", # ⭐️ Гарантированно включен
"scripts/db_cli.py",
# Крон скрипты
"scripts/cron/run_hourly_snapshot.sh",
"scripts/cron/run_reports_only.sh",
"scripts/cron/run_cron_etl.sh",
# Ядро БД
"core/connection.py",
"core/database.py",
"core/schema.py",
"core/repositories/scud_repo.py",
"core/repositories/zup_repo.py",
# Сервисный слой загрузки и реестров
"services/data_loader.py",
"services/scud_export.py",
"services/share_copier.py",
"services/excel_exporter.py",
"services/text_reporter.py",
"services/exceptions_repo.py",
"services/manual_absences_repo.py",
"services/zup_extractor.py",
"services/ai_verifier.py",
"services/knowledge_base.py",
"services/knowledge/service.py",
# Модули сборки Сводки и Отчета
"services/scud_etl/pipeline.py",
"services/scud_etl/merger.py",
"services/scud_etl/svodka_generator.py",
"services/scud_etl/otchet_generator.py",
"services/scud_etl/anomaly_detector.py",
"services/snapshots/service.py",
"services/tasks/repository.py",
@@ -50,7 +62,12 @@ def create_etl_snapshot():
full_path = os.path.join(ROOT_DIR, rel_path)
if os.path.exists(full_path):
ext = os.path.splitext(rel_path)[1].replace(".", "")
lang = "py" if ext == "py" else ("json" if ext == "json" else "bash")
lang_map = {
"py": "py",
"json": "json",
"sh": "bash"
}
lang = lang_map.get(ext, "text")
try:
with open(full_path, "r", encoding="utf-8") as f:
file_text = f.read()