|
|
@@ -98,10 +98,12 @@ async def _sync_employee_quota(
|
|
|
existing = await auth.db.execute(check)
|
|
|
if not existing.scalar_one_or_none():
|
|
|
total, available, status = _compute_quota_status(inst)
|
|
|
+ out_biz_no = f"scope_{inst_id}_{employee_id}"
|
|
|
stmt = insert(QuotaModel).values(
|
|
|
employee_id=employee_id,
|
|
|
institution_id=inst_id,
|
|
|
- out_biz_no=f"scope_{inst_id}_{employee_id}",
|
|
|
+ out_biz_no=out_biz_no,
|
|
|
+ quota_id=out_biz_no,
|
|
|
total_amount=total,
|
|
|
available_amount=available,
|
|
|
status=status,
|
|
|
@@ -214,9 +216,11 @@ async def sync_employee_to_all_institution(
|
|
|
if existing.scalar_one_or_none():
|
|
|
continue
|
|
|
total, available, status = _compute_quota_status(inst)
|
|
|
+ out_biz_no = f"all_{inst_id}_{employee_id}"
|
|
|
stmt = insert(QuotaModel).values(
|
|
|
employee_id=employee_id, institution_id=inst_id,
|
|
|
- out_biz_no=f"all_{inst_id}_{employee_id}",
|
|
|
+ out_biz_no=out_biz_no,
|
|
|
+ quota_id=out_biz_no,
|
|
|
total_amount=total, available_amount=available,
|
|
|
status=status,
|
|
|
enterprise_id=enterprise_id, tenant_id=tenant_id,
|