feat(shipping_notice): 添加重新上传发货通知功能
- 新增接口支持覆盖当前任务的发货通知 - 重新解析时重置任务状态,避免重复任务 - 增加库存 RPA 等待时间的复查逻辑 - 更新状态机以处理文本抽取失败的情况 - 增强测试用例以覆盖新功能
This commit is contained in:
1 parent
f434402530
commit
7f1d5dfbcd
20 files changed
+691
-26
No files matched your search
@@ -167,6 +167,28 @@ export async function createWorkspaceShippingTaskFromNotice(file: File, conversa
|
||||
return body;
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新上传发货通知并覆盖当前任务。
|
||||
* @param taskNo - 需要覆盖的发货任务编号
|
||||
* @param file - 新的发货通知文件
|
||||
* @returns 覆盖后的任务状态与后台编排结果
|
||||
*/
|
||||
export async function replaceWorkspaceShippingTaskNotice(taskNo: string, file: File) {
|
||||
const form = new FormData();
|
||||
form.append('file', file);
|
||||
const headers = getAuthHeaders();
|
||||
delete (headers as Record<string, string>)['Content-Type'];
|
||||
const res = await fetch(
|
||||
`/api/workspace/shipping-tasks/${encodeURIComponent(taskNo)}/replace-notice`,
|
||||
{ method: 'POST', headers, body: form },
|
||||
);
|
||||
const body = (await res.json().catch(() => ({}))) as ShippingNoticeUploadResponse & { error?: string };
|
||||
if (!res.ok || body.status === 'failed') {
|
||||
throw new Error(body.error || body.message || res.statusText);
|
||||
}
|
||||
return body;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量上传多份发货通知并创建批次。
|
||||
* @param files - 发货通知附件列表
|
||||
|
||||
Reference in new issue
Block a user