优化
This commit is contained in:
@@ -58,6 +58,18 @@ export async function receiveMixedContainer({ group, call, check, request, marke
|
||||
expected.find(row => row.inboundCode === step.record.source.inboundCode).received += step.count
|
||||
const after = await call('混柜每步后逐票回查', 'GET', base)
|
||||
check('混柜交替收货不串票不重计', null, receivingProgressMatches(after, expected))
|
||||
const changedBody = step.path === 'pallet' ? { ...body, sourcePalletNo: `${body.sourcePalletNo}-CHANGED` }
|
||||
: step.path === 'bulk' ? { ...body, packageCount: body.packageCount + 1 }
|
||||
: { ...body, palletCode: `${body.palletCode}-CHANGED` }
|
||||
const changed = await request('POST', path, changedBody)
|
||||
check('混柜收货同键异载荷必须冲突', changed, changed.body?.code === 'A0409')
|
||||
const duplicate = await request('POST', path, { ...body, idempotencyKey: `${body.idempotencyKey}-duplicate` })
|
||||
check('混柜同货物新键重复操作不重复收货', duplicate, step.path === 'carton'
|
||||
? duplicate.body?.code === 'A0409'
|
||||
: duplicate.body?.code === '200' && duplicate.body?.data?.result === 'ALREADY_RECEIVED'
|
||||
&& Number(duplicate.body?.data?.acceptedPackages) === 0)
|
||||
const afterRetries = await call('混柜重复和冲突请求后回查全部票', 'GET', base)
|
||||
check('混柜冲突及新键重复后全柜事实不变', null, JSON.stringify(afterRetries) === JSON.stringify(after))
|
||||
}
|
||||
const body = { allowDifference: false, idempotencyKey: `${marker}-mixed-complete` }
|
||||
const completed = await call('混柜全部核平后正常完成入库', 'POST', `${base}/complete`, body)
|
||||
|
||||
Reference in New Issue
Block a user