refactor(agent, shipping): 简化代理模型并完善订单抽取业务

- 移除 Agent 的 exposure_mode 与 internal_executor 相关逻辑,清理关联的过滤、序列化代码
- 删除废弃的 AgentRuntimeBinding 模型及其依赖
- 新增订单抽取上传批次、请求快照等数据库迁移与业务逻辑
- 修复附件完整性检测、订单抽取状态映射问题
- 更新多语言错误文案与前端单元测试配置
- 清理平台配置中不再使用的暴露模式配置
This commit is contained in:
hugo committed 2026-07-28 20:25:48 +08:00
1 parent 1f3ecb87b7
commit 61ac6403c4
159 files changed
+12883 -5099

No files matched your search

+3 -4
View File
@@ -16,7 +16,6 @@ from sqlalchemy.orm import joinedload
from app import db
from app.core.errors import AppError, ConflictError, NotFoundError, ValidationError
from app.models import Agent, User
from app.services.agent_user_access import is_user_application, load_grantable_agents
from app.services.auth import casdoor_service
from app.services.user_admin import delete_admin_users
@@ -81,7 +80,7 @@ def serialize_admin_user(user: User) -> dict:
'employee_id': user.employee_id,
'phone_number': user.phone_number,
'feature_permissions': user.get_feature_permissions(),
'agent_ids': [agent.id for agent in user.agents if is_user_application(agent)],
'agent_ids': [agent.id for agent in user.agents],
}
@@ -210,7 +209,7 @@ def create_user(data: dict[str, Any]) -> dict:
db.session.add(user)
try:
if data.get('agent_ids'):
agents = load_grantable_agents(data['agent_ids'])
agents = db.session.query(Agent).filter(Agent.id.in_(data['agent_ids'])).all()
user.agents = agents
casdoor_service.sync_create_user(
username=user.username,
@@ -262,7 +261,7 @@ def update_user(user_id: int, data: dict[str, Any]) -> dict:
if new_password:
user.set_password(new_password)
if 'agent_ids' in data:
agents = load_grantable_agents(data['agent_ids'])
agents = db.session.query(Agent).filter(Agent.id.in_(data['agent_ids'])).all()
user.agents = agents
if new_password:
casdoor_service.sync_update_user(user, new_password=new_password)