From 0a423af4d2aea7d17555d09a0932a76faa268577 Mon Sep 17 00:00:00 2001 From: Sisyphus Date: Fri, 26 Jun 2026 16:24:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=95=86=E5=93=81=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20brand=20=E5=AD=97=E6=AE=B5=E5=91=BD?= =?UTF-8?q?=E5=90=8D=20+=20=E6=B7=BB=E5=8A=A0=20unit=20=E5=92=8C=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- apps/api/src/product/product.service.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/api/src/product/product.service.ts b/apps/api/src/product/product.service.ts index 71d5334..8dfe105 100644 --- a/apps/api/src/product/product.service.ts +++ b/apps/api/src/product/product.service.ts @@ -63,7 +63,8 @@ export class ProductService { const item: any = { name: p.name, category_id: catId, price: p.price > 0 ? p.price : 0.01, - brandName: p.brand || '', stock: p.quantity, + brand: p.brand || '', + unit: p.unit || '', sku: p.spec || p.name || '', } if (p.imageUrl) item.images = [p.imageUrl] @@ -94,6 +95,9 @@ export class ProductService { const errors: Array<{ sku: string; name: string; error: string }> = items .filter(i => i.status === 'failed') .map(i => ({ sku: i.sku || '', name: i.name || '', error: i.error || '未知错误' })) + if (errors.length > 0) { + this.logger.warn(`B2B import_products 导入失败详情: ${errors.map(e => `[${e.sku}] ${e.name}: ${e.error}`).join(' | ')}`) + } this.logger.log(`B2B import_products 完成: 导入 ${imported} 条, 失败 ${errors.length} 条, B2B IDs: ${b2bIds.join(',')}`) if (b2bIds.length > 0) {