feat(freight-rpa): 系统连接只保留上传开关并增加 Crane 一次回查

上传页、按钮和成功判断改由连接器固定。Crane 分配中只排一次 10 分钟状态回查,手动刷新不改到期时间。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hugoandCursor committed 2026-10-23 12:20:29 +08:00
1 parent 95e7db0831
commit 3bb9938c05
33 files changed
+878 -374

No files matched your search

@@ -1951,16 +1951,19 @@ def list_freight_notice_groups_for_task(
.first()
)
from app.services.shipping_notice.upload_attempt_service import project_notice_upload_status
projected_upload_status = project_notice_upload_status(notice)
hide_allocating_error = projected_upload_status == 'allocating'
items.append({
'business_no': business_no,
'po_number': po_number,
# Notice 面契约:成功统一为 uploaded,禁止下发 Attempt 原词 succeeded。
'upload_status': project_notice_upload_status(notice),
'upload_status': projected_upload_status,
'upload_mode': upload_mode,
'upload_attempt': upload_attempt,
'upload_error_code': getattr(latest_attempt, 'error_code', None),
'upload_error_code': None if hide_allocating_error else getattr(latest_attempt, 'error_code', None),
# 逐单失败原因:优先取最近一次上传的错误正文,回退到任务级 error_message。
'upload_error_message': (getattr(latest_attempt, 'error_message', None) or '')[:500] or None,
# 分配中的内部错误码不是失败原因,不能把这一行显示成需人工。
'upload_error_message': None if hide_allocating_error else ((getattr(latest_attempt, 'error_message', None) or '')[:500] or None),
'export_file_name': getattr(artifact, 'file_name', None),
'available_actions': available_actions,
'lines': _notice_line_summary_for_task(notice),