|
@@ -1,15 +1,9 @@
|
|
|
-import os
|
|
|
|
|
-import tempfile
|
|
|
|
|
from datetime import datetime, timedelta
|
|
from datetime import datetime, timedelta
|
|
|
|
|
|
|
|
-from fastapi import UploadFile
|
|
|
|
|
-
|
|
|
|
|
from app.api.v1.module_system.auth.schema import AuthSchema
|
|
from app.api.v1.module_system.auth.schema import AuthSchema
|
|
|
-from app.config.setting import settings
|
|
|
|
|
from app.core.alipay import AlipayClient
|
|
from app.core.alipay import AlipayClient
|
|
|
from app.core.exceptions import CustomException
|
|
from app.core.exceptions import CustomException
|
|
|
from app.core.logger import log
|
|
from app.core.logger import log
|
|
|
-from app.utils.upload_util import UploadUtil
|
|
|
|
|
|
|
|
|
|
from .crud import FacetofaceCRUD
|
|
from .crud import FacetofaceCRUD
|
|
|
from .enums import FacetofaceOrderStatus
|
|
from .enums import FacetofaceOrderStatus
|
|
@@ -21,23 +15,19 @@ from .schema import (
|
|
|
|
|
|
|
|
|
|
|
|
|
class FacetofaceService:
|
|
class FacetofaceService:
|
|
|
- """当面付开通服务"""
|
|
|
|
|
|
|
+ """当面付代开通服务"""
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
|
async def apply_service(
|
|
async def apply_service(
|
|
|
cls,
|
|
cls,
|
|
|
auth: AuthSchema,
|
|
auth: AuthSchema,
|
|
|
data: FacetofaceApplySchema,
|
|
data: FacetofaceApplySchema,
|
|
|
- shop_scene_pic: UploadFile | None = None,
|
|
|
|
|
- shop_sign_board_pic: UploadFile | None = None,
|
|
|
|
|
- business_license_pic: UploadFile | None = None,
|
|
|
|
|
) -> FacetofaceOrderOutSchema:
|
|
) -> FacetofaceOrderOutSchema:
|
|
|
"""
|
|
"""
|
|
|
- 提交当面付开通申请
|
|
|
|
|
|
|
+ 提交当面付代开通申请
|
|
|
|
|
|
|
|
- 三步操作: agent.create → facetoface.sign → agent.confirm
|
|
|
|
|
|
|
+ 三步操作: agent.create → agent.facetoface.sign → agent.confirm
|
|
|
"""
|
|
"""
|
|
|
- from alipay.aop.api.FileItem import FileItem
|
|
|
|
|
from alipay.aop.api.domain.AlipayOpenAgentCreateModel import AlipayOpenAgentCreateModel
|
|
from alipay.aop.api.domain.AlipayOpenAgentCreateModel import AlipayOpenAgentCreateModel
|
|
|
from alipay.aop.api.request.AlipayOpenAgentCreateRequest import AlipayOpenAgentCreateRequest
|
|
from alipay.aop.api.request.AlipayOpenAgentCreateRequest import AlipayOpenAgentCreateRequest
|
|
|
from alipay.aop.api.response.AlipayOpenAgentCreateResponse import AlipayOpenAgentCreateResponse
|
|
from alipay.aop.api.response.AlipayOpenAgentCreateResponse import AlipayOpenAgentCreateResponse
|
|
@@ -50,15 +40,26 @@ class FacetofaceService:
|
|
|
client = AlipayClient.get_client()
|
|
client = AlipayClient.get_client()
|
|
|
crud = FacetofaceCRUD(auth)
|
|
crud = FacetofaceCRUD(auth)
|
|
|
|
|
|
|
|
- # 检查该企业是否已有申请单
|
|
|
|
|
|
|
+ # 检查该企业是否已有进行中的申请
|
|
|
existing = await crud.get_by_enterprise_id(data.enterprise_id)
|
|
existing = await crud.get_by_enterprise_id(data.enterprise_id)
|
|
|
if existing and existing.order_status not in (
|
|
if existing and existing.order_status not in (
|
|
|
FacetofaceOrderStatus.CLOSED.value,
|
|
FacetofaceOrderStatus.CLOSED.value,
|
|
|
):
|
|
):
|
|
|
raise CustomException(msg="该企业已有进行中的当面付申请")
|
|
raise CustomException(msg="该企业已有进行中的当面付申请")
|
|
|
|
|
|
|
|
- # Step 1: 创建应用事务,获取 batch_no
|
|
|
|
|
|
|
+ # Step 1: 创建应用事务
|
|
|
create_model = AlipayOpenAgentCreateModel()
|
|
create_model = AlipayOpenAgentCreateModel()
|
|
|
|
|
+ create_model.account = data.account
|
|
|
|
|
+ # ContactModel
|
|
|
|
|
+ from alipay.aop.api.domain.ContactModel import ContactModel
|
|
|
|
|
+ create_model.contact_info = ContactModel()
|
|
|
|
|
+ create_model.contact_info.contact_name = data.contact_name
|
|
|
|
|
+ create_model.contact_info.contact_mobile = data.contact_mobile
|
|
|
|
|
+ if data.contact_email:
|
|
|
|
|
+ create_model.contact_info.contact_email = data.contact_email
|
|
|
|
|
+ if data.order_ticket:
|
|
|
|
|
+ create_model.order_ticket = data.order_ticket
|
|
|
|
|
+
|
|
|
create_request = AlipayOpenAgentCreateRequest()
|
|
create_request = AlipayOpenAgentCreateRequest()
|
|
|
create_request.biz_model = create_model
|
|
create_request.biz_model = create_model
|
|
|
|
|
|
|
@@ -76,60 +77,27 @@ class FacetofaceService:
|
|
|
if not batch_no:
|
|
if not batch_no:
|
|
|
raise CustomException(msg="创建应用事务失败: 未返回 batch_no")
|
|
raise CustomException(msg="创建应用事务失败: 未返回 batch_no")
|
|
|
|
|
|
|
|
- log.info(f"当面付申请 - Step1 创建事务成功: batch_no={batch_no}")
|
|
|
|
|
|
|
+ log.info(f"当面付代开通 - Step1 创建事务成功: batch_no={batch_no}, account={data.account}")
|
|
|
|
|
|
|
|
- # Step 2: 提交当面付开通申请
|
|
|
|
|
|
|
+ # Step 2: 提交当面付签约申请
|
|
|
sign_request = AlipayOpenAgentFacetofaceSignRequest()
|
|
sign_request = AlipayOpenAgentFacetofaceSignRequest()
|
|
|
sign_request.batch_no = batch_no
|
|
sign_request.batch_no = batch_no
|
|
|
- sign_request.shop_name = data.shop_name
|
|
|
|
|
- if data.shop_address:
|
|
|
|
|
- sign_request.shop_address = data.shop_address
|
|
|
|
|
- if data.mcc_code:
|
|
|
|
|
- sign_request.mcc_code = data.mcc_code
|
|
|
|
|
- if data.rate:
|
|
|
|
|
- sign_request.rate = data.rate
|
|
|
|
|
- if data.business_license_no:
|
|
|
|
|
- sign_request.business_license_no = data.business_license_no
|
|
|
|
|
- if data.business_license_mobile:
|
|
|
|
|
- sign_request.business_license_mobile = data.business_license_mobile
|
|
|
|
|
if data.sign_and_auth:
|
|
if data.sign_and_auth:
|
|
|
sign_request.sign_and_auth = "true"
|
|
sign_request.sign_and_auth = "true"
|
|
|
-
|
|
|
|
|
- # 处理图片上传
|
|
|
|
|
- image_paths: dict[str, str | None] = {
|
|
|
|
|
- "shop_scene_pic_path": None,
|
|
|
|
|
- "shop_sign_board_pic_path": None,
|
|
|
|
|
- "business_license_pic_path": None,
|
|
|
|
|
- }
|
|
|
|
|
- file_mapping = [
|
|
|
|
|
- ("shop_scene_pic", shop_scene_pic, "shop_scene_pic_path"),
|
|
|
|
|
- ("shop_sign_board_pic", shop_sign_board_pic, "shop_sign_board_pic_path"),
|
|
|
|
|
- ("business_license_pic", business_license_pic, "business_license_pic_path"),
|
|
|
|
|
- ]
|
|
|
|
|
- for attr_name, upload_file, path_key in file_mapping:
|
|
|
|
|
- if upload_file and upload_file.filename:
|
|
|
|
|
- content = await upload_file.read()
|
|
|
|
|
- await upload_file.seek(0)
|
|
|
|
|
- file_item = FileItem(
|
|
|
|
|
- file_name=upload_file.filename,
|
|
|
|
|
- file_content=content,
|
|
|
|
|
- mime_type=upload_file.content_type or "application/octet-stream",
|
|
|
|
|
- )
|
|
|
|
|
- sign_request.__setattr__(attr_name, file_item)
|
|
|
|
|
- saved_path = await cls._save_uploaded_file(upload_file)
|
|
|
|
|
- image_paths[path_key] = saved_path
|
|
|
|
|
|
|
+ if data.rate:
|
|
|
|
|
+ sign_request.rate = data.rate
|
|
|
|
|
|
|
|
response = client.execute(sign_request)
|
|
response = client.execute(sign_request)
|
|
|
if not response:
|
|
if not response:
|
|
|
- raise CustomException(msg="提交当面付申请失败: 无响应")
|
|
|
|
|
|
|
+ raise CustomException(msg="提交当面付签约失败: 无响应")
|
|
|
|
|
|
|
|
sign_result = AlipayOpenAgentFacetofaceSignResponse()
|
|
sign_result = AlipayOpenAgentFacetofaceSignResponse()
|
|
|
sign_result.parse_response_content(response)
|
|
sign_result.parse_response_content(response)
|
|
|
if not sign_result.is_success():
|
|
if not sign_result.is_success():
|
|
|
- log.error(f"提交当面付申请失败: {sign_result.code} - {sign_result.msg} - {sign_result.sub_msg}")
|
|
|
|
|
- raise CustomException(msg=f"提交当面付申请失败: {sign_result.sub_msg or sign_result.msg}")
|
|
|
|
|
|
|
+ log.error(f"提交当面付签约失败: {sign_result.code} - {sign_result.msg} - {sign_result.sub_msg}")
|
|
|
|
|
+ raise CustomException(msg=f"提交当面付签约失败: {sign_result.sub_msg or sign_result.msg}")
|
|
|
|
|
|
|
|
- log.info(f"当面付申请 - Step2 提交签约成功: batch_no={batch_no}")
|
|
|
|
|
|
|
+ log.info(f"当面付代开通 - Step2 签约成功: batch_no={batch_no}")
|
|
|
|
|
|
|
|
# Step 3: 确认提交事务
|
|
# Step 3: 确认提交事务
|
|
|
confirm_model = AlipayOpenAgentConfirmModel()
|
|
confirm_model = AlipayOpenAgentConfirmModel()
|
|
@@ -147,31 +115,34 @@ class FacetofaceService:
|
|
|
log.error(f"确认提交事务失败: {confirm_result.code} - {confirm_result.msg} - {confirm_result.sub_msg}")
|
|
log.error(f"确认提交事务失败: {confirm_result.code} - {confirm_result.msg} - {confirm_result.sub_msg}")
|
|
|
raise CustomException(msg=f"确认提交事务失败: {confirm_result.sub_msg or confirm_result.msg}")
|
|
raise CustomException(msg=f"确认提交事务失败: {confirm_result.sub_msg or confirm_result.msg}")
|
|
|
|
|
|
|
|
- log.info(f"当面付申请 - Step3 确认事务成功: batch_no={batch_no}")
|
|
|
|
|
|
|
+ log.info(f"当面付代开通 - Step3 确认事务成功: batch_no={batch_no}, order_no={confirm_result.order_no}")
|
|
|
|
|
|
|
|
- # 保存申请单到数据库
|
|
|
|
|
|
|
+ # 保存申请单
|
|
|
now = datetime.now()
|
|
now = datetime.now()
|
|
|
create_data = {
|
|
create_data = {
|
|
|
"enterprise_id": data.enterprise_id,
|
|
"enterprise_id": data.enterprise_id,
|
|
|
"batch_no": batch_no,
|
|
"batch_no": batch_no,
|
|
|
|
|
+ "order_no": confirm_result.order_no,
|
|
|
"order_status": FacetofaceOrderStatus.SUBMITTED.value,
|
|
"order_status": FacetofaceOrderStatus.SUBMITTED.value,
|
|
|
- "shop_scene_pic_path": image_paths["shop_scene_pic_path"],
|
|
|
|
|
- "shop_sign_board_pic_path": image_paths["shop_sign_board_pic_path"],
|
|
|
|
|
- "business_license_pic_path": image_paths["business_license_pic_path"],
|
|
|
|
|
- "merchant_name": data.merchant_name,
|
|
|
|
|
- "shop_name": data.shop_name,
|
|
|
|
|
- "shop_address": data.shop_address,
|
|
|
|
|
- "mcc_code": data.mcc_code,
|
|
|
|
|
- "rate": data.rate,
|
|
|
|
|
- "business_license_no": data.business_license_no,
|
|
|
|
|
- "business_license_mobile": data.business_license_mobile,
|
|
|
|
|
|
|
+ "account": data.account,
|
|
|
|
|
+ "contact_name": data.contact_name,
|
|
|
|
|
+ "contact_mobile": data.contact_mobile,
|
|
|
|
|
+ "contact_email": data.contact_email,
|
|
|
|
|
+ "order_ticket": data.order_ticket,
|
|
|
"sign_and_auth": data.sign_and_auth,
|
|
"sign_and_auth": data.sign_and_auth,
|
|
|
|
|
+ "rate": data.rate,
|
|
|
"remark": data.remark,
|
|
"remark": data.remark,
|
|
|
|
|
+ "app_auth_token": confirm_result.app_auth_token,
|
|
|
|
|
+ "app_refresh_token": confirm_result.app_refresh_token,
|
|
|
|
|
+ "auth_app_id": confirm_result.auth_app_id,
|
|
|
|
|
+ "user_id": confirm_result.user_id,
|
|
|
|
|
+ "open_id": confirm_result.open_id,
|
|
|
|
|
+ "expires_in": confirm_result.expires_in,
|
|
|
|
|
+ "re_expires_in": confirm_result.re_expires_in,
|
|
|
"next_query_time": now + timedelta(minutes=5),
|
|
"next_query_time": now + timedelta(minutes=5),
|
|
|
"query_count": 0,
|
|
"query_count": 0,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- # 如果该企业已有已关闭的申请单,更新而非新建
|
|
|
|
|
if existing:
|
|
if existing:
|
|
|
obj = await crud.get(id=existing.id, preload=[])
|
|
obj = await crud.get(id=existing.id, preload=[])
|
|
|
if obj:
|
|
if obj:
|
|
@@ -254,6 +225,8 @@ class FacetofaceService:
|
|
|
update_data["order_no"] = result.order_no
|
|
update_data["order_no"] = result.order_no
|
|
|
if result.confirm_url:
|
|
if result.confirm_url:
|
|
|
update_data["confirm_url"] = result.confirm_url
|
|
update_data["confirm_url"] = result.confirm_url
|
|
|
|
|
+ if result.merchant_pid:
|
|
|
|
|
+ update_data["merchant_pid"] = result.merchant_pid
|
|
|
if result.reject_reason:
|
|
if result.reject_reason:
|
|
|
update_data["reject_reason"] = result.reject_reason
|
|
update_data["reject_reason"] = result.reject_reason
|
|
|
|
|
|
|
@@ -261,21 +234,28 @@ class FacetofaceService:
|
|
|
if alipay_status:
|
|
if alipay_status:
|
|
|
if alipay_status == "MERCHANT_CONFIRM":
|
|
if alipay_status == "MERCHANT_CONFIRM":
|
|
|
update_data["order_status"] = FacetofaceOrderStatus.MERCHANT_CONFIRM.value
|
|
update_data["order_status"] = FacetofaceOrderStatus.MERCHANT_CONFIRM.value
|
|
|
- # 等待商家确认,继续轮询
|
|
|
|
|
update_data["next_query_time"] = now + timedelta(hours=4)
|
|
update_data["next_query_time"] = now + timedelta(hours=4)
|
|
|
elif alipay_status == "MERCHANT_AUDITING":
|
|
elif alipay_status == "MERCHANT_AUDITING":
|
|
|
update_data["order_status"] = FacetofaceOrderStatus.MERCHANT_AUDITING.value
|
|
update_data["order_status"] = FacetofaceOrderStatus.MERCHANT_AUDITING.value
|
|
|
update_data["next_query_time"] = now + timedelta(hours=4)
|
|
update_data["next_query_time"] = now + timedelta(hours=4)
|
|
|
- elif alipay_status in ("MERCHANT_AGREED", "AGENT_BINDAPP_SUCCESS"):
|
|
|
|
|
|
|
+ elif alipay_status == "MERCHANT_CONFIRM_SUCCESS":
|
|
|
update_data["order_status"] = FacetofaceOrderStatus.SUCCESS.value
|
|
update_data["order_status"] = FacetofaceOrderStatus.SUCCESS.value
|
|
|
update_data["next_query_time"] = None
|
|
update_data["next_query_time"] = None
|
|
|
- elif alipay_status in ("MERCHANT_REJECTED", "MERCHANT_CANCELLED", "AUDIT_REJECTED", "AUDIT_FAILED"):
|
|
|
|
|
|
|
+ elif alipay_status in ("MERCHANT_APPLY_ORDER_CANCELED", "MERCHANT_CONFIRM_TIME_OUT"):
|
|
|
update_data["order_status"] = FacetofaceOrderStatus.CLOSED.value
|
|
update_data["order_status"] = FacetofaceOrderStatus.CLOSED.value
|
|
|
update_data["next_query_time"] = None
|
|
update_data["next_query_time"] = None
|
|
|
|
|
+ elif alipay_status == "MERCHANT_INFO_HOLD":
|
|
|
|
|
+ # 暂存状态,继续轮询
|
|
|
|
|
+ update_data["next_query_time"] = now + timedelta(hours=4)
|
|
|
else:
|
|
else:
|
|
|
|
|
+ # 未识别状态,继续轮询
|
|
|
update_data["next_query_time"] = now + timedelta(hours=4)
|
|
update_data["next_query_time"] = now + timedelta(hours=4)
|
|
|
|
|
|
|
|
- log.info(f"当面付申请单状态更新: batch_no={order.batch_no}, alipay_status={alipay_status}, local_status={update_data.get('order_status', order.order_status)}")
|
|
|
|
|
|
|
+ log.info(
|
|
|
|
|
+ f"当面付申请单状态更新: batch_no={order.batch_no}, "
|
|
|
|
|
+ f"alipay_status={alipay_status}, "
|
|
|
|
|
+ f"local_status={update_data.get('order_status', order.order_status)}"
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
obj = await crud.get(id=order.id, preload=[])
|
|
obj = await crud.get(id=order.id, preload=[])
|
|
|
if obj:
|
|
if obj:
|
|
@@ -284,11 +264,20 @@ class FacetofaceService:
|
|
|
setattr(obj, key, value)
|
|
setattr(obj, key, value)
|
|
|
await crud.auth.db.flush()
|
|
await crud.auth.db.flush()
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ async def get_by_enterprise_service(
|
|
|
|
|
+ cls, auth: AuthSchema, enterprise_id: str
|
|
|
|
|
+ ) -> FacetofaceOrderOutSchema | None:
|
|
|
|
|
+ crud = FacetofaceCRUD(auth)
|
|
|
|
|
+ order = await crud.get_by_enterprise_id(enterprise_id)
|
|
|
|
|
+ if not order:
|
|
|
|
|
+ return None
|
|
|
|
|
+ return FacetofaceOrderOutSchema.model_validate(order)
|
|
|
|
|
+
|
|
|
@classmethod
|
|
@classmethod
|
|
|
async def batch_status_service(
|
|
async def batch_status_service(
|
|
|
cls, auth: AuthSchema, enterprise_ids: list[str]
|
|
cls, auth: AuthSchema, enterprise_ids: list[str]
|
|
|
) -> dict[str, str | None]:
|
|
) -> dict[str, str | None]:
|
|
|
- """批量查询企业当面付状态"""
|
|
|
|
|
crud = FacetofaceCRUD(auth)
|
|
crud = FacetofaceCRUD(auth)
|
|
|
result: dict[str, str | None] = {}
|
|
result: dict[str, str | None] = {}
|
|
|
for eid in enterprise_ids:
|
|
for eid in enterprise_ids:
|
|
@@ -296,17 +285,6 @@ class FacetofaceService:
|
|
|
result[eid] = order.order_status if order else None
|
|
result[eid] = order.order_status if order else None
|
|
|
return result
|
|
return result
|
|
|
|
|
|
|
|
- @classmethod
|
|
|
|
|
- async def get_by_enterprise_service(
|
|
|
|
|
- cls, auth: AuthSchema, enterprise_id: str
|
|
|
|
|
- ) -> FacetofaceOrderOutSchema | None:
|
|
|
|
|
- """按企业ID查询当面付申请单"""
|
|
|
|
|
- crud = FacetofaceCRUD(auth)
|
|
|
|
|
- order = await crud.get_by_enterprise_id(enterprise_id)
|
|
|
|
|
- if not order:
|
|
|
|
|
- return None
|
|
|
|
|
- return FacetofaceOrderOutSchema.model_validate(order)
|
|
|
|
|
-
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
|
async def list_service(
|
|
async def list_service(
|
|
|
cls,
|
|
cls,
|
|
@@ -315,7 +293,6 @@ class FacetofaceService:
|
|
|
page_size: int = 20,
|
|
page_size: int = 20,
|
|
|
search: dict | None = None,
|
|
search: dict | None = None,
|
|
|
) -> dict:
|
|
) -> dict:
|
|
|
- """查询申请单列表"""
|
|
|
|
|
crud = FacetofaceCRUD(auth)
|
|
crud = FacetofaceCRUD(auth)
|
|
|
offset = (page_no - 1) * page_size
|
|
offset = (page_no - 1) * page_size
|
|
|
return await crud.page(
|
|
return await crud.page(
|
|
@@ -330,39 +307,16 @@ class FacetofaceService:
|
|
|
async def detail_service(
|
|
async def detail_service(
|
|
|
cls, auth: AuthSchema, order_id: int
|
|
cls, auth: AuthSchema, order_id: int
|
|
|
) -> FacetofaceOrderOutSchema:
|
|
) -> FacetofaceOrderOutSchema:
|
|
|
- """查询申请单详情"""
|
|
|
|
|
crud = FacetofaceCRUD(auth)
|
|
crud = FacetofaceCRUD(auth)
|
|
|
order = await crud.get(id=order_id)
|
|
order = await crud.get(id=order_id)
|
|
|
if not order:
|
|
if not order:
|
|
|
raise CustomException(msg="申请单不存在")
|
|
raise CustomException(msg="申请单不存在")
|
|
|
return FacetofaceOrderOutSchema.model_validate(order)
|
|
return FacetofaceOrderOutSchema.model_validate(order)
|
|
|
|
|
|
|
|
- @classmethod
|
|
|
|
|
- async def _save_uploaded_file(cls, upload_file: UploadFile) -> str:
|
|
|
|
|
- """保存上传的文件到本地,返回文件路径"""
|
|
|
|
|
- await upload_file.seek(0)
|
|
|
|
|
- content = await upload_file.read()
|
|
|
|
|
- await upload_file.seek(0)
|
|
|
|
|
-
|
|
|
|
|
- ext = os.path.splitext(upload_file.filename or "file")[1] or ".jpg"
|
|
|
|
|
- safe_name = f"f2f_{datetime.now().strftime('%Y%m%d%H%M%S')}_{os.urandom(4).hex()}{ext}"
|
|
|
|
|
-
|
|
|
|
|
- upload_dir = settings.UPLOAD_FILE_PATH.joinpath("facetoface", datetime.now().strftime("%Y/%m/%d"))
|
|
|
|
|
- upload_dir.mkdir(parents=True, exist_ok=True)
|
|
|
|
|
- filepath = upload_dir.joinpath(safe_name)
|
|
|
|
|
-
|
|
|
|
|
- with open(filepath, "wb") as f:
|
|
|
|
|
- f.write(content)
|
|
|
|
|
-
|
|
|
|
|
- log.info(f"当面付图片已保存: {filepath}")
|
|
|
|
|
- return str(filepath)
|
|
|
|
|
-
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
|
async def poll_pending_orders(cls) -> int:
|
|
async def poll_pending_orders(cls) -> int:
|
|
|
"""
|
|
"""
|
|
|
轮询待处理的申请单(供定时任务调用)
|
|
轮询待处理的申请单(供定时任务调用)
|
|
|
-
|
|
|
|
|
- 返回本次处理的申请单数量
|
|
|
|
|
"""
|
|
"""
|
|
|
from app.core.database import async_db_session
|
|
from app.core.database import async_db_session
|
|
|
|
|
|