From 7b3a7acb129c5bbe9fa59cafa0c0491cb00ccc19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=85=E5=B1=85?= Date: Tue, 29 Sep 2026 13:40:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(supply-chain):=20=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E8=80=83=E6=A0=B8=E5=8A=A8=E9=94=80=E6=8C=89=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=88=A4=E5=AE=9A=EF=BC=88OEM=20=E8=80=83?= =?UTF-8?q?=E6=A0=B8=EF=BC=8C=E5=85=B6=E4=BD=99=E4=B8=8D=E8=80=83=E6=A0=B8?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- furniture-3d-system/scripts/run-product-sabc.ts | 2 +- .../server/services/supply-chain-product-sabc.service.ts | 8 ++++---- .../src/server/services/supply-chain-product-sabc.test.ts | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/furniture-3d-system/scripts/run-product-sabc.ts b/furniture-3d-system/scripts/run-product-sabc.ts index d14e7bfb..6f522031 100644 --- a/furniture-3d-system/scripts/run-product-sabc.ts +++ b/furniture-3d-system/scripts/run-product-sabc.ts @@ -32,7 +32,7 @@ async function main() { periodEnd: result.periodEnd, sourceRows: result.sourceRows, archiveRows: result.rows.length, - eligibleRows: result.rows.filter((row) => row.row.assessmentStatus === '考核').length, + eligibleRows: result.rows.filter((row) => row.row.eligible).length, taggedRows: result.rows.filter((row) => row.row.sabcRating).length, ratings: result.rows.reduce>((counts, row) => { if (row.row.sabcRating) counts[row.row.sabcRating] = (counts[row.row.sabcRating] ?? 0) + 1 diff --git a/furniture-3d-system/src/server/services/supply-chain-product-sabc.service.ts b/furniture-3d-system/src/server/services/supply-chain-product-sabc.service.ts index 526e115e..cc4780d7 100644 --- a/furniture-3d-system/src/server/services/supply-chain-product-sabc.service.ts +++ b/furniture-3d-system/src/server/services/supply-chain-product-sabc.service.ts @@ -380,6 +380,8 @@ function createBlankRow( const category = target.categoryL2 const categoryClassValue = configuration?.categoryGroup ?? '' const newPeriodDays = newProductPeriodDays(categoryClassValue) + // 「不考核原因」取产品全量档案的「产品类型」;是否考核动销:OEM=考核,其他非空类型=不考核,无类型留空。 + const productionType = String(target.productionType ?? '').trim() return { id: target.id, styleCode: target.spu, @@ -410,9 +412,8 @@ function createBlankRow( afterSaleAmount: '', grossMargin: '', afterSaleRatio: '', - assessmentStatus: '', - // 「不考核原因」取产品全量档案的「产品类型」(OEM/ODM 等)。 - noAssessmentReason: target.productionType ?? '', + assessmentStatus: productionType ? (productionType === 'OEM' ? '考核' : '不考核') : '', + noAssessmentReason: productionType, sameProductCode: replacement.sameProductCode, eligible: isSabcEligibleProduct(target), } @@ -464,7 +465,6 @@ function applyValues( row.averageDailySales = formatDecimal(classification.averageDailySales, 8) row.feeRatio = classification.feeRatio === null ? '异常' : formatDecimal(classification.feeRatio, 8) row.grossMargin = formatDecimal(classification.grossMargin, 8) - row.assessmentStatus = '考核' return row } diff --git a/furniture-3d-system/src/server/services/supply-chain-product-sabc.test.ts b/furniture-3d-system/src/server/services/supply-chain-product-sabc.test.ts index dea0a5a3..00cb32ae 100644 --- a/furniture-3d-system/src/server/services/supply-chain-product-sabc.test.ts +++ b/furniture-3d-system/src/server/services/supply-chain-product-sabc.test.ts @@ -351,6 +351,7 @@ describe('supply-chain-product-sabc rules', () => { productName: '电脑椅', productStatus: '销售', productAttribute: '成品', + productionType: 'OEM', brand: '品牌', productTag: '', sabcRating: '',