From dd4a1ad6095966aab3554eeeda074f8e8a6be204 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 8 May 2026 15:47:23 +0800 Subject: [PATCH] fix: replace uuid.uuid4() with getID() from appPublic.uniqueID for all table ID generation --- financial_management/financial_core.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/financial_management/financial_core.py b/financial_management/financial_core.py index 5c44f1a..e89857d 100644 --- a/financial_management/financial_core.py +++ b/financial_management/financial_core.py @@ -5,6 +5,7 @@ Financial Management Module - Core Business Logic """ import uuid +from appPublic.uniqueID import getID from datetime import datetime, date, timedelta from typing import Dict, List, Optional from decimal import Decimal @@ -43,7 +44,7 @@ async def create_receivable_from_order(order_id: str, org_id: str) -> str: created_at = datetime.strptime(created_at, "%Y-%m-%d %H:%M:%S") due_date = (created_at + timedelta(days=30)).date() if created_at else None - receivable_id = str(uuid.uuid4()).replace('-', '')[:32] + receivable_id = getID()[:32] await sor.sqlExe(""" INSERT INTO receivables (id, order_id, contract_id, customer_id, receivable_amount, received_amount, due_date, status, org_id, created_at, updated_at) @@ -64,7 +65,7 @@ async def create_receivable_from_order(order_id: str, org_id: str) -> str: async def create_receipt(receipt_data: Dict, user_id: str, org_id: str) -> str: """收款录入""" async with await get_financial_db() as sor: - receipt_id = str(uuid.uuid4()).replace('-', '')[:32] + receipt_id = getID()[:32] await sor.sqlExe(""" INSERT INTO receipts (id, customer_id, total_amount, receipt_date, receipt_method, status, org_id, created_by, created_at, updated_at) @@ -132,7 +133,7 @@ async def send_overdue_notifications(org_id: str, days_overdue: int = 30) -> int async def create_payment(payment_data: Dict, user_id: str, org_id: str) -> str: """创建支出记录""" async with await get_financial_db() as sor: - payment_id = str(uuid.uuid4()).replace('-', '')[:32] + payment_id = getID()[:32] await sor.sqlExe(""" INSERT INTO payments (id, contract_id, payment_amount, payment_date, payment_method, status, org_id, created_by, created_at, updated_at)