Compare commits

...

5 Commits

Author SHA1 Message Date
lhx
65744e28dd 删除对象冲突 2026-03-16 10:26:19 +08:00
lhx
beea67482d 合并代码 2026-03-16 10:24:24 +08:00
whm
a577b8ef07 1.把日更字段和补全历史数据字段分开 2026-03-16 10:12:21 +08:00
whm
3f7b839e0a Merge branch 'main' of https://gitea.yuxindazhineng.com/admin/railway_cloud
# Conflicts:
#	app/models/lose_data.py
2026-03-15 12:33:32 +08:00
whm
e5de18e80f 1.补偿数据上传 2026-03-15 12:30:53 +08:00
3 changed files with 23 additions and 44 deletions

View File

@@ -27,23 +27,3 @@ class LevelData(Base):
column.name: getattr(self, column.name)
for column in self.__table__.columns
}
class LoseData(Base):
__tablename__ = "lose_data"
id = Column(Integer, primary_key=True, index=True, autoincrement=True)
account_id = Column(String(100), nullable=False, comment="水准线路编码", index=True)
NYID = Column(String(100), nullable=False, comment="期数id", index=True)
linecode = Column(String(100), nullable=False, comment="水准线路编码", index=True)
benchmarkids = Column(String(100), comment="工作基点名称序列")
point_id = Column(String(100), nullable=False, comment="观测点id", index=True)
section_id = Column(String(100), nullable=False, comment="所属断面id")
lose_data = Column(String(100), comment="水准观测类型")
# 模型转字典
def to_dict(self):
"""将模型实例转换为字典,支持 Pydantic 序列化"""
return {
column.name: getattr(self, column.name)
for column in self.__table__.columns
}

View File

@@ -1,21 +1,20 @@
from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy import Column, Integer, String
from ..core.database import Base
class LoseData(Base):
"""缺失数据记录表:记录各水准线路(期数)的原始/沉降数据缺失情况"""
__tablename__ = "lose_data"
id = Column(Integer, primary_key=True, index=True, autoincrement=True)
account_id = Column(String(100), nullable=False, comment="水准线路编码", index=True)
NYID = Column(String(100), nullable=False, comment="期数id", index=True)
linecode = Column(String(100), nullable=False, comment="水准线路编码", index=True)
benchmarkids = Column(String(100), comment="工作基点名称序列")
point_id = Column(String(100), nullable=False, comment="观测点id", index=True)
section_id = Column(String(100), nullable=False, comment="所属断面id")
lose_data = Column(String(100), comment="水准观测类型")
id = Column(Integer, primary_key=True, index=True, autoincrement=True, comment="ID")
account_id = Column(Integer, nullable=False, comment="账户id", index=True)
NYID = Column(String(100), nullable=False, comment="期数ID", index=True)
linecode = Column(String(255), nullable=False, default="0", comment="水准线路编码", index=True)
lose_data = Column(Integer, nullable=False, default=0, comment="缺失的数据默认是0")
section_id = Column(String(255), nullable=True, comment="所属断面id")
point_id = Column(String(100), nullable=False, comment="测点ID")
# 模型转字典
def to_dict(self):
"""将模型实例转换为字典,支持 Pydantic 序列化"""
return {
column.name: getattr(self, column.name)
for column in self.__table__.columns

View File

@@ -139,9 +139,9 @@ class ConstructionMonitorUtils:
continue
if not base_condition:
# 当前为冬休且历史全是冬休 → 视为数据未补全remaining 固定为 -365
# 当前为冬休且历史全是冬休 → 视为数据未补全,用 bu_all=-365 表示;remaining 保持原样不改
if latest_condition == "冬休":
item_copy["remaining"] = -365
item_copy["bu_all"] = -365
result["data"].append(item_copy)
else:
result["winter"].append(item_copy)