Files
shanxia2.0/backend/app/models/pl_dispatch_calendar.py
T

38 lines
2.1 KiB
Python

"""独立手工派车记录,与运输计划无写入联动。"""
from datetime import datetime
from sqlalchemy import Column, Date, DateTime, Index, Integer, SmallInteger, String
from app.core.database import Base
class PlDispatchCalendar(Base):
__tablename__ = "pl_dispatch_calendar"
__table_args__ = (
Index("idx_dispatch_calendar_month", "tenant_no", "del_flag", "dispatch_date"),
Index("idx_dispatch_calendar_vehicle", "tenant_no", "vehicle_id", "dispatch_date"),
)
id = Column(String(64), primary_key=True, comment="主键UUID")
dispatch_date = Column(Date, nullable=False, comment="派车日期")
vehicle_id = Column(String(64), nullable=False, comment="车辆ID")
license_plate = Column(String(20), nullable=False, comment="车牌快照")
product_id = Column(String(64), nullable=False, comment="产品ID")
product_name = Column(String(200), nullable=False, comment="产品名称快照")
origin = Column(String(255), nullable=False, comment="始发地")
destination = Column(String(255), nullable=False, comment="目的地")
quantity = Column(String(16), nullable=True, comment="数量文本(吨),最多两位小数,不参与汇总")
calendar_kind = Column(
String(16), nullable=False, default="acid", server_default="acid",
comment="日历类型:acid酸派车 alkali碱派车 other其他 site现场",
)
tenant_no = Column(String(64), nullable=False, comment="租户编号")
order_num = Column(Integer, nullable=True, comment="排序号")
remark = Column(String(500), nullable=True, comment="备注")
create_by = Column(String(64), nullable=True, comment="创建人")
create_dept_id = Column(String(64), nullable=False, default="", comment="创建部门")
create_time = Column(DateTime, nullable=False, default=datetime.now, comment="创建时间")
update_by = Column(String(64), nullable=True, comment="更新人")
update_time = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment="更新时间")
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记")