diff --git a/furniture-3d-system/src/server/services/intake-non-integrated-product.service.ts b/furniture-3d-system/src/server/services/intake-non-integrated-product.service.ts index b8499f9a..672cc423 100644 --- a/furniture-3d-system/src/server/services/intake-non-integrated-product.service.ts +++ b/furniture-3d-system/src/server/services/intake-non-integrated-product.service.ts @@ -4100,12 +4100,31 @@ const DEFAULT_ASSET_VARIANT_EXECUTE_STANDARD = 'GB/T3324-2024' const DEFAULT_STEEL_ASSET_VARIANT_EXECUTE_STANDARD = 'GB/T3325-2024' const DEFAULT_ASSET_VARIANT_NATIONAL_STANDARD_COMPLIANT = '是' const DEFAULT_ASSET_VARIANT_SALES_STATUS = '销售' +const JST_SKU_SALES_STATUSES = new Set(['销售', '停产', '退市']) function normalizeSkuSalesStatusText(value: string | null | undefined) { const normalizedValue = value?.trim() ?? '' return normalizedValue || DEFAULT_ASSET_VARIANT_SALES_STATUS } +function normalizeStructuredSkuSalesStatusText(params: { + value: string | null | undefined + source?: string | null + sourceTable?: string | null +}) { + const normalizedValue = params.value?.trim() ?? '' + const isJstSkuSource = [params.source, params.sourceTable].some((value) => { + const normalizedSource = value?.trim().toLowerCase().replace(/-/g, '_') ?? '' + return normalizedSource === 'jst_sku' || normalizedSource === 'jstsku' + }) + + if (isJstSkuSource) { + return JST_SKU_SALES_STATUSES.has(normalizedValue) ? normalizedValue : '' + } + + return normalizeSkuSalesStatusText(normalizedValue) +} + function isWorkspaceConfirmationNewlyEnabled( existingProduct: SharedNonIntegratedProductRecord, nextProduct: SharedNonIntegratedProductRecord,