瀏覽代碼

feat(pl): add ORM models for feedback brand qty tables

Co-authored-by: Cursor <cursoragent@cursor.com>
zlwu 3 月之前
父節點
當前提交
79f87d39a7
共有 2 個文件被更改,包括 98 次插入 和 0 次删除
  1. 8 0
      backend/app/models/__init__.py
  2. 90 0
      backend/app/models/pl_models.py

+ 8 - 0
backend/app/models/__init__.py

@@ -40,7 +40,11 @@ from app.models.pl_models import (
     PlPlanProductBrandQty,
     PlPlanChange,
     PlTransport,
+    PlTransportProductFeedback,
+    PlTransportProductBrandQty,
     PlTransportDbLink,
+    PlInboundOrderItemBrandQty,
+    PlOutboundOrderItemBrandQty,
     PlPlanTransport,
     PlTransportApproval,
     PlFreightSettlement,
@@ -100,7 +104,11 @@ __all__ = [
     "PlPlanProductBrandQty",
     "PlPlanChange",
     "PlTransport",
+    "PlTransportProductFeedback",
+    "PlTransportProductBrandQty",
     "PlTransportDbLink",
+    "PlInboundOrderItemBrandQty",
+    "PlOutboundOrderItemBrandQty",
     "PlPlanTransport",
     "PlTransportApproval",
     "PlFreightSettlement",

+ 90 - 0
backend/app/models/pl_models.py

@@ -506,6 +506,50 @@ class PlTransport(Base):
     del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记:0-正常 1-已删除")
 
 
+class PlTransportProductFeedback(Base):
+    """运输单按产品回传 pl_transport_product_feedback"""
+
+    __tablename__ = "pl_transport_product_feedback"
+
+    id = Column(String(64), primary_key=True, comment="主键ID")
+    transport_id = Column(String(64), nullable=False, comment="运输单ID")
+    plan_id = Column(String(64), nullable=False, comment="计划ID")
+    plan_product_id = Column(String(64), nullable=False, comment="计划产品行ID")
+    actual_qty = Column(DECIMAL(15, 3), nullable=False, default=0, comment="该产品回传总量")
+    tenant_no = Column(String(64), nullable=False, default="shanxia2.0", 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="删除标记:0-正常 1-已删除")
+
+
+class PlTransportProductBrandQty(Base):
+    """运输单产品回传品牌数量 pl_transport_product_brand_qty"""
+
+    __tablename__ = "pl_transport_product_brand_qty"
+
+    id = Column(String(64), primary_key=True, comment="主键ID")
+    transport_id = Column(String(64), nullable=False, comment="运输单ID")
+    plan_product_id = Column(String(64), nullable=False, comment="计划产品行ID")
+    feedback_id = Column(String(64), nullable=True, comment="产品回传行ID")
+    brand_id = Column(String(64), nullable=False, default="", comment="品牌ID")
+    brand_name = Column(String(100), nullable=True, comment="品牌名称")
+    qty = Column(DECIMAL(15, 3), nullable=False, default=0, comment="本品牌数量")
+    tenant_no = Column(String(64), nullable=False, default="shanxia2.0", 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="删除标记:0-正常 1-已删除")
+
+
 class PlTransportDbLink(Base):
     """运输-地磅出入库关联 pl_transport_db_link"""
 
@@ -637,6 +681,29 @@ class PlInboundOrderItem(Base):
     del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记:0-正常 1-已删除")
 
 
+class PlInboundOrderItemBrandQty(Base):
+    """入库明细品牌数量 pl_inbound_order_item_brand_qty"""
+
+    __tablename__ = "pl_inbound_order_item_brand_qty"
+
+    id = Column(String(64), primary_key=True, comment="主键ID")
+    order_id = Column(String(64), nullable=False, comment="入库单ID")
+    order_item_id = Column(String(64), nullable=False, comment="入库明细ID")
+    plan_product_id = Column(String(64), nullable=False, comment="计划产品行ID")
+    brand_id = Column(String(64), nullable=False, default="", comment="品牌ID")
+    brand_name = Column(String(100), nullable=True, comment="品牌名称")
+    qty = Column(DECIMAL(15, 3), nullable=False, default=0, comment="本品牌数量")
+    tenant_no = Column(String(64), nullable=False, default="shanxia2.0", 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="删除标记:0-正常 1-已删除")
+
+
 class PlOutboundOrder(Base):
     """运输计划-出库单 pl_outbound_order"""
 
@@ -693,6 +760,29 @@ class PlOutboundOrderItem(Base):
     del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记:0-正常 1-已删除")
 
 
+class PlOutboundOrderItemBrandQty(Base):
+    """出库明细品牌数量 pl_outbound_order_item_brand_qty"""
+
+    __tablename__ = "pl_outbound_order_item_brand_qty"
+
+    id = Column(String(64), primary_key=True, comment="主键ID")
+    order_id = Column(String(64), nullable=False, comment="出库单ID")
+    order_item_id = Column(String(64), nullable=False, comment="出库明细ID")
+    plan_product_id = Column(String(64), nullable=False, comment="计划产品行ID")
+    brand_id = Column(String(64), nullable=False, default="", comment="品牌ID")
+    brand_name = Column(String(100), nullable=True, comment="品牌名称")
+    qty = Column(DECIMAL(15, 3), nullable=False, default=0, comment="本品牌数量")
+    tenant_no = Column(String(64), nullable=False, default="shanxia2.0", 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="删除标记:0-正常 1-已删除")
+
+
 class PlTransportApproval(Base):
     """运输审批记录表 pl_transport_approval"""