diff --git a/scripts/admin-test-env-modules/phase4-overseas-pda-operations-contract.test.mjs b/scripts/admin-test-env-modules/phase4-overseas-pda-operations-contract.test.mjs index e687ecbd3..d55f9ff78 100644 --- a/scripts/admin-test-env-modules/phase4-overseas-pda-operations-contract.test.mjs +++ b/scripts/admin-test-env-modules/phase4-overseas-pda-operations-contract.test.mjs @@ -50,6 +50,7 @@ test('P2 to P5 cover all frozen endpoints, replays and conflict boundaries witho 'chargeAmount: 0.01', 'cartonMark:', 'fbaCartonMark:', 'inventory-candidates', 'sourceInventoryBalanceId:', 'sourceInventoryPositionId:', 'sourceInboundOrderId:', 'operationWarehouseId:', 'relabelItemForUnit', 'sourceLines.map', + "operationType: changesCartonLabel ? 'CARTON_AND_SKU' : 'SKU_LABEL'", 'skuItems:', 'P5换标费用冻结后开放PDA作业', 'P5换标完成后钱包结算收敛']) { assert.ok(source.includes(marker), marker) } diff --git a/scripts/admin-test-env-modules/phase4-overseas-pda-operations.mjs b/scripts/admin-test-env-modules/phase4-overseas-pda-operations.mjs index 0a1ddccbd..8f97160f2 100644 --- a/scripts/admin-test-env-modules/phase4-overseas-pda-operations.mjs +++ b/scripts/admin-test-env-modules/phase4-overseas-pda-operations.mjs @@ -386,18 +386,24 @@ async function verifyRelabel(context, token, merchantToken, fixture) { labelDeadline: new Date(Date.now() + 7 * 86400000).toISOString().slice(0, 19), contactName: 'PDA换标验收', contactPhone: '13800000006', chargeAmount: 0.01, remark: context.marker, idempotencyKey: key(context, 'RELABEL-CREATE'), - items: sourceLines.map(({ source, position, packageCount }, index) => ({ - sourceInventoryBalanceId: id(source.inventoryBalanceId), - sourceInventoryPositionId: id(position.positionId), sourceInboundOrderId: id(source.inboundOrderId), - skuCode: source.skuCode, productNameZh: source.productNameZh || inventory.productName || '本轮库存商品', - totalPackageCount: packageCount, notifiedPackageCount: packageCount, - shipmentNo: `SHIP-${context.marker}-${index + 1}`.slice(0, 128), - newSkuCode: `${source.skuCode}-NEW-${markerSuffix}-${index + 1}`.slice(0, 128), - labelRequirement: context.marker, - cartonMark: `CM-${String(context.marker).slice(-28)}-${index + 1}`, - fbaCartonMark: `FBA-${String(context.marker).slice(-27)}-${index + 1}`, - destinationFbaWarehouseCode: source.destinationFbaWarehouseCode, - })), + items: sourceLines.map(({ source, position, packageCount }, index) => { + const newSkuCode = `${source.skuCode}-NEW-${markerSuffix}-${index + 1}`.slice(0, 128) + const changesCartonLabel = nonBlank(source.destinationFbaWarehouseCode) + return { + sourceInventoryBalanceId: id(source.inventoryBalanceId), + sourceInventoryPositionId: id(position.positionId), sourceInboundOrderId: id(source.inboundOrderId), + skuCode: source.skuCode, productNameZh: source.productNameZh || inventory.productName || '本轮库存商品', + totalPackageCount: packageCount, notifiedPackageCount: packageCount, + shipmentNo: `SHIP-${context.marker}-${index + 1}`.slice(0, 128), + newSkuCode, + labelRequirement: context.marker, + cartonMark: `CM-${String(context.marker).slice(-28)}-${index + 1}`, + fbaCartonMark: changesCartonLabel ? `FBA-${String(context.marker).slice(-27)}-${index + 1}` : null, + destinationFbaWarehouseCode: changesCartonLabel ? source.destinationFbaWarehouseCode : null, + operationType: changesCartonLabel ? 'CARTON_AND_SKU' : 'SKU_LABEL', + skuItems: [{ skuCode: source.skuCode, newSkuCode, quantity: packageCount, remark: context.marker }], + } + }), } const createdResponse = await context.requestOverseas('POST', query(relabelBase, { customerId }), createBody) diff --git a/scripts/admin-test-env-modules/phase4-overseas-wallet-and-pallet-cost-contract.test.mjs b/scripts/admin-test-env-modules/phase4-overseas-wallet-and-pallet-cost-contract.test.mjs index 8273d3f5a..e774e5218 100644 --- a/scripts/admin-test-env-modules/phase4-overseas-wallet-and-pallet-cost-contract.test.mjs +++ b/scripts/admin-test-env-modules/phase4-overseas-wallet-and-pallet-cost-contract.test.mjs @@ -60,7 +60,8 @@ test('托盘汇总和拆柜成本验证总数、分摊及跨区金额守恒', () assert.match(source, /Number\(d\.totalCount\) === Number\(d\.idleCount\) \+ Number\(d\.occupiedCount\)/) assert.match(source, /allocated === money\(fact\.expectedPalletCost\)/) assert.match(source, /delivered\.reduce[\s\S]*fact\.expectedPalletCost/) - assert.match(pda, /unitPrice = Number\(\(1\.01 \+ index\)\.toFixed\(2\)\)/) + assert.match(pda, /unitPrice: Number\(pallet\?\.unitPrice \|\| 0\)/) + assert.match(pda, /Number\(stored\.unitPrice \|\| pallet\.unitPrice \|\| 0\)/) assert.match(pda, /completedContainerFacts\.push/) })