test(phase3): provision dispatch and handoff evidence
This commit is contained in:
@@ -348,6 +348,14 @@ async function loadOneFragment(context, state) {
|
||||
if (!taskId || !pickItem?.id) return null
|
||||
context.createdResources.phase3OrderSplitting.retainedAuditRecordIds.push(taskId)
|
||||
|
||||
const labelResponse = await context.requestBinary('POST',
|
||||
`/api/platform/inbounds/${encodeURIComponent(id(candidate.inboundId))}/carton-label-pdf?tenantId=${encodeURIComponent(tenantId)}`)
|
||||
context.assert(MODULE, `${sourceOrderNo} 进入 LOADING 前生成可交接箱唛池`, labelResponse,
|
||||
labelResponse.http === 200 && String(labelResponse.contentType || '').toLowerCase().includes('pdf')
|
||||
&& Number(labelResponse.bytes?.length) > 0,
|
||||
`HTTP=${labelResponse.http}, contentType=${labelResponse.contentType || 'missing'}, bytes=${labelResponse.bytes?.length ?? 0}`, OPTIONS)
|
||||
if (labelResponse.http !== 200 || !Number(labelResponse.bytes?.length)) return null
|
||||
|
||||
const claim = await request(context, 'POST', `${PDA}/tasks/${taskId}/claim`, {
|
||||
expectedAssignmentVersion: 0, operationId: `${operationBase}-claim`,
|
||||
})
|
||||
@@ -407,14 +415,6 @@ async function loadOneFragment(context, state) {
|
||||
`HTTP=${differentReplay.http}, code=${codeOf(differentReplay)}, requestId=${differentReplay.requestId || 'missing'}, traceId=${differentReplay.traceId || 'missing'}`, OPTIONS)
|
||||
}
|
||||
|
||||
const labelResponse = await context.requestBinary('POST',
|
||||
`/api/platform/inbounds/${encodeURIComponent(id(candidate.inboundId))}/carton-label-pdf?tenantId=${encodeURIComponent(tenantId)}`)
|
||||
context.assert(MODULE, `${sourceOrderNo} 完成前生成可交接箱唛池`, labelResponse,
|
||||
labelResponse.http === 200 && String(labelResponse.contentType || '').toLowerCase().includes('pdf')
|
||||
&& Number(labelResponse.bytes?.length) > 0,
|
||||
`HTTP=${labelResponse.http}, contentType=${labelResponse.contentType || 'missing'}, bytes=${labelResponse.bytes?.length ?? 0}`, OPTIONS)
|
||||
if (labelResponse.http !== 200 || !Number(labelResponse.bytes?.length)) return null
|
||||
|
||||
if (!await ensureCompletionEvidence(context, tenantId, id(candidate.inboundId), operationBase)) return null
|
||||
|
||||
const completePath = `${PDA}/tasks/${taskId}/complete`
|
||||
|
||||
Reference in New Issue
Block a user