feat: 实时数据持久化到计划/实绩 + 质量管理改版(钢卷信息+异常记录+继承)
- 在产计划持久化实时数据快照(run_data),物料跟踪每次轮询上报;生产完成写入实绩 process_data - 实绩页点击行展开生产阶段数据 + 实时数据快照(测点列表) - 质量管理默认进入异常管理,改为全宽:顶部选卷 + 钢卷信息(5列) + 异常记录表 - 异常记录新增「继承来源」列与「继承」按钮(从来源卷复制缺陷),进入即预置6行 - qc_defect 增加 inherit_source 字段 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -43,6 +43,7 @@ class ProductionPlan(Base):
|
||||
run_speed = Column(Float, default=0, comment="当前线速度 m/min")
|
||||
run_length_m = Column(Float, default=0, comment="带头已生产长度 m")
|
||||
produced_at = Column(DateTime, comment="生产完成时间")
|
||||
run_data = Column(JSON, comment="生产期间实时数据快照")
|
||||
|
||||
# 兼容历史字段
|
||||
shift = Column(String(10), comment="班次")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from sqlalchemy import Column, Integer, String, Float, DateTime, Text, ForeignKey, func
|
||||
from sqlalchemy import Column, Integer, String, Float, DateTime, Text, ForeignKey, JSON, func
|
||||
from app.database import Base
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ class ProductionRecord(Base):
|
||||
length_per_ton = Column(Float, comment="吨钢长度 m/t")
|
||||
offline_time = Column(DateTime, comment="下线时间")
|
||||
status = Column(String(20), default="UNWEIGH", comment="状态: UNWEIGH/PRODUCT")
|
||||
process_data = Column(JSON, comment="生产阶段实时数据快照")
|
||||
|
||||
# 兼容历史字段
|
||||
shift_date = Column(DateTime)
|
||||
|
||||
@@ -57,6 +57,7 @@ class QcDefect(Base):
|
||||
side_middle = Column(Boolean, default=False, comment="中间")
|
||||
side_drive = Column(Boolean, default=False, comment="驱动侧")
|
||||
is_main = Column(Boolean, default=False, comment="主缺陷")
|
||||
inherit_source = Column(String(30), nullable=True, comment="继承来源卷号")
|
||||
image_url = Column(String(255), nullable=True, comment="缺陷图片URL")
|
||||
|
||||
# 兼容旧字段
|
||||
|
||||
Reference in New Issue
Block a user