|
|
@@ -372,6 +372,20 @@ class InstitutionService:
|
|
|
if not result_dict:
|
|
|
return None
|
|
|
|
|
|
+ # 合并本地DB的自定义字段(支付宝不包含的字段)
|
|
|
+ try:
|
|
|
+ crud = InstitutionCRUD(auth)
|
|
|
+ local_obj = await crud.get(institution_id=institution_id, enterprise_id=enterprise_id)
|
|
|
+ if local_obj:
|
|
|
+ local_dict = InstitutionListOutSchema.model_validate(local_obj).model_dump()
|
|
|
+ for field in ("applicable_scope", "grant_mode", "period_type", "amount",
|
|
|
+ "single_limit", "effective_time_type", "employee_ids",
|
|
|
+ "period_type", "scope_owner_id_list"):
|
|
|
+ if field in local_dict and local_dict[field] is not None:
|
|
|
+ result_dict[field] = local_dict[field]
|
|
|
+ except Exception as e:
|
|
|
+ log.warning(f"合并本地DB字段失败: {e}")
|
|
|
+
|
|
|
# 补充本地规则和额度
|
|
|
from app.plugin.module_payment.expense.rule.model import ExpenseRuleModel
|
|
|
from app.plugin.module_payment.expense.quota.model import QuotaModel
|