From 450b30966dcf2965c214b929142b4e15483953f3 Mon Sep 17 00:00:00 2001 From: zlwu <704541015@qq.com> Date: Wed, 19 Aug 2026 12:41:58 +0800 Subject: [PATCH] feat(backend): add BizQcMaterialMonthTemplate model Co-authored-by: Cursor --- backend/app/models/models.py | 2 +- backend/app/models/qc_material.py | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/backend/app/models/models.py b/backend/app/models/models.py index a8da9cac..4523b93a 100644 --- a/backend/app/models/models.py +++ b/backend/app/models/models.py @@ -4009,7 +4009,7 @@ class BizEnvDetectRecord(Base): from app.models.qc_param import BizQcItemParam, BizQcTaskResult # noqa: E402,F401 -from app.models.qc_material import BizQcMaterial, BizQcMaterialStockBatch, BizQcMaterialUsage # noqa: E402,F401 +from app.models.qc_material import BizQcMaterial, BizQcMaterialMonthTemplate, BizQcMaterialStockBatch, BizQcMaterialUsage # noqa: E402,F401 from app.models.production_material import ( # noqa: E402,F401 BizProductionMaterial, BizProductionMaterialStockBatch, diff --git a/backend/app/models/qc_material.py b/backend/app/models/qc_material.py index 1356aa44..8ef4852b 100644 --- a/backend/app/models/qc_material.py +++ b/backend/app/models/qc_material.py @@ -27,6 +27,33 @@ class BizQcMaterial(Base): del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记") +class BizQcMaterialMonthTemplate(Base): + __tablename__ = "biz_qc_material_month_template" + + id = Column(String(64), primary_key=True, comment="主键ID") + material_id = Column(String(64), nullable=True, comment="关联物料ID") + material_code = Column(String(64), nullable=False, comment="物料编码") + material_name = Column(String(200), nullable=False, comment="物料名称") + spec_model = Column(String(200), nullable=True, comment="规格型号") + unit = Column(String(32), nullable=True, comment="单位") + catalog_no = Column(String(128), nullable=False, comment="货号") + batch_no = Column(String(128), nullable=False, comment="批号") + manufacturer = Column(String(200), nullable=False, comment="厂家") + unit_price = Column(Numeric(18, 2), nullable=False, comment="单价(元)") + amount = Column(Numeric(18, 2), nullable=False, comment="金额(元)") + in_qty = Column(Numeric(18, 4), nullable=False, comment="默认入库数量") + expire_date = Column(Date, nullable=False, comment="默认过期日期") + tenant_no = Column(String(64), nullable=False, default="zkxw", comment="租户编号") + order_num = Column(Integer, nullable=True, comment="排序号") + remark = Column(String(512), nullable=True, comment="备注") + create_by = Column(String(64), nullable=True, comment="创建人id") + create_dept_id = Column(String(64), nullable=False, default="", comment="创建人部门ID") + create_time = Column(DateTime, nullable=False, default=datetime.now, comment="创建时间") + update_by = Column(String(64), nullable=True, comment="更新人id") + update_time = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment="更新时间") + del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记") + + class BizQcMaterialStockBatch(Base): __tablename__ = "biz_qc_material_stock_batch"