feat(in-transit-transfer): 自动调拨联动收料就绪并分层来源错误
- 调度整合:退役 in_transit_receipt_file_job,收料归档收敛 shipping_receipt_rpa_archive,排程注册表统一 - 自动调拨 Job:调拨前确保各来源当日收料文件就绪(缺失自动触发收料 RPA),严格等量匹配后生成 ERP 调拨单 - worker 手动唤醒:排程工作台支持手动唤醒与 runs 透视,heartbeat 协议同步 - 收料缺失幸存 T2:parse_failed 状态落库(迁移 q4c5) - 来源错误分层与 stale 时钟换源:改挂 inventory_checked_at 库存查得时刻,展示阈值与执行门禁解耦(迁移 t5a6) - 新增 wecom_sender 企微通知:每非空 Run 汇总一条,通知失败不影响 ERP 结果 - 同步排程工作台/调拨卡片前端、chat/admin 文案四语言、RPA 脚本与测试全家
This commit is contained in:
1 parent
993e581135
commit
abf3d48927
144 files changed
+10161
-2132
No files matched your search
@@ -0,0 +1,40 @@
|
||||
"""Add parse failure markers to shipping_receipt_report_files.
|
||||
|
||||
用途:shipping_receipt_report_files 新增三个可空列 parse_failed_at /
|
||||
parse_error_code / parse_error_message,为在途调拨来源错误分层提供
|
||||
「parse 失败」归档标记。
|
||||
依赖:shipping_receipt_report_files 表(收料原样归档文件);
|
||||
模型 backend/app/models/shipping_receipt_report.py 的
|
||||
ShippingReceiptReportFile 同步声明同名列。
|
||||
逻辑:解析失败时写入失败时间与错误码(≤64)/错误详情(Text);
|
||||
三列均为可空且无默认值,三者全空表示未失败或已清除,历史行
|
||||
与正常解析行不受影响;downgrade 直接 drop 三列。
|
||||
|
||||
Revision ID: q4c5d6e7f8a9
|
||||
Revises: p1b2c3d4e5f6
|
||||
Create Date: 2026-09-29 00:00:00.000000
|
||||
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
revision = "q4c5d6e7f8a9"
|
||||
down_revision = "p1b2c3d4e5f6"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.add_column("shipping_receipt_report_files", sa.Column("parse_failed_at", sa.DateTime(), nullable=True))
|
||||
op.add_column("shipping_receipt_report_files", sa.Column("parse_error_code", sa.String(length=64), nullable=True))
|
||||
op.add_column("shipping_receipt_report_files", sa.Column("parse_error_message", sa.Text(), nullable=True))
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_column("shipping_receipt_report_files", "parse_error_message")
|
||||
op.drop_column("shipping_receipt_report_files", "parse_error_code")
|
||||
op.drop_column("shipping_receipt_report_files", "parse_failed_at")
|
||||
@@ -0,0 +1,43 @@
|
||||
"""Add inventory_checked_at to transfer_invoice_items.
|
||||
|
||||
用途:transfer_invoice_items 新增可空列 inventory_checked_at,承载「当前
|
||||
external_quantity 的 ERP 取数时刻」,修复 stale 徽标判定时钟被证据同步
|
||||
换戳续期污染的问题(此前 stale 挂 updated_at,每日收料文件同步会把
|
||||
老行新鲜度续期,徽标对最需要提示的行永不触发)。
|
||||
依赖:transfer_invoice_items 表(调拨明细行);模型
|
||||
backend/app/models/in_transit_transfer.py 的 TransferInvoiceItem
|
||||
同步声明同名列。
|
||||
逻辑:仅匹配评估/重查/执行写前复查在真实取数时写入;证据同步换戳/
|
||||
存续分支不续期本字段,置空库存时同步置空。回填口径:存量行中
|
||||
external_quantity 非空者以 updated_at 近似(历史取数时刻未单独
|
||||
记录,取行最后一次变更是可得的最优近似);无库存数据行保持
|
||||
NULL。downgrade 直接 drop。
|
||||
|
||||
Revision ID: t5a6b7c8d9e0f
|
||||
Revises: q4c5d6e7f8a9
|
||||
Create Date: 2026-09-29 00:00:00.000000
|
||||
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
revision = "t5a6b7c8d9e0f"
|
||||
down_revision = "q4c5d6e7f8a9"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.add_column("transfer_invoice_items", sa.Column("inventory_checked_at", sa.DateTime(), nullable=True))
|
||||
op.execute(
|
||||
"UPDATE transfer_invoice_items SET inventory_checked_at = updated_at "
|
||||
"WHERE external_quantity IS NOT NULL"
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_column("transfer_invoice_items", "inventory_checked_at")
|
||||
Reference in new issue
Block a user