feat: 退网评估后端:单个或清单提交,按逻辑站点并行评估并写入固定模板
每个逻辑站点一个排队任务,与采集共用并行数量;工参按拆除前后规则取本系统快照,指标暂用模拟数据;全部站点结束后写频段清退、低效拆除两份结果表。去掉原来的通用导出任务。
This commit is contained in:
@@ -159,6 +159,56 @@ class CellData5G(Base):
|
||||
azimuth: Mapped[str] = mapped_column(Text, default="")
|
||||
|
||||
|
||||
class EvalJob(Base):
|
||||
"""一次提交:单个站点/小区,或一份清单。结果按退网工单类型写成频段清退、低效拆除两份表。"""
|
||||
|
||||
__tablename__ = "eval_job"
|
||||
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True)
|
||||
owner_kind: Mapped[str] = mapped_column(String(16))
|
||||
owner_id: Mapped[str] = mapped_column(String(64), index=True)
|
||||
owner_name: Mapped[str] = mapped_column(String(128), default="")
|
||||
mode: Mapped[str] = mapped_column(String(8))
|
||||
title: Mapped[str] = mapped_column(String(255), default="")
|
||||
city: Mapped[str] = mapped_column(String(32), default="")
|
||||
source_name: Mapped[str] = mapped_column(String(255), default="")
|
||||
status: Mapped[str] = mapped_column(String(16), default="queued", index=True)
|
||||
total: Mapped[int] = mapped_column(Integer, default=0)
|
||||
finished: Mapped[int] = mapped_column(Integer, default=0)
|
||||
failed: Mapped[int] = mapped_column(Integer, default=0)
|
||||
results: Mapped[list] = mapped_column(JSON, default=list)
|
||||
warnings: Mapped[list] = mapped_column(JSON, default=list)
|
||||
error: Mapped[str] = mapped_column(Text, default="")
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=utcnow)
|
||||
finished_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True)
|
||||
|
||||
|
||||
class EvalTask(Base):
|
||||
"""提交里的一个逻辑站点,独立取工参、算周边站、取指标。"""
|
||||
|
||||
__tablename__ = "eval_task"
|
||||
__table_args__ = (Index("ix_eval_task_job_seq", "job_id", "seq"),)
|
||||
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True)
|
||||
job_id: Mapped[int] = mapped_column(ForeignKey("eval_job.id", ondelete="CASCADE"))
|
||||
seq: Mapped[int] = mapped_column(Integer, default=0)
|
||||
site_key: Mapped[str] = mapped_column(String(255), default="")
|
||||
kind: Mapped[str] = mapped_column(String(16), default="pinduan")
|
||||
order_type: Mapped[str] = mapped_column(String(64), default="")
|
||||
removal_date: Mapped[date | None] = mapped_column(Date, nullable=True)
|
||||
target: Mapped[dict] = mapped_column(JSON, default=dict)
|
||||
rows: Mapped[list] = mapped_column(JSON, default=list)
|
||||
status: Mapped[str] = mapped_column(String(16), default="queued", index=True)
|
||||
stage: Mapped[str] = mapped_column(String(64), default="")
|
||||
before_date: Mapped[date | None] = mapped_column(Date, nullable=True)
|
||||
after_date: Mapped[date | None] = mapped_column(Date, nullable=True)
|
||||
after_present: Mapped[bool | None] = mapped_column(Boolean, nullable=True)
|
||||
payload: Mapped[dict] = mapped_column(JSON, default=dict)
|
||||
error: Mapped[str] = mapped_column(Text, default="")
|
||||
started_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True)
|
||||
finished_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True)
|
||||
|
||||
|
||||
class ExportTask(Base):
|
||||
__tablename__ = "export_task"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user