fix(lab-sample): 恢复 Excel 真菌等补充字段并同步质检
纠正入库编码被误软删问题,恢复可关联样本的补充字段;列表接入质检填空,并补充间充质科研捐献接收行。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
c0aba421da
commit
e7b3876db6
4 files changed
+370
-17
No files matched your search
@@ -0,0 +1,30 @@
|
||||
"""恢复被误软删的 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()
|
||||
Reference in new issue
Block a user