plan_helpers.py 386 B

1234567891011121314
  1. """地磅计划辅助函数。"""
  2. from __future__ import annotations
  3. from datetime import datetime
  4. def generate_plan_no() -> str:
  5. """生成计划号:SX-YYYYMMDDHHMMSS001"""
  6. now = datetime.now()
  7. return f"SX-{now.strftime('%Y%m%d%H%M%S')}001"
  8. def default_execution_status(business_type: str) -> str:
  9. return "待入库" if business_type == "入库" else "待出库"