观测点接口逻辑完善

This commit is contained in:
lhx
2025-09-28 16:20:41 +08:00
parent f89f2eef37
commit 54d0b2a90e

View File

@@ -53,6 +53,14 @@ class CheckpointService(BaseService[Checkpoint]):
for item_data in data: for item_data in data:
try: 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')) checkpoint = self.get_by_point_id(db, item_data.get('point_id'))
if checkpoint: if checkpoint:
# 更新操作 # 更新操作