feat(chat): 更新发货任务处理逻辑和界面文本

- 移除不必要的状态引用
- 更新上传处理提示文本,使用国际化支持
- 扩展发货任务摘要接口,增加错误信息和短缺信息
- 更新多语言支持的文本,改善用户体验
- 增加批次工作区的汇总信息和操作提示
This commit is contained in:
hugo committed 2026-06-29 14:43:27 +08:00
1 parent 0b083cfdbd
commit 1fc9976ca3
60 files changed
+3876 -639

No files matched your search

+8 -3
View File
@@ -64,7 +64,7 @@ def enqueue(
message: 初始状态说明。
dedupe_active: 是否复用 active 状态的同业务任务。
correlation_id: 兼容旧接口;business_ref 为空时作为业务锚点。
scheduled_at: 预留参数,当前阶段不启用延迟调度。
scheduled_at: 未来时间则延迟到该时间后才可被 worker 领取。
"""
normalized_type = _normalize_job_type(job_type)
normalized_domain = str(domain or "").strip() or "default"
@@ -90,6 +90,7 @@ def enqueue(
return int(existing.id)
now = datetime.utcnow()
queue_at = scheduled_at if isinstance(scheduled_at, datetime) else now
job = Job(
domain=normalized_domain,
job_type=normalized_type,
@@ -102,7 +103,7 @@ def enqueue(
attempts=0,
max_attempts=max(1, int(max_attempts or 1)),
created_by_id=created_by_id,
created_at=now,
created_at=queue_at,
updated_at=now,
)
db.session.add(job)
@@ -156,7 +157,11 @@ def claim_next_job(*, domain: str, job_types: list[str | JobType] | None = None,
normalized_types = [_normalize_job_type(item) for item in (job_types or []) if _normalize_job_type(item)]
now = datetime.utcnow()
try:
query = db.session.query(Job).filter(Job.domain == domain, Job.status == "queued")
query = db.session.query(Job).filter(
Job.domain == domain,
Job.status == "queued",
Job.created_at <= now,
)
if normalized_types:
query = query.filter(Job.job_type.in_(normalized_types))
job = (