From 00cd9dd424bcac4625e7cab23053a70310466b10 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 3 Nov 2026 11:23:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=B8=BB=E7=B3=BB=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E5=88=92):=20=E7=94=A8=E4=B8=BB=E7=B3=BB=E7=BB=9F=E4=BE=9B?= =?UTF-8?q?=E5=BA=94=E5=95=86=E7=BC=96=E7=A0=81=E6=8D=A2=20token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 之前把本地 branch_code 当 supplier_code,换 token 403;改为从导入台账 main_supplier_code 取值。 --- .../services/mainSystem/api/planChanges.ts | 5 +-- .../services/mainSystemPlanChangeService.ts | 31 ++++++++++++++++++- server/tests/mainSystemPlanChange.test.ts | 1 + 3 files changed, 34 insertions(+), 3 deletions(-) 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 库存单位判断', () => {