fix(ecom-dmb): 导入商品时捕获唯一键冲突异常,改为查询已存在记录,避免并发导入重复商品

This commit is contained in:
小蟑螂
2026-04-18 10:45:10 +08:00
parent c11106ba1e
commit 2054a8bcf6
3 changed files with 80 additions and 11 deletions
+1
View File
@@ -239,6 +239,7 @@ CREATE TABLE `ec_product` (
`update_by` bigint UNSIGNED NULL DEFAULT NULL COMMENT '更新人ID',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_product_code`(`product_code` ASC) USING BTREE,
UNIQUE INDEX `uk_company_name`(`company_id` ASC, `name` ASC) USING BTREE,
INDEX `idx_company_id`(`company_id` ASC) USING BTREE,
INDEX `idx_category_id`(`category_id` ASC) USING BTREE,
INDEX `fk_ec_product_main_image`(`main_image_id` ASC) USING BTREE,