diff --git a/server/src/services/mainSystem/api/planChanges.ts b/server/src/services/mainSystem/api/planChanges.ts index ef5f7ca..d50030b 100644 --- a/server/src/services/mainSystem/api/planChanges.ts +++ b/server/src/services/mainSystem/api/planChanges.ts @@ -25,13 +25,14 @@ export type MainSystemPlanChangePayload = { }; export async function submitMainSystemPlanChange(input: { - branchCode: string; + /** 主系统供应商编码(不是供应商本地 branch_code;二者常不相等) */ + supplierCode: string; payload: MainSystemPlanChangePayload; fetchImpl?: typeof fetch; }): Promise> { const prepId = String(input.payload?.prep_id || '').trim(); if (!prepId) return { kind: 'rejected', status: 0, reason: '缺少主系统备货行 id', payload: null }; - const tokenResult = await getMainSystemToken(input.branchCode); + const tokenResult = await getMainSystemToken(input.supplierCode); if (tokenResult.kind === 'not_configured') { return { kind: 'not_configured', status: 0, reason: tokenResult.reason, payload: null }; } diff --git a/server/src/services/mainSystemPlanChangeService.ts b/server/src/services/mainSystemPlanChangeService.ts index 7b3e523..95dd5c1 100644 --- a/server/src/services/mainSystemPlanChangeService.ts +++ b/server/src/services/mainSystemPlanChangeService.ts @@ -135,6 +135,35 @@ export async function dispatchMainSystemPlanChange(changeId: string): Promise { expect(svc).toContain('mainOrderItemId'); expect(svc).toContain('main_order_item_id'); expect(svc).toContain("payload->>'mainOrderItemId'"); + expect(svc).toContain('main_supplier_code'); }); it('库存出库和分拣称重按 SKU 库存单位判断', () => {