feat(shipping-notice): 实现滚动履约功能,优化发货通知流程与代码清理
清理废弃的ShippingCase相关代码与依赖,统一使用ShippingNotice直接关联客户数据。调整库存网关依赖规则,支持仅对库存满足或已人工放行的订单行生成发货Excel,实现滚动履约逻辑。
This commit is contained in:
1 parent
7cfd5d167e
commit
1e5aedb9ed
235 files changed
+11394
-9613
No files matched your search
@@ -25,6 +25,7 @@ from typing import List, Optional
|
||||
from sqlalchemy import (
|
||||
Boolean,
|
||||
CheckConstraint,
|
||||
Date,
|
||||
DateTime,
|
||||
Float,
|
||||
ForeignKey,
|
||||
@@ -54,6 +55,7 @@ class ShippingNotice(Base):
|
||||
Index('ix_shipping_notices_conversation', 'conversation_id'),
|
||||
Index('ix_shipping_notices_current_step', 'current_step'),
|
||||
Index('ix_shipping_notices_upload_status', 'upload_status'),
|
||||
Index('ix_shipping_notices_business_no', 'business_no'),
|
||||
Index('ix_shipping_notices_inventory_source_code', 'inventory_source_code'),
|
||||
Index('ix_shipping_notices_inventory_source_status', 'inventory_source_status'),
|
||||
Index('ix_shipping_notices_inventory_routing_fingerprint', 'inventory_routing_fingerprint'),
|
||||
@@ -70,11 +72,16 @@ class ShippingNotice(Base):
|
||||
|
||||
id: Mapped[int] = mapped_column(primary_key=True)
|
||||
task_no: Mapped[str] = mapped_column(String(64), unique=True, index=True)
|
||||
shipping_case_id: Mapped[Optional[int]] = mapped_column(
|
||||
ForeignKey('shipping_cases.id'),
|
||||
index=True,
|
||||
nullable=True,
|
||||
customer_id: Mapped[Optional[int]] = mapped_column(
|
||||
ForeignKey('shipping_customers.id'), index=True, nullable=True,
|
||||
)
|
||||
customer_name_snapshot: Mapped[Optional[str]] = mapped_column(String(200), nullable=True)
|
||||
customer_short_code_snapshot: Mapped[Optional[str]] = mapped_column(String(6), nullable=True)
|
||||
# 发货通知单的对外业务编号;同一 PO 的不同波次各自拥有独立编号。
|
||||
business_no: Mapped[Optional[str]] = mapped_column(String(32), nullable=True, unique=True)
|
||||
business_date: Mapped[Optional[datetime]] = mapped_column(Date, nullable=True)
|
||||
business_sequence_value: Mapped[Optional[int]] = mapped_column(Integer, nullable=True)
|
||||
business_numbering_rule_version: Mapped[Optional[str]] = mapped_column(String(32), nullable=True)
|
||||
user_id: Mapped[Optional[int]] = mapped_column(ForeignKey('users.id'), index=True, nullable=True)
|
||||
conversation_id: Mapped[Optional[str]] = mapped_column(String(100), nullable=True)
|
||||
source_type: Mapped[str] = mapped_column(String(32), default='manual')
|
||||
@@ -234,11 +241,7 @@ class ShippingNotice(Base):
|
||||
|
||||
created_at: Mapped[datetime] = mapped_column(default=datetime.utcnow, index=True)
|
||||
updated_at: Mapped[datetime] = mapped_column(default=datetime.utcnow, onupdate=datetime.utcnow)
|
||||
shipping_case: Mapped[Optional['ShippingCase']] = relationship(
|
||||
'ShippingCase',
|
||||
back_populates='tasks',
|
||||
lazy='joined',
|
||||
)
|
||||
customer: Mapped[Optional['ShippingCustomer']] = relationship('ShippingCustomer', lazy='joined')
|
||||
events: Mapped[List['ShippingTaskEvent']] = relationship(
|
||||
'ShippingTaskEvent',
|
||||
back_populates='task',
|
||||
|
||||
Reference in new issue
Block a user