This commit is contained in:
zlwu committed 2026-05-17 12:31:11 +08:00
1 parent e5ba8f097a
commit 62cfb8fbbf
24 files changed
+3323 -249

No files matched your search

+171 -26
View File
@@ -409,6 +409,133 @@ async def submit_collection_protocol_audit(
# ---------------------------------------------------------------------------
@router.get("/protocol-payment-details")
async def list_payment_details(
page: int = Query(1, ge=1),
pageSize: int = Query(10, ge=1, le=100, alias="pageSize"),
payStatus: str = Query("dfj", alias="payStatus"),
keyword: str = Query("", alias="keyword"),
transferType: str = Query("", alias="transferType"),
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
tenant_no = _get_tenant_no(db, user)
items, total = cp_svc.list_payment_details_page(
db,
page=page,
page_size=pageSize,
pay_status=payStatus,
keyword=keyword or None,
transfer_type=transferType or None,
tenant_no=tenant_no,
)
tp = cp_svc.total_pages(total, pageSize)
return success_response({"list": items, "total": total, "page": page, "pageSize": pageSize, "totalPages": tp})
class BatchDetailIdsBody(BaseModel):
model_config = ConfigDict(populate_by_name=True)
detail_ids: List[str] = Field(..., alias="detailIds", min_length=1)
class RefundFinanceSubmitBody(BaseModel):
model_config = ConfigDict(populate_by_name=True)
refund_amount: float = Field(..., alias="refundAmount", gt=0)
refund_remark: Optional[str] = Field(None, alias="refundRemark")
refund_attachments: Optional[str] = Field(None, alias="refundAttachments")
class BatchRefundFinanceSubmitBody(RefundFinanceSubmitBody):
model_config = ConfigDict(populate_by_name=True)
detail_ids: List[str] = Field(..., alias="detailIds", min_length=1)
@router.post("/protocol-payment-details/{detail_id}/submit-receipt-finance")
async def post_submit_receipt_finance(
detail_id: str,
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
tenant_no = _get_tenant_no(db, user)
try:
cp_svc.submit_receipt_finance(
db,
detail_id=detail_id,
tenant_no=tenant_no,
user_id=user.get("user_id"),
)
return success_response(None, message="提交成功")
except ValueError as e:
return error_response(400, str(e))
@router.post("/protocol-payment-details/submit-receipt-finance-batch")
async def post_submit_receipt_finance_batch(
body: BatchDetailIdsBody,
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
tenant_no = _get_tenant_no(db, user)
try:
count = cp_svc.batch_submit_receipt_finance(
db,
detail_ids=body.detail_ids,
tenant_no=tenant_no,
user_id=user.get("user_id"),
)
return success_response({"count": count}, message=f"已成功提交 {count} 条")
except ValueError as e:
return error_response(400, str(e))
@router.post("/protocol-payment-details/{detail_id}/submit-refund-finance")
async def post_submit_refund_finance(
detail_id: str,
body: RefundFinanceSubmitBody,
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
tenant_no = _get_tenant_no(db, user)
try:
cp_svc.submit_refund_finance(
db,
detail_id=detail_id,
tenant_no=tenant_no,
user_id=user.get("user_id"),
refund_amount=body.refund_amount,
refund_remark=body.refund_remark,
refund_attachments=body.refund_attachments,
)
return success_response(None, message="提交成功")
except ValueError as e:
return error_response(400, str(e))
@router.post("/protocol-payment-details/submit-refund-finance-batch")
async def post_submit_refund_finance_batch(
body: BatchRefundFinanceSubmitBody,
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
tenant_no = _get_tenant_no(db, user)
try:
count = cp_svc.batch_submit_refund_finance(
db,
detail_ids=body.detail_ids,
tenant_no=tenant_no,
user_id=user.get("user_id"),
refund_amount=body.refund_amount,
refund_remark=body.refund_remark,
refund_attachments=body.refund_attachments,
)
return success_response({"count": count}, message=f"已成功提交 {count} 条")
except ValueError as e:
return error_response(400, str(e))
@router.get("/protocol-payment-details/receipt-confirm")
async def list_receipt_confirm(
page: int = Query(1, ge=1),
@@ -422,10 +549,35 @@ async def list_receipt_confirm(
return success_response({"list": items, "total": total, "page": page, "pageSize": pageSize, "totalPages": tp})
@router.get("/protocol-payment-details/receipt-confirmed")
async def list_receipt_confirmed(
page: int = Query(1, ge=1),
pageSize: int = Query(10, ge=1, le=100, alias="pageSize"),
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
tenant_no = _get_tenant_no(db, user)
items, total = cp_svc.list_receipt_confirmed_details(
db, page=page, page_size=pageSize, tenant_no=tenant_no
)
tp = cp_svc.total_pages(total, pageSize)
return success_response({"list": items, "total": total, "page": page, "pageSize": pageSize, "totalPages": tp})
class FinanceConfirmBody(BaseModel):
model_config = ConfigDict(populate_by_name=True)
finance_confirm_attachments: Optional[str] = Field(None, alias="financeConfirmAttachments")
finance_remark: Optional[str] = Field(None, alias="financeRemark")
class RefundFinanceConfirmBody(BaseModel):
model_config = ConfigDict(populate_by_name=True)
refund_finance_confirm_attachments: Optional[str] = Field(
None, alias="refundFinanceConfirmAttachments"
)
refund_finance_remark: Optional[str] = Field(None, alias="refundFinanceRemark")
@router.post("/protocol-payment-details/{detail_id}/receipt-confirm")
@@ -443,6 +595,7 @@ async def post_receipt_confirm(
tenant_no=tenant_no,
user_id=user.get("user_id"),
finance_confirm_attachments=body.finance_confirm_attachments,
finance_remark=body.finance_remark,
)
return success_response(None, message="确认成功")
except ValueError as e:
@@ -467,10 +620,25 @@ async def list_refund_confirm(
return success_response({"list": items, "total": total, "page": page, "pageSize": pageSize, "totalPages": tp})
@router.get("/protocol-payment-details/refund-confirmed")
async def list_refund_confirmed(
page: int = Query(1, ge=1),
pageSize: int = Query(10, ge=1, le=100, alias="pageSize"),
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
tenant_no = _get_tenant_no(db, user)
items, total = cp_svc.list_refund_confirmed_details(
db, page=page, page_size=pageSize, tenant_no=tenant_no
)
tp = cp_svc.total_pages(total, pageSize)
return success_response({"list": items, "total": total, "page": page, "pageSize": pageSize, "totalPages": tp})
@router.post("/protocol-payment-details/{detail_id}/refund-confirm")
async def post_refund_confirm(
detail_id: str,
body: FinanceConfirmBody,
body: RefundFinanceConfirmBody,
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
@@ -481,33 +649,10 @@ async def post_refund_confirm(
detail_id=detail_id,
tenant_no=tenant_no,
user_id=user.get("user_id"),
finance_confirm_attachments=body.finance_confirm_attachments,
refund_finance_confirm_attachments=body.refund_finance_confirm_attachments,
refund_finance_remark=body.refund_finance_remark,
)
return success_response(None, message="确认成功")
except ValueError as e:
return error_response(400, str(e))
# ---------------------------------------------------------------------------
# 分期预警
# ---------------------------------------------------------------------------
@router.get("/protocol-payment-details/installment-warning")
async def list_installment_warning(
page: int = Query(1, ge=1),
pageSize: int = Query(10, ge=1, le=100, alias="pageSize"),
warningType: str = Query("all", alias="warningType"),
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
tenant_no = _get_tenant_no(db, user)
items, total = cp_svc.list_installment_warning(
db,
page=page,
page_size=pageSize,
warning_type=warningType,
tenant_no=tenant_no,
)
tp = cp_svc.total_pages(total, pageSize)
return success_response({"list": items, "total": total, "page": page, "pageSize": pageSize, "totalPages": tp})
+9 -9
View File
@@ -166,6 +166,13 @@ STATIC_MENU_TREE = [
"component": "/cell-storage/protocol/index",
"meta": {"title": "采集协议单", "keepAlive": True},
},
{
"id": "50000000000000000000000000000007",
"name": "CellStoragePaymentInfo",
"path": "payment-info",
"component": "/cell-storage/payment-info/index",
"meta": {"title": "缴费信息", "keepAlive": True},
},
{
"id": "50000000000000000000000000000003",
"name": "CellStorageProtocolAudit",
@@ -178,21 +185,14 @@ STATIC_MENU_TREE = [
"name": "CellStoragePaymentConfirm",
"path": "payment-confirm",
"component": "/cell-storage/payment-confirm/index",
"meta": {"title": "采集协议单收款确认(财务确认)", "keepAlive": True},
"meta": {"title": "缴费确认(财务)", "keepAlive": True},
},
{
"id": "50000000000000000000000000000005",
"name": "CellStorageRefundConfirm",
"path": "refund-confirm",
"component": "/cell-storage/refund-confirm/index",
"meta": {"title": "采集协议单退费确认(财务确认)", "keepAlive": True},
},
{
"id": "50000000000000000000000000000006",
"name": "CellStorageInstallmentWarning",
"path": "installment-warning",
"component": "/cell-storage/installment-warning/index",
"meta": {"title": "分期缴费用户预警模块", "keepAlive": True},
"meta": {"title": "退费确认(财务)", "keepAlive": True},
},
],
},