优化
This commit is contained in:
@@ -334,16 +334,19 @@ async function runWorkflow(context, stopBeforeOverseasPda, mixedContainer = fals
|
||||
return data
|
||||
}
|
||||
let summary
|
||||
let summaryResponse
|
||||
for (let attempt = 0; attempt < 60; attempt++) {
|
||||
const response = await context.requestOverseas('GET', `${base}/orders/container-summaries/${bookingId}`)
|
||||
summaryResponse = response
|
||||
summary = response?.body?.code === '200' ? response.body.data : null
|
||||
if (summary?.orders?.length === group.length) break
|
||||
if (attempt < 59) await new Promise((resolve) => setTimeout(resolve, 1000))
|
||||
}
|
||||
check(`${label}跨区事件逐票建单完整`, null,
|
||||
check(`${label}跨区事件逐票建单完整`, summaryResponse,
|
||||
summary?.orders?.length === group.length && group.every((record) =>
|
||||
summary.orders.some((order) => order.inboundCode === record.source.inboundCode
|
||||
&& String(order.customerId) === String(record.order.tenantId))))
|
||||
&& String(order.customerId) === String(record.order.tenantId))),
|
||||
`containerNo=${loading.containerNo}, expectedOrders=${group.length}, actualOrders=${summary?.orders?.length ?? 'unavailable'}`)
|
||||
const preview = await call('入库计划预览', 'GET', `${base}/inbound-plans/container-preview?sourceContainerBookingId=${bookingId}`)
|
||||
check(`${label}全柜入库计划就绪`, null, preview.ready === true && Number(preview.totalOrderCount) === group.length)
|
||||
const body = { sourceContainerBookingId: bookingId, snapshotVersion: Number(preview.snapshotVersion),
|
||||
|
||||
Reference in New Issue
Block a user