feat(shipping-notice): 落地 XFA 拆分、版面签名、统一进度与处理域履约

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hugoandCursor committed 2026-08-06 10:18:37 +08:00
1 parent 3a9fbac2fc
commit d2b3d74def
571 files changed
+78064 -24681

No files matched your search

@@ -15,7 +15,7 @@ from werkzeug.datastructures import FileStorage
from app import db
from app.core.errors import AppError
from app.models import ShippingCase, ShippingCustomer, ShippingTask, ShippingTaskEvent, User
from app.models import ShippingCase, ShippingCustomer, ShippingNotice, ShippingTaskEvent, User
from app.services.shipping_notice.customer_identity_gate import (
assert_customer_identity_gate,
confirm_task_customer,
@@ -31,7 +31,7 @@ from app.services.shipping_notice.progress_workflow import auto_progress
from app.services.shipping_notice.task_workflow import retry_task
def _seed_task(*, with_case: bool = True) -> tuple[ShippingTask, ShippingCustomer, User]:
def _seed_task(*, with_case: bool = True) -> tuple[ShippingNotice, ShippingCustomer, User]:
"""创建待确认任务、启用客户和任务用户。"""
sequence = db.session.query(User).count()
user = User(username=f'gate-user-{sequence}', email=f'gate-{sequence}@example.com', role='user')
@@ -43,7 +43,7 @@ def _seed_task(*, with_case: bool = True) -> tuple[ShippingTask, ShippingCustome
if case:
db.session.add(case)
db.session.flush()
task = ShippingTask(
task = ShippingNotice(
task_no=f'SN-GATE-{user.id}', user_id=user.id,
shipping_case_id=case.id if case else None,
customer_resolution_status='pending' if case else None,
@@ -116,7 +116,7 @@ def test_confirm_customer_syncs_revision_chain_and_assigns_number(app):
"""客户确认同步同业务单全部任务,并在同事务生成正式业务号。"""
with app.app_context():
task, customer, user = _seed_task()
revision = ShippingTask(
revision = ShippingNotice(
task_no='SN-GATE-REV', user_id=user.id, shipping_case_id=task.shipping_case_id,
supersedes_task_id=task.id, document_version=2, customer_resolution_status='pending',
process_status='parsed',