|
|
@@ -543,6 +543,12 @@ class InstitutionService:
|
|
|
失败时降级到本地DB
|
|
|
"""
|
|
|
result_dict = None
|
|
|
+ if not enterprise_id:
|
|
|
+ from .crud import InstitutionCRUD
|
|
|
+ inst_crud = InstitutionCRUD(auth)
|
|
|
+ local_inst = await inst_crud.get(institution_id=institution_id)
|
|
|
+ if local_inst and local_inst.enterprise_id:
|
|
|
+ enterprise_id = local_inst.enterprise_id
|
|
|
try:
|
|
|
model = AlipayEbppInvoiceInstitutionDetailinfoQueryModel()
|
|
|
model.institution_id = institution_id
|
|
|
@@ -971,6 +977,13 @@ class InstitutionScopeService:
|
|
|
model.institution_id = institution_id
|
|
|
model.page_num = page_num
|
|
|
model.page_size = page_size
|
|
|
+ if not enterprise_id:
|
|
|
+ # 从本地 DB 查找 enterprise_id
|
|
|
+ from .crud import InstitutionCRUD
|
|
|
+ inst_crud = InstitutionCRUD(auth)
|
|
|
+ local_inst = await inst_crud.get(institution_id=institution_id)
|
|
|
+ if local_inst and local_inst.enterprise_id:
|
|
|
+ enterprise_id = local_inst.enterprise_id
|
|
|
if enterprise_id:
|
|
|
model.enterprise_id = enterprise_id
|
|
|
if owner_type:
|