feat(shipping_notice): 完成货代发货通知全流程功能迭代与重构
主要变更: 1. 移除废弃的发货通知字段抽取独立Workflow Agent相关代码 2. 重构Dify服务调用,新增inputs参数支持注入环境变量配置的工具API地址与密钥 3. 新增auto_progress工具API与checkpoint catalog接口,支持流程自动推进 4. 统一字段命名,将column_mapping_json改为map_json并兼容旧有调用 5. 重构库存匹配、解析结果的展示格式,改为标准化多语言Markdown表格 6. 新增ODM ID库存字段支持,优化库存解析与映射逻辑 7. 新增LibreOffice转换隔离Profile配置,避免多实例运行冲突 8. 新增完整环境变量配置、数据库迁移脚本与测试用例 9. 适配前端代码,更新字段命名与聊天跳转逻辑 10. 更新OpenAPI规范适配Dify工具调用,删除已归档的旧部署文档
This commit is contained in:
1 parent
2ce5256483
commit
c18c0394d0
50 files changed
+6088
-2407
No files matched your search
@@ -0,0 +1,51 @@
|
||||
"""shorten shipping notice state and reason strings
|
||||
|
||||
Revision ID: e8f9a0b1c2d3
|
||||
Revises: a7b8c9d0e1f2
|
||||
Create Date: 2026-05-29 12:00:00.000000
|
||||
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
|
||||
|
||||
revision = "e8f9a0b1c2d3"
|
||||
down_revision = "a7b8c9d0e1f2"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
_PENDING_MAP = {
|
||||
"inventory_field_mapping_review": "align_review",
|
||||
"inventory_mapping_inference": "map_infer",
|
||||
"low_parse_confidence": "low_confidence",
|
||||
"inventory_shortage": "shortage",
|
||||
"reservation_id_required": "rsv_req",
|
||||
"inventory_rpa_exhausted": "rpa_exhausted",
|
||||
"inventory_rpa_pending": "rpa_pending",
|
||||
"inventory_unavailable": "inv_unavail",
|
||||
}
|
||||
|
||||
_REVIEW_MAP = {
|
||||
"inventory_mapping_review": "align_review",
|
||||
"inventory_shortage_review": "shortage_review",
|
||||
"reservation_id_required": "rsv_req",
|
||||
}
|
||||
|
||||
|
||||
def _replace_column(table: str, column: str, mapping: dict[str, str]) -> None:
|
||||
for old, new in mapping.items():
|
||||
op.execute(
|
||||
f"UPDATE {table} SET {column} = '{new}' WHERE {column} = '{old}'"
|
||||
)
|
||||
|
||||
|
||||
def upgrade():
|
||||
_replace_column("shipping_tasks", "pending_human_reason", _PENDING_MAP)
|
||||
_replace_column("shipping_tasks", "review_status", _REVIEW_MAP)
|
||||
|
||||
|
||||
def downgrade():
|
||||
pending_rev = {v: k for k, v in _PENDING_MAP.items()}
|
||||
review_rev = {v: k for k, v in _REVIEW_MAP.items()}
|
||||
_replace_column("shipping_tasks", "pending_human_reason", pending_rev)
|
||||
_replace_column("shipping_tasks", "review_status", review_rev)
|
||||
@@ -44,11 +44,13 @@ def upgrade():
|
||||
with op.batch_alter_table('schedule_tasks', schema=None) as batch_op:
|
||||
batch_op.drop_index(batch_op.f('ix_schedule_tasks_id'))
|
||||
|
||||
op.execute("ALTER TABLE users DROP CONSTRAINT IF EXISTS uq_users_wecom_unionid")
|
||||
op.execute("ALTER TABLE users DROP CONSTRAINT IF EXISTS uq_users_wecom_userid")
|
||||
op.execute("DROP INDEX IF EXISTS uq_users_wecom_unionid")
|
||||
op.execute("DROP INDEX IF EXISTS uq_users_wecom_userid")
|
||||
with op.batch_alter_table('users', schema=None) as batch_op:
|
||||
batch_op.drop_index(batch_op.f('uq_users_wecom_unionid'))
|
||||
batch_op.drop_index(batch_op.f('uq_users_wecom_userid'))
|
||||
batch_op.create_unique_constraint(None, ['wecom_unionid'])
|
||||
batch_op.create_unique_constraint(None, ['wecom_userid'])
|
||||
batch_op.create_unique_constraint('uq_users_wecom_unionid', ['wecom_unionid'])
|
||||
batch_op.create_unique_constraint('uq_users_wecom_userid', ['wecom_userid'])
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
@@ -56,8 +58,8 @@ def upgrade():
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('users', schema=None) as batch_op:
|
||||
batch_op.drop_constraint(None, type_='unique')
|
||||
batch_op.drop_constraint(None, type_='unique')
|
||||
batch_op.drop_constraint('uq_users_wecom_unionid', type_='unique')
|
||||
batch_op.drop_constraint('uq_users_wecom_userid', type_='unique')
|
||||
batch_op.create_index(batch_op.f('uq_users_wecom_userid'), ['wecom_userid'], unique=True)
|
||||
batch_op.create_index(batch_op.f('uq_users_wecom_unionid'), ['wecom_unionid'], unique=True)
|
||||
|
||||
|
||||
Reference in new issue
Block a user