纠正入库编码被误软删问题,恢复可关联样本的补充字段;列表接入质检填空,并补充间充质科研捐献接收行。 Co-authored-by: Cursor <cursoragent@cursor.com>
31 lines
784 B
Python
31 lines
784 B
Python
"""恢复被误软删的 Excel 补充字段(真菌/内毒素/CD34 等)并同步旧台账。
|
|
|
|
用法:
|
|
ENV_FILE=.../backend/.env python backend/scripts/restore_lab_sample_processing_excel_extras.py
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
BACKEND = ROOT / "backend"
|
|
if str(BACKEND) not in sys.path:
|
|
sys.path.insert(0, str(BACKEND))
|
|
|
|
from app.core.database import SessionLocal # noqa: E402
|
|
from app.services.lab_sample_processing import restore_retired_excel_extras # noqa: E402
|
|
|
|
|
|
def main() -> None:
|
|
db = SessionLocal()
|
|
try:
|
|
result = restore_retired_excel_extras(db, tenant_no="zkxw")
|
|
print(result)
|
|
finally:
|
|
db.close()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|