|
|
@@ -51,6 +51,13 @@ async def create_institution_controller(
|
|
|
"""创建费控制度(含完整串联流程)"""
|
|
|
institution_create_model = AlipayEbppInvoiceInstitutionCreateModel.from_alipay_dict(data)
|
|
|
enterprise_id = data.get("enterprise_id", "")
|
|
|
+ if not enterprise_id:
|
|
|
+ from app.plugin.module_payment.enterprise.model import EnterpriseModel
|
|
|
+ from sqlalchemy import select
|
|
|
+ stmt = select(EnterpriseModel).where(EnterpriseModel.tenant_id == auth.tenant_id).limit(1)
|
|
|
+ result = await auth.db.execute(stmt)
|
|
|
+ enterprise = result.scalar_one_or_none()
|
|
|
+ enterprise_id = enterprise.enterprise_id if enterprise else ""
|
|
|
|
|
|
# 解析适用成员数据
|
|
|
scope_data = None
|