feat(in-transit-transfer): 增强调拨类型管理与调度逻辑

- 新增批量获取最新可用入站文件的功能,支持按来源主键集合查询。
- 实现失效入站来源编码的批量查询,优化调拨状态投影。
- 更新调拨任务调度逻辑,支持动态选择调拨类型,留空时默认为全部启用类型。
- 调整相关文档,确保调拨类型配置的清晰性与一致性。
This commit is contained in:
hugo committed 2026-10-26 17:36:14 +08:00
1 parent 3bb9938c05
commit 0331029ead
11 files changed
+609 -150

No files matched your search

+17 -1
View File
@@ -5,7 +5,8 @@ backend/app/services/schedule/job_options.py
依赖:models.Agent、shipping_notice.onhand_source_repository。
逻辑:api/schedule/platform_tasks.py options 接口与 job_params 选项范围校验调用;
前端只认识 options_source 字符串,不感知数据来自哪张表/哪个配置文件。
货代 RPA 注册键为 freight_rpa_sources、freight_rpa_inbound_sources 与 freight_rpa_outbound_sources。
货代 RPA 注册键为 freight_rpa_sources、freight_rpa_inbound_sources 与 freight_rpa_outbound_sources;
在途调拨注册键为 transfer_types(启用中的调拨类型配置)。
"""
from __future__ import annotations
@@ -78,6 +79,20 @@ def _freight_rpa_outbound_sources_options() -> list[dict[str, Any]]:
} for source, _config in rows]
def _transfer_types_options() -> list[dict[str, Any]]:
"""启用中的调拨类型(value=类型编码;供在途自动调拨排程选类型,留空=全部)。"""
from app.services.in_transit_transfer.transfer_type_config_service import get_enabled
return [
{
"label": (dto.names or {}).get("zh-CN") or dto.code,
"value": dto.code,
"description": dto.description or None,
}
for dto in get_enabled()
]
def _hxops_users_options() -> list[dict[str, Any]]:
"""全部启用用户(value=users.id);订单交期回复未回复提醒收件人等场景用。"""
from app.models import User
@@ -118,6 +133,7 @@ _OPTIONS_PROVIDERS: dict[str, Callable[[], list[dict[str, Any]]]] = {
"freight_rpa_sources": _freight_rpa_sources_options,
"freight_rpa_inbound_sources": _freight_rpa_inbound_sources_options,
"freight_rpa_outbound_sources": _freight_rpa_outbound_sources_options,
"transfer_types": _transfer_types_options,
"hxops_users": _hxops_users_options,
"users": _users_options,
}