- 复制来源: /home/yueli/track @ 192c8ee (feature/ai-audit-update) - 组织隔离目标: LICA - 端口规划: 前端 8030 / 后端 8031 / 数据库 8032 - 已排除 deploy.sh、deploy_full.sh、docker-compose.prod.yml(IRIS 生产发布脚本) - 已排除工作区未提交改动,取干净的 192c8ee 状态
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
"""生产订单模型"""
|
|
import uuid
|
|
from datetime import datetime
|
|
from sqlalchemy import String, DateTime
|
|
from sqlalchemy.dialects.postgresql import UUID
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.models.base import Base
|
|
from app.core.time_utils import get_beijing_time
|
|
|
|
|
|
class ProductionOrder(Base):
|
|
__tablename__ = "production_orders"
|
|
|
|
id: Mapped[uuid.UUID] = mapped_column(
|
|
UUID(as_uuid=True), primary_key=True, default=uuid.uuid4,
|
|
)
|
|
order_no: Mapped[str] = mapped_column(
|
|
String(64), unique=True, index=True, nullable=False, comment="订单编号",
|
|
)
|
|
customer_info: Mapped[str | None] = mapped_column(
|
|
String(500), nullable=True, comment="客户信息",
|
|
)
|
|
status: Mapped[str] = mapped_column(
|
|
String(50), nullable=False, default="pending", comment="订单状态",
|
|
)
|
|
created_at: Mapped[datetime] = mapped_column(
|
|
DateTime(timezone=True), default=get_beijing_time, comment="创建时间",
|
|
)
|
|
|
|
def __repr__(self) -> str:
|
|
return f"<ProductionOrder {self.order_no}>"
|