全局中文化

This commit is contained in:
Cheng Zhou
2026-01-12 11:14:04 +08:00
parent 9021c7fe2b
commit 1338fa7e2b
103 changed files with 2443 additions and 1533 deletions
+7 -7
View File
@@ -15,7 +15,7 @@ router = APIRouter()
async def _ensure_study_exists(db: AsyncSession, study_id: uuid.UUID):
study = await study_crud.get(db, study_id)
if not study:
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Study not found")
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="项目不存在")
return study
@@ -39,7 +39,7 @@ async def create_contract(
entity_type="finance_contract",
entity_id=contract.id,
action="CREATE_FINANCE_CONTRACT",
detail=f"Finance contract {contract.contract_no} created",
detail=f"合同费用 {contract.contract_no} 已创建",
operator_id=current_user.id,
operator_role=current_user.role,
)
@@ -77,7 +77,7 @@ async def get_contract(
await _ensure_study_exists(db, study_id)
contract = await contract_crud.get_contract(db, contract_id)
if not contract or contract.study_id != study_id:
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Contract not found")
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="合同不存在")
return FinanceContractRead.model_validate(contract)
@@ -96,7 +96,7 @@ async def update_contract(
await _ensure_study_exists(db, study_id)
contract = await contract_crud.get_contract(db, contract_id)
if not contract or contract.study_id != study_id:
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Contract not found")
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="合同不存在")
contract = await contract_crud.update_contract(db, contract, contract_in)
await audit_crud.log_action(
db,
@@ -104,7 +104,7 @@ async def update_contract(
entity_type="finance_contract",
entity_id=contract_id,
action="UPDATE_FINANCE_CONTRACT",
detail=f"Finance contract {contract_id} updated",
detail=f"合同费用 {contract_id} 已更新",
operator_id=current_user.id,
operator_role=current_user.role,
)
@@ -125,7 +125,7 @@ async def delete_contract(
await _ensure_study_exists(db, study_id)
contract = await contract_crud.get_contract(db, contract_id)
if not contract or contract.study_id != study_id:
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Contract not found")
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="合同不存在")
await contract_crud.delete_contract(db, contract)
await audit_crud.log_action(
db,
@@ -133,7 +133,7 @@ async def delete_contract(
entity_type="finance_contract",
entity_id=contract_id,
action="DELETE_FINANCE_CONTRACT",
detail=f"Finance contract {contract_id} deleted",
detail=f"合同费用 {contract_id} 已删除",
operator_id=current_user.id,
operator_role=current_user.role,
)