Compare commits
4 Commits
08b556fa6e
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| beea67482d | |||
| a577b8ef07 | |||
| 3f7b839e0a | |||
| e5de18e80f |
@@ -1,21 +1,20 @@
|
|||||||
from sqlalchemy import Column, Integer, String, DateTime
|
from sqlalchemy import Column, Integer, String
|
||||||
from ..core.database import Base
|
from ..core.database import Base
|
||||||
|
|
||||||
|
|
||||||
class LoseData(Base):
|
class LoseData(Base):
|
||||||
|
"""缺失数据记录表:记录各水准线路(期数)的原始/沉降数据缺失情况"""
|
||||||
__tablename__ = "lose_data"
|
__tablename__ = "lose_data"
|
||||||
|
|
||||||
id = Column(Integer, primary_key=True, index=True, autoincrement=True)
|
id = Column(Integer, primary_key=True, index=True, autoincrement=True, comment="ID")
|
||||||
account_id = Column(String(100), nullable=False, comment="水准线路编码", index=True)
|
account_id = Column(Integer, nullable=False, comment="账户id", index=True)
|
||||||
NYID = Column(String(100), nullable=False, comment="期数id", index=True)
|
NYID = Column(String(100), nullable=False, comment="期数ID", index=True)
|
||||||
linecode = Column(String(100), nullable=False, comment="水准线路编码", index=True)
|
linecode = Column(String(255), nullable=False, default="0", comment="水准线路编码", index=True)
|
||||||
benchmarkids = Column(String(100), comment="工作基点名称序列")
|
lose_data = Column(Integer, nullable=False, default=0, comment="缺失的数据,默认是0")
|
||||||
point_id = Column(String(100), nullable=False, comment="观测点id", index=True)
|
section_id = Column(String(255), nullable=True, comment="所属断面id")
|
||||||
section_id = Column(String(100), nullable=False, comment="所属断面id")
|
point_id = Column(String(100), nullable=False, comment="测点ID")
|
||||||
lose_data = Column(String(100), comment="水准观测类型")
|
|
||||||
|
|
||||||
# 模型转字典
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""将模型实例转换为字典,支持 Pydantic 序列化"""
|
|
||||||
return {
|
return {
|
||||||
column.name: getattr(self, column.name)
|
column.name: getattr(self, column.name)
|
||||||
for column in self.__table__.columns
|
for column in self.__table__.columns
|
||||||
|
|||||||
@@ -139,9 +139,9 @@ class ConstructionMonitorUtils:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if not base_condition:
|
if not base_condition:
|
||||||
# 当前为冬休且历史全是冬休 → 视为数据未补全,remaining 固定为 -365
|
# 当前为冬休且历史全是冬休 → 视为数据未补全,用 bu_all=-365 表示;remaining 保持原样不改
|
||||||
if latest_condition == "冬休":
|
if latest_condition == "冬休":
|
||||||
item_copy["remaining"] = -365
|
item_copy["bu_all"] = -365
|
||||||
result["data"].append(item_copy)
|
result["data"].append(item_copy)
|
||||||
else:
|
else:
|
||||||
result["winter"].append(item_copy)
|
result["winter"].append(item_copy)
|
||||||
|
|||||||
Reference in New Issue
Block a user