feat(shipping-notice): 增强订单抽取功能,添加进度事件和诊断运行管理,优化数据模型和访问控制

This commit is contained in:
hugo committed 2026-07-21 23:17:29 +08:00
1 parent ce26d6d0c4
commit c4095b08da
175 files changed
+13064 -1814

No files matched your search

+4 -3
View File
@@ -16,6 +16,7 @@ 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
@@ -80,7 +81,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],
'agent_ids': [agent.id for agent in user.agents if is_user_application(agent)],
}
@@ -209,7 +210,7 @@ def create_user(data: dict[str, Any]) -> dict:
db.session.add(user)
try:
if data.get('agent_ids'):
agents = db.session.query(Agent).filter(Agent.id.in_(data['agent_ids'])).all()
agents = load_grantable_agents(data['agent_ids'])
user.agents = agents
casdoor_service.sync_create_user(
username=user.username,
@@ -261,7 +262,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 = db.session.query(Agent).filter(Agent.id.in_(data['agent_ids'])).all()
agents = load_grantable_agents(data['agent_ids'])
user.agents = agents
if new_password:
casdoor_service.sync_update_user(user, new_password=new_password)