fix: preserve receiving session on duplicate pallet scans

This commit is contained in:
2026-09-15 14:44:10 +08:00
parent 791918c0dc
commit c65389b2c2
4 changed files with 20 additions and 2 deletions
@@ -197,6 +197,9 @@ test('allocation checks both physical summaries and uncollapsed per-inbound quan
})
test('each scenario reaches physical loading through released booking and asynchronous completion', () => {
assert.match(source, /装柜前保存柜级预计到仓时间/)
assert.match(source, /capacityCbm: 68, maxWeightKg: 19500, estimatedWarehouseArrivalAt/)
assert.ok(source.indexOf('装柜前保存柜级预计到仓时间') < source.indexOf('读取自动生成装柜计划'))
assert.match(source, /ocean-booking-link/)
assert.match(source, /readiness\?\.canConfirm === true/)
assert.match(source, /action: 'PICK_PALLET'/)
@@ -141,10 +141,20 @@ async function runWorkflow(context, stopBeforeOverseasPda, mixedContainer = fals
check(`${record.label}初始费用已计算`, null, Boolean(fee))
}
const summary = group[0].summary
const cabinet = await command('创建本场景模拟柜', 'POST', '/api/platform/v1/containers', {
let cabinet = await command('创建本场景模拟柜', 'POST', '/api/platform/v1/containers', {
channelGroupCode: channelGroup(summary.channelCode), warehouseId: String(summary.warehouseId),
containerType: '40HQ', capacityCbm: 68, maxWeightKg: 19500,
})
// Arrival is frozen by the loading event; prepare it while the cabinet is editable.
const estimatedWarehouseArrivalAt = `${new Date(Date.now() + 86400000).toISOString().slice(0, 10)}T10:00:00`
cabinet = await command('装柜前保存柜级预计到仓时间', 'PUT', `/api/platform/v1/containers/${cabinet.id}`, {
version: Number(cabinet.version), data: {
warehouseId: String(summary.warehouseId), containerType: '40HQ',
capacityCbm: 68, maxWeightKg: 19500, estimatedWarehouseArrivalAt,
},
})
check(`${label}预计到仓时间已写入正式柜资料`, null,
cabinet.estimatedWarehouseArrivalAt?.slice(0, 16) === estimatedWarehouseArrivalAt.slice(0, 16))
let plan = await command('读取自动生成装柜计划', 'GET', `${smart}/plans/by-booking/${cabinet.id}`)
const path = `${smart}/plans/${plan.id}`
async function conserve(name) {