feat(shipping-notice): 添加订单抽取功能,支持异步运行和管理,优化相关数据模型和处理逻辑

This commit is contained in:
hugo committed 2026-07-21 09:02:42 +08:00
1 parent 34d489a2d1
commit ce26d6d0c4
144 files changed
+12241 -4233

No files matched your search

+3 -3
View File
@@ -38,11 +38,11 @@ def _list_active_agents_for_user(user: User) -> list[Agent]:
if user.role == 'admin':
return (
db.session.query(Agent)
.filter(Agent.is_active.is_(True))
.filter(Agent.is_active.is_(True), Agent.exposure_mode == 'workspace')
.order_by(Agent.id.asc())
.all()
)
return [agent for agent in user.agents if agent.is_active]
return [agent for agent in user.agents if agent.is_active and agent.exposure_mode == 'workspace']
@agents_bp.route('', methods=['GET'])
@@ -70,7 +70,7 @@ def list_agent_guides(agent_id):
if agent_id == 0:
generic_agent = (
db.session.query(Agent)
.filter_by(agent_code='generic', is_active=True)
.filter_by(agent_code='generic', is_active=True, exposure_mode='workspace')
.order_by(Agent.sort_order.asc(), Agent.id.asc())
.first()
)