From f67f00a7a561438ef4048aee0babeca3c2431342 Mon Sep 17 00:00:00 2001 From: yml2213 Date: Thu, 5 Nov 2026 17:29:14 +0800 Subject: [PATCH] =?UTF-8?q?fix(cost-center):=20=E5=85=81=E8=AE=B8=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E7=BA=AF=E6=95=B0=E5=AD=97=E7=AD=89=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E4=BA=BA=E5=B7=A5=20SKU?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cost-center/manual-fulfillment-config-service.ts | 4 ++-- .../services/finance/manual-fulfillment-integrity.test.ts | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/backend/src/services/cost-center/manual-fulfillment-config-service.ts b/apps/backend/src/services/cost-center/manual-fulfillment-config-service.ts index 96e2712e..48acc6c8 100644 --- a/apps/backend/src/services/cost-center/manual-fulfillment-config-service.ts +++ b/apps/backend/src/services/cost-center/manual-fulfillment-config-service.ts @@ -569,8 +569,8 @@ export async function deleteManualSkuClassification( skuKey: string, ): Promise { const key = canonicalizeInternalSku(skuKey) - if (!key || !containsCjk(key)) { - throw createHttpError('必须使用包含中文的内部 SKU', { + if (!key) { + throw createHttpError('内部 SKU 不能为空', { statusCode: 400, errorCode: 'manual_config_sku_key_required', }) diff --git a/apps/backend/src/services/finance/manual-fulfillment-integrity.test.ts b/apps/backend/src/services/finance/manual-fulfillment-integrity.test.ts index 0d3574cb..85952ad6 100644 --- a/apps/backend/src/services/finance/manual-fulfillment-integrity.test.ts +++ b/apps/backend/src/services/finance/manual-fulfillment-integrity.test.ts @@ -123,6 +123,13 @@ test('人工确认前必须自动匹配履约配置,配置保存/定时任务 configSource.includes("0, '1970-01-01T00:00:00+08:00', 'manual', 'active'"), '人工履约固定成本版本必须同时写入 amount_fen 和 rate_bps,避免保存成功但后处理报错', ) + const deleteStart = configSource.indexOf('export async function deleteManualSkuClassification') + const deleteEnd = configSource.indexOf('export async function rematchManualFulfillments') + const deleteBody = configSource.slice(deleteStart, deleteEnd) + assert.ok( + !deleteBody.includes('containsCjk(key)'), + '移除错误人工分类不能要求 SKU 含中文,否则纯数字等脏数据永远删不掉', + ) assert.ok( migrationSource.includes("spec_json->>'skuNick'") && migrationSource.includes("spec_json->>'outSkuSn'") &&