观测点增加水准线路字段
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -5,6 +5,8 @@
|
|||||||
logs/
|
logs/
|
||||||
*.log
|
*.log
|
||||||
temp/
|
temp/
|
||||||
|
.claude/
|
||||||
|
.vscode/
|
||||||
|
|
||||||
!README.md
|
!README.md
|
||||||
|
|
||||||
|
|||||||
@@ -7,5 +7,6 @@ class Checkpoint(Base):
|
|||||||
id = Column(Integer, primary_key=True, index=True, autoincrement=True)
|
id = Column(Integer, primary_key=True, index=True, autoincrement=True)
|
||||||
aname = Column(String(100), nullable=False, comment="观察点名称")
|
aname = Column(String(100), nullable=False, comment="观察点名称")
|
||||||
burial_date = Column(String(100), comment="埋设日期")
|
burial_date = Column(String(100), comment="埋设日期")
|
||||||
|
linecode = Column(String(100), comment="线路编码")
|
||||||
section_id = Column(String(100), nullable=False, comment="所属断面id")
|
section_id = Column(String(100), nullable=False, comment="所属断面id")
|
||||||
point_id = Column(String(100), nullable=False, comment="观察点id")
|
point_id = Column(String(100), nullable=False, comment="观察点id")
|
||||||
@@ -50,6 +50,7 @@ class CheckpointDataImportRequest(BaseModel):
|
|||||||
aname: Optional[str] = None
|
aname: Optional[str] = None
|
||||||
section_id: str
|
section_id: str
|
||||||
burial_date: Optional[str] = None
|
burial_date: Optional[str] = None
|
||||||
|
linecode: Optional[str] = None
|
||||||
|
|
||||||
# 断面数据导入请求
|
# 断面数据导入请求
|
||||||
class SectionDataImportRequest(BaseModel):
|
class SectionDataImportRequest(BaseModel):
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ class CheckpointService(BaseService[Checkpoint]):
|
|||||||
checkpoint.aname = item_data.get('aname')
|
checkpoint.aname = item_data.get('aname')
|
||||||
checkpoint.section_id = item_data.get('section_id')
|
checkpoint.section_id = item_data.get('section_id')
|
||||||
checkpoint.burial_date = item_data.get('burial_date')
|
checkpoint.burial_date = item_data.get('burial_date')
|
||||||
|
checkpoint.linecode = item_data.get('linecode')
|
||||||
logger.info(f"Updated checkpoint: {item_data.get('point_id')}")
|
logger.info(f"Updated checkpoint: {item_data.get('point_id')}")
|
||||||
else:
|
else:
|
||||||
# 新增操作
|
# 新增操作
|
||||||
@@ -78,7 +79,8 @@ class CheckpointService(BaseService[Checkpoint]):
|
|||||||
point_id=item_data.get('point_id'),
|
point_id=item_data.get('point_id'),
|
||||||
aname=item_data.get('aname'),
|
aname=item_data.get('aname'),
|
||||||
section_id=item_data.get('section_id'),
|
section_id=item_data.get('section_id'),
|
||||||
burial_date=item_data.get('burial_date')
|
burial_date=item_data.get('burial_date'),
|
||||||
|
linecode=item_data.get('linecode')
|
||||||
)
|
)
|
||||||
db.add(checkpoint)
|
db.add(checkpoint)
|
||||||
logger.info(f"Created checkpoint: {item_data.get('point_id')}")
|
logger.info(f"Created checkpoint: {item_data.get('point_id')}")
|
||||||
|
|||||||
@@ -86,7 +86,8 @@ class SectionDataService(BaseService[SectionData]):
|
|||||||
"point_id": cp.point_id,
|
"point_id": cp.point_id,
|
||||||
"aname": cp.aname,
|
"aname": cp.aname,
|
||||||
"burial_date": cp.burial_date,
|
"burial_date": cp.burial_date,
|
||||||
"section_id": cp.section_id
|
"section_id": cp.section_id,
|
||||||
|
"linecode": cp.linecode
|
||||||
} for cp in checkpoints
|
} for cp in checkpoints
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user