feat(shipping-notice): 增加发货通知建单幂等性支持及内容哈希校验
This commit is contained in:
1 parent
0a9bd6415d
commit
143e054d86
39 files changed
+1750
-80
No files matched your search
@@ -222,15 +222,30 @@ export async function replaceWorkspaceShippingTaskNotice(taskNo: string, file: F
|
||||
* @param conversationId - 可选会话 ID
|
||||
* @returns 批次与任务创建结果
|
||||
*/
|
||||
export async function createWorkspaceShippingBatchFromNotices(files: File[], conversationId?: string) {
|
||||
export async function createWorkspaceShippingBatchFromNotices(
|
||||
files: File[],
|
||||
conversationId?: string,
|
||||
idempotencyKey?: string,
|
||||
) {
|
||||
const form = new FormData();
|
||||
files.forEach((file) => form.append('files', file));
|
||||
if (conversationId) form.append('conversation_id', conversationId);
|
||||
if (idempotencyKey) form.append('idempotency_key', idempotencyKey);
|
||||
const headers: Record<string, string> = {};
|
||||
if (idempotencyKey) {
|
||||
headers['Idempotency-Key'] = idempotencyKey;
|
||||
}
|
||||
const body = await requestJson<ShippingNoticeUploadResponse & ShippingApiStatusPayload & {
|
||||
error?: string;
|
||||
batch_no?: string;
|
||||
idempotent_replay?: boolean;
|
||||
file_summary?: unknown;
|
||||
data?: unknown;
|
||||
}>('/api/workspace/shipping-batches/create-from-notices', { method: 'POST', body: form });
|
||||
}>('/api/workspace/shipping-batches/create-from-notices', {
|
||||
method: 'POST',
|
||||
body: form,
|
||||
headers,
|
||||
});
|
||||
return assertShippingOk(body);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user