feat(shipping-notice): 实现对话级批量重试自动推进功能,优化库存与PDF匹配逻辑
- 新增对话级批量重试自动推进的完整链路:后端服务、API、数据投影逻辑 - 前端新增对话级重试按钮、多语言国际化支持与API类型定义 - 优化行级库存重试控制,新增retryable字段统一管控重试按钮展示,清理废弃的view_fulfillment_detail动作,标准化前端动作码排序逻辑 - 修复PDF坐标匹配的fail-close防护逻辑,避免生成伪精确匹配分数 - 调整订单确认后流程,提前进入库存获取阶段,移除冗余的确认建单按钮,优化用户流转体验 - 新增对应单元测试用例覆盖核心业务逻辑
This commit is contained in:
1 parent
fd6a23f870
commit
1008911a7e
41 files changed
+3956
-1256
No files matched your search
@@ -441,6 +441,40 @@ export const retryWorkspaceShippingOrderStpAutoCreate = (caseNo: string) =>
|
||||
{ method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({}) },
|
||||
);
|
||||
|
||||
/**
|
||||
* 对话级「重试自动推进」:服务端扫描会话下可恢复 Case/正式 OT。
|
||||
* 核心逻辑:前端不提交对象列表;返回 summary + 逐对象 items。
|
||||
* @param conversationId - 会话 ID
|
||||
* @param reason - 可选原因码
|
||||
*/
|
||||
export const retryWorkspaceConversationAutoProgress = (
|
||||
conversationId: string,
|
||||
reason = 'user_retry_auto_progress',
|
||||
) =>
|
||||
requestJson<{
|
||||
conversation_id: string;
|
||||
summary: {
|
||||
total: number;
|
||||
retried: number;
|
||||
skipped: number;
|
||||
failed: number;
|
||||
};
|
||||
items: Array<{
|
||||
object_type: 'review_case' | 'formal_task' | string;
|
||||
object_ref: string;
|
||||
action?: string | null;
|
||||
outcome: 'queued' | 'skipped' | 'failed' | string;
|
||||
reason_code?: string | null;
|
||||
}>;
|
||||
}>(
|
||||
`/api/workspace/shipping-conversations/${encodeURIComponent(conversationId)}/retry-auto-progress`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ reason }),
|
||||
},
|
||||
);
|
||||
|
||||
/**
|
||||
* 为复核明细人工选定一个或多个已启用库存源候选。
|
||||
* 核心逻辑:携带 expected_draft_version 乐观锁;服务端写入行级 inventory_routing 后重跑资格校验。
|
||||
@@ -1034,7 +1068,21 @@ export async function replaceWorkspaceShippingTaskNotice(taskNo: string, file: F
|
||||
export async function retryWorkspaceShippingTask(taskNo: string, comment?: string) {
|
||||
const body = await requestJson<ShippingDecisionResponse & ShippingApiStatusPayload>(
|
||||
`/api/workspace/shipping-tasks/${encodeURIComponent(taskNo)}/retry`,
|
||||
jsonPost(comment ? { comment } : {}),
|
||||
jsonPost(comment ? { comment, reason: comment } : { reason: 'user_retry' }),
|
||||
);
|
||||
return assertShippingOk(body);
|
||||
}
|
||||
|
||||
/**
|
||||
* 行级统一「重试」:后端决策器选择 fetch/rematch/needs_human。
|
||||
* 核心逻辑:前端不传内部动作码。
|
||||
* @param taskNo - 正式任务号
|
||||
* @param lineKey - 行键
|
||||
*/
|
||||
export async function retryWorkspaceShippingTaskLine(taskNo: string, lineKey: string) {
|
||||
const body = await requestJson<ShippingDecisionResponse & ShippingApiStatusPayload>(
|
||||
`/api/workspace/shipping-tasks/${encodeURIComponent(taskNo)}/lines/${encodeURIComponent(lineKey)}/retry`,
|
||||
jsonPost({ reason: 'user_retry_inventory' }),
|
||||
);
|
||||
return assertShippingOk(body);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user