fix PDA identity handling in phase3 loading
This commit is contained in:
@@ -99,7 +99,7 @@ export async function uploadEvidence(context, taskId, warehouseId, evidenceType,
|
|||||||
form.append('file', new Blob([png], { type: 'image/png' }), fileName)
|
form.append('file', new Blob([png], { type: 'image/png' }), fileName)
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${context.options.gateway}${path}`, {
|
const response = await fetch(`${context.options.gateway}${path}`, {
|
||||||
method: 'POST', headers: { Accept: 'application/json', Authorization: `Bearer ${context.token}`,
|
method: 'POST', headers: { Accept: 'application/json', Authorization: `Bearer ${context.pdaToken || context.token}`,
|
||||||
'Idempotency-Key': `${context.marker}-p3-evidence-${keySuffix}`.slice(0, 128) },
|
'Idempotency-Key': `${context.marker}-p3-evidence-${keySuffix}`.slice(0, 128) },
|
||||||
body: form, signal: AbortSignal.timeout(60_000),
|
body: form, signal: AbortSignal.timeout(60_000),
|
||||||
})
|
})
|
||||||
@@ -692,7 +692,7 @@ export async function run(context) {
|
|||||||
&& Number(confirmReplay.body?.data?.version) === Number(confirmed.version),
|
&& Number(confirmReplay.body?.data?.version) === Number(confirmed.version),
|
||||||
`HTTP=${confirmReplay.http}, code=${codeOf(confirmReplay)}, requestId=${confirmReplay.requestId || 'missing'}, traceId=${confirmReplay.traceId || 'missing'}`, OPTIONS)
|
`HTTP=${confirmReplay.http}, code=${codeOf(confirmReplay)}, requestId=${confirmReplay.requestId || 'missing'}, traceId=${confirmReplay.traceId || 'missing'}`, OPTIONS)
|
||||||
const confirmSameKeyDifferentBody = await request(context, 'POST', confirmPath,
|
const confirmSameKeyDifferentBody = await request(context, 'POST', confirmPath,
|
||||||
{ expectedVersion: Number(confirmed.version) }, confirmHeaders)
|
{ expectedVersion: Number(confirmed.version), assigneeId: id(pdaOperator.userId) }, confirmHeaders)
|
||||||
context.addStep(MODULE, '计划级确认同 key 异参返回冲突', confirmSameKeyDifferentBody,
|
context.addStep(MODULE, '计划级确认同 key 异参返回冲突', confirmSameKeyDifferentBody,
|
||||||
confirmSameKeyDifferentBody.http === 200 && codeOf(confirmSameKeyDifferentBody) === 'A0409',
|
confirmSameKeyDifferentBody.http === 200 && codeOf(confirmSameKeyDifferentBody) === 'A0409',
|
||||||
`HTTP=${confirmSameKeyDifferentBody.http}, code=${codeOf(confirmSameKeyDifferentBody)}, requestId=${confirmSameKeyDifferentBody.requestId || 'missing'}, traceId=${confirmSameKeyDifferentBody.traceId || 'missing'}`, OPTIONS)
|
`HTTP=${confirmSameKeyDifferentBody.http}, code=${codeOf(confirmSameKeyDifferentBody)}, requestId=${confirmSameKeyDifferentBody.requestId || 'missing'}, traceId=${confirmSameKeyDifferentBody.traceId || 'missing'}`, OPTIONS)
|
||||||
@@ -724,7 +724,7 @@ export async function run(context) {
|
|||||||
context.assert(MODULE, '柜次 PDA 任务与桥接入库明细一致', canonicalTaskResponse,
|
context.assert(MODULE, '柜次 PDA 任务与桥接入库明细一致', canonicalTaskResponse,
|
||||||
Boolean(canonicalTaskId) && canonicalTaskId === confirmedTaskId && id(canonicalTask?.loadingPlanId) === loadingPlanId
|
Boolean(canonicalTaskId) && canonicalTaskId === confirmedTaskId && id(canonicalTask?.loadingPlanId) === loadingPlanId
|
||||||
&& id(canonicalTask?.containerBookingId) === containerBookingId
|
&& id(canonicalTask?.containerBookingId) === containerBookingId
|
||||||
&& canonicalTask?.workflowStatus === 'UNASSIGNED' && canonicalPickItems.length > 0,
|
&& canonicalTask?.workflowStatus === 'IN_PROGRESS' && canonicalPickItems.length > 0,
|
||||||
`taskId=${canonicalTaskId || 'missing'}, itemCount=${canonicalPickItems.length}`, OPTIONS)
|
`taskId=${canonicalTaskId || 'missing'}, itemCount=${canonicalPickItems.length}`, OPTIONS)
|
||||||
if (!canonicalTaskId || !canonicalPickItems.length) return
|
if (!canonicalTaskId || !canonicalPickItems.length) return
|
||||||
|
|
||||||
@@ -920,9 +920,12 @@ export async function run(context) {
|
|||||||
&& Boolean(customerIsolatedSnapshot.requestId) && Boolean(customerIsolatedSnapshot.traceId),
|
&& Boolean(customerIsolatedSnapshot.requestId) && Boolean(customerIsolatedSnapshot.traceId),
|
||||||
`HTTP=${customerIsolatedSnapshot.http}, code=${codeOf(customerIsolatedSnapshot)}, requestId=${customerIsolatedSnapshot.requestId || 'missing'}, traceId=${customerIsolatedSnapshot.traceId || 'missing'}`, OPTIONS)
|
`HTTP=${customerIsolatedSnapshot.http}, code=${codeOf(customerIsolatedSnapshot)}, requestId=${customerIsolatedSnapshot.requestId || 'missing'}, traceId=${customerIsolatedSnapshot.traceId || 'missing'}`, OPTIONS)
|
||||||
|
|
||||||
const currentAssigneeId = Number(claimed?.assignment?.assigneeId)
|
const currentAssigneeId = id(claimed?.assignment?.assigneeId)
|
||||||
|
const otherOperator = (Array.isArray(pdaOperators) ? pdaOperators : pdaOperators?.records || [])
|
||||||
|
.find((operator) => id(operator?.userId) !== currentAssigneeId)
|
||||||
|
if (!otherOperator?.userId) return
|
||||||
const reassigned = await request(context, 'POST', `${pdaBase}/tasks/${canonicalTaskId}/assign`, {
|
const reassigned = await request(context, 'POST', `${pdaBase}/tasks/${canonicalTaskId}/assign`, {
|
||||||
assigneeId: currentAssigneeId + 1000000, assigneeName: `${context.marker}-other-picker`,
|
assigneeId: id(otherOperator.userId), assigneeName: otherOperator.displayName || otherOperator.username || `${context.marker}-other-picker`,
|
||||||
expectedAssignmentVersion: Number(claimed?.assignment?.version),
|
expectedAssignmentVersion: Number(claimed?.assignment?.version),
|
||||||
operationId: `${context.marker}-bridge-assign-other`.slice(0, 128),
|
operationId: `${context.marker}-bridge-assign-other`.slice(0, 128),
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user