From 54d0b2a90e006dde492cbb985afdced6eef90145 Mon Sep 17 00:00:00 2001 From: lhx Date: Sun, 28 Sep 2025 16:20:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=82=E6=B5=8B=E7=82=B9=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/checkpoint.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/services/checkpoint.py b/app/services/checkpoint.py index ce86c5d..88de154 100644 --- a/app/services/checkpoint.py +++ b/app/services/checkpoint.py @@ -53,6 +53,14 @@ class CheckpointService(BaseService[Checkpoint]): for item_data in data: try: + + # 判断断面id是否存在 + section = self.get_by_section_id(db, item_data.get('section_id')) + if not section: + logger.error(f"Section {item_data.get('section_id')} not found") + raise Exception(f"Section {item_data.get('section_id')} not found") + + checkpoint = self.get_by_point_id(db, item_data.get('point_id')) if checkpoint: # 更新操作