From cd2e8e80cb500157078e04b09659cccf29069b04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E9=B8=9F=E7=94=9F=E4=BA=A7?= Date: Wed, 18 Mar 2026 14:30:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=E8=97=8F=E5=93=81?= =?UTF-8?q?=E7=BC=96=E5=8F=B7=E6=9F=A5=E9=87=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/routers/collections.py | 16 ++++++++++++++++ config/VERSION | 2 +- frontend/index.html | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/backend/app/routers/collections.py b/backend/app/routers/collections.py index 2f64a16..468fb21 100644 --- a/backend/app/routers/collections.py +++ b/backend/app/routers/collections.py @@ -374,6 +374,22 @@ def create_collection( db ) + # 编号查重(如果提供了编号且不是强制保存) + if not force and final_code: + existing_code = db.query(Collection).filter( + Collection.f01_02_code == final_code, + Collection.f99_91_user_id == current_user.f99_90_id + ).first() + + if existing_code: + logger.warning(f"发现重复编号:{final_code}, 已存在藏品 ID: {existing_code.f99_90_id}") + return { + "error": { + "code": "DUPLICATE_CODE", + "message": f"藏品编号 {final_code} 已存在,请使用其他编号" + } + } + # 冠字号查重(如果提供了冠字号且不是强制保存) if not force and collection_data.f02_10_prefix_serial: # 查询当前用户是否有相同冠字号的藏品 diff --git a/config/VERSION b/config/VERSION index f5d32b2..94dfc72 100644 --- a/config/VERSION +++ b/config/VERSION @@ -2,7 +2,7 @@ # Version Configuration for Zodiac Collection Management System # 当前版本号 (语义化版本:主版本。次版本.修订版) -VERSION=1.1.8 +VERSION=1.1.9 # 版本代号 (可选) VERSION_CODENAME="新生" diff --git a/frontend/index.html b/frontend/index.html index a185ee1..a9c1bc5 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -4,7 +4,7 @@ - 甲辰收藏 v1.1.7 + 甲辰收藏 v1.1.8