This commit is contained in:
2026-10-21 14:30:41 +08:00
parent 0af977bdef
commit 40a03978cd
53 changed files with 1004 additions and 1291 deletions
@@ -244,7 +244,8 @@ export async function verifyMeasurementApprovalReplay(context, input, payload, i
inboundHistoryCount: after.facts.inbound.statusHistory.length }
}
async function reusablePallets(context, warehouseId) {
/** 固定造数只允许指定托盘;显式通用模式才读取其他已有托盘。缺失不自动替换。 */
export async function reusablePallets(context, warehouseId) {
const cacheKey = asId(warehouseId)
const allowAnyExistingPallet = context.context?.allowAnyExistingPallet === true
const scopedCacheKey = `${cacheKey}:${allowAnyExistingPallet ? 'any' : 'fixed'}`
@@ -272,10 +273,12 @@ async function reusablePallets(context, warehouseId) {
reusablePalletsByWarehouse.set(scopedCacheKey, pallets)
return pallets
}
// 固定称重托盘是环境初始化样本;缺失时降级使用当前仓库已有托盘,测量与计费仍走真实接口。
context.assert(MODULE, '固定称重托盘主数据完整', null, false,
`warehouseId=${warehouseId}, missing=${missingFixed.join(',')}`, OPTIONS)
context.addCoverageGap?.(MODULE, 'measurement-pallet-fixture', '固定称重托盘主数据缺失',
`warehouseId=${warehouseId}, missing=${missingFixed.join(',')};改用当前仓库已有托盘继续`,
'fixture', { blocking: false })
`warehouseId=${warehouseId}, missing=${missingFixed.join(',')};停止固定托盘造数`,
'fixture', { blocking: true })
return null
}
const response = await context.request('GET',