This commit is contained in:
2026-11-04 18:08:19 +08:00
parent 0993dd446e
commit 51291b4c27
16 changed files with 468 additions and 47 deletions
@@ -33,6 +33,17 @@ export async function receiveMixedContainer({ group, call, check, request, marke
const base = '/api/pda/v1/last-leg/receiving-containers/current'
const steps = mixedReceivingSchedule(group)
const expected = group.map(r => ({ inboundCode: r.source.inboundCode, total: r.expectedCartonMarks.length, received: 0 }))
for (const record of group.filter(r => r.order.fulfillmentType === 'STANDARD')) {
const other = group.find(item => item !== record && item.order.fulfillmentType === 'STANDARD')
const before = await call('混柜串票托盘校验前回查', 'GET', base)
const invalid = await request('POST', `${base}/pallets/resolve`, {
inboundCode: record.source.inboundCode, palletCode: other.overseas.plan.pallets[0].palletNo,
})
check('同柜另一票真实预留托盘必须拒绝', invalid,
invalid.body?.code === (record.order.destinationType === 'FBA' ? 'A0404' : 'A0409'))
const after = await call('混柜串票托盘拒绝后回查', 'GET', base)
check('同柜串票托盘拒绝后全柜事实不变', null, JSON.stringify(before) === JSON.stringify(after))
}
for (const record of group.filter(r => r.order.fulfillmentType === 'ONE_CLICK_DROPSHIP' || r.order.destinationType === 'OVERSEAS')) {
const before = await call('混柜错误收货模式前回查', 'GET', base)
const invalid = await request('POST', `${base}/receipts/bulk`, {
@@ -82,7 +93,7 @@ export async function receiveMixedContainer({ group, call, check, request, marke
return completed
}
export async function receiveOverseasComplete({ record, call, adminCall, check, marker }) {
export async function receiveOverseasComplete({ record, call, adminCall, check, request, marker }) {
const base = '/api/pda/v1/last-leg/receiving-containers/current'
const inboundCode = record.source.inboundCode
const plan = record.overseas.plan
@@ -104,6 +115,11 @@ export async function receiveOverseasComplete({ record, call, adminCall, check,
&& Number(completed.receivedPackages) === expected && Number(completed.pendingPackages) === 0)
const replay = await call('正常完成原键重放', 'POST', `${base}/complete`, body)
check('正常完成重放不重复入库', null, JSON.stringify(replay) === JSON.stringify(completed))
const afterComplete = await request('POST', `${base}/receipts/carton`, {
cartonMark: record.expectedCartonMarks[0], palletCode: pallet.palletNo,
idempotencyKey: `${marker}-receive-after-complete`,
})
check('正常完成后新键扫码不能重新收货', afterComplete, afterComplete.body?.code === 'A0404')
const finalPlan = await adminCall('回查全收最终计划', 'GET',
`/api/platform/v1/last-leg/inbound-plans/${encodeURIComponent(plan.planNo)}?customerId=${encodeURIComponent(record.order.tenantId)}`)
check('全收计划完成且应收实收均为四箱', null, finalPlan.status === 'COMPLETED'
@@ -164,6 +180,11 @@ export async function receiveOverseasShortage({ record, call, adminCall, check,
check('普通海外仓短少确认成功', null, confirmed.status === 'PARTIAL_INBOUND')
const confirmReplay = await adminCall('后台短少确认同键重放', 'POST', `${planPath}/confirm-shortage`, confirmBody, headers)
check('后台短少确认重放不重复入库', null, JSON.stringify(confirmReplay) === JSON.stringify(confirmed))
const afterComplete = await request('POST', `${base}/receipts/carton`, {
cartonMark: record.expectedCartonMarks[actual], palletCode: pallet.palletNo,
idempotencyKey: `${marker}-receive-after-shortage`,
})
check('短少确认后不能继续收取未入库箱', afterComplete, afterComplete.body?.code === 'A0404')
const finalPlan = await adminCall('回查短少入库最终计划', 'GET', `${planPath}?customerId=${encodeURIComponent(customerId)}`)
check('短少入库保留原应收及实际箱数', null, finalPlan.status === 'PARTIAL_INBOUND'
&& Number(finalPlan.expectedPackageCount) === expected && Number(finalPlan.pickedPackageCount) === actual)