feat(file-check): 更新文件检核工具 API Key 配置及相关文档
This commit is contained in:
1 parent
634dee4b81
commit
55cf7ff734
74 files changed
+1525
-1182
No files matched your search
@@ -25,10 +25,12 @@ def _path(key: str) -> Path | None:
|
||||
|
||||
|
||||
def inventory_drop_dir() -> Path | None:
|
||||
"""RPA 库存 Excel 落盘目录(FREIGHT_INVENTORY_DROP_DIR)。"""
|
||||
return _path("FREIGHT_INVENTORY_DROP_DIR")
|
||||
|
||||
|
||||
def inventory_processed_dir() -> Path | None:
|
||||
"""已处理库存文件归档子目录(drop_dir/processed)。"""
|
||||
base = inventory_drop_dir()
|
||||
if not base:
|
||||
return None
|
||||
@@ -36,18 +38,27 @@ def inventory_processed_dir() -> Path | None:
|
||||
|
||||
|
||||
def inventory_trigger_dir() -> Path | None:
|
||||
"""RPA 库存导出触发 JSON 目录。"""
|
||||
return _path("FREIGHT_RPA_INVENTORY_TRIGGER_DIR")
|
||||
|
||||
|
||||
def upload_queue_dir() -> Path | None:
|
||||
"""货代上传 Excel 队列目录(RPA 从此处读取待上传文件)。"""
|
||||
return _path("FREIGHT_UPLOAD_QUEUE_DIR")
|
||||
|
||||
|
||||
def upload_trigger_dir() -> Path | None:
|
||||
"""RPA 货代上传触发 JSON 目录。"""
|
||||
return _path("FREIGHT_RPA_UPLOAD_TRIGGER_DIR")
|
||||
|
||||
|
||||
def write_inventory_export_trigger(task_no: str, payload: dict[str, Any] | None = None) -> str | None:
|
||||
"""
|
||||
写入 RPA 库存导出触发文件 inventory_export_{task_no}.json。
|
||||
|
||||
Returns:
|
||||
str | None: 触发文件绝对路径;目录未配置时返回 None。
|
||||
"""
|
||||
trigger_dir = inventory_trigger_dir()
|
||||
if not trigger_dir:
|
||||
return None
|
||||
@@ -64,6 +75,12 @@ def write_inventory_export_trigger(task_no: str, payload: dict[str, Any] | None
|
||||
|
||||
|
||||
def write_upload_trigger(task_no: str, export_file_path: str, payload: dict[str, Any] | None = None) -> tuple[str | None, str | None]:
|
||||
"""
|
||||
复制 Excel 至上传队列并写入 RPA 上传触发 JSON。
|
||||
|
||||
Returns:
|
||||
tuple[str | None, str | None]: (queue 文件路径, trigger 文件路径);失败时 (None, None)。
|
||||
"""
|
||||
queue = upload_queue_dir()
|
||||
trigger_dir = upload_trigger_dir()
|
||||
if not queue or not trigger_dir:
|
||||
@@ -90,6 +107,7 @@ def write_upload_trigger(task_no: str, export_file_path: str, payload: dict[str,
|
||||
|
||||
|
||||
def find_latest_inventory_file() -> Path | None:
|
||||
"""在 drop 目录中查找最新修改的 xlsx/xls/csv 库存文件。"""
|
||||
drop = inventory_drop_dir()
|
||||
if not drop or not drop.is_dir():
|
||||
return None
|
||||
|
||||
Reference in new issue
Block a user