优化一下自动提现接口就是user/tixian_shenhe_servers.py,tixian_shenhe_views.py,让文件以及对应的申请,回调,确认接口,让它更好用一点,允许用户多次提现审核,强化收款接口,及时更新数据库中的收款状态,其次,更新了客服提现审核接口,关于大于200元的提现,同意之后直接按驳回处理,微信官方不支持大于200元的提现申请去掉了订单24小时或48小时自动结算的定时任务,将订单广播通知的任务,名称改成和新代码一样

This commit is contained in:
XingQue
2026-06-15 22:24:32 +08:00
parent 653e127493
commit e8795ca9f2
7 changed files with 277 additions and 114 deletions

View File

@@ -56,36 +56,29 @@ def handle_order_status_8(sender, instance, **kwargs):
# 状态从 非8 变为 8
if old != 8 and instance.zhuangtai == 8:
#logger.info(f"📅 订单 {instance.dingdan_id} 状态变为8提交定时任务")
# 设置时间标记
# 订单自动结算已关闭:仅记录时间标记,不再提交 Celery 延时结算任务
instance.status_8_time = timezone.now()
instance.pending_dispatch = True
# 使用配置中的超时时间
expire_seconds = getattr(settings, 'ORDER_EXPIRE_SECONDS', 48 * 60 * 60)
# 提交Celery任务
try:
from orders.tasks import process_expired_order
task_result = process_expired_order.apply_async(
args=[instance.dingdan_id],
countdown=expire_seconds,
queue='order_tasks',
priority=9
)
#logger.info(f"✅ 任务提交成功,订单: {instance.dingdan_id}, 任务ID: {task_result.id}")
# 保存任务信息
instance.auto_task_id = task_result.id
instance.auto_expire_at = timezone.now() + timezone.timedelta(seconds=expire_seconds)
except Exception as e:
logger.error(f"❌ 任务提交失败: {e}")
instance.pending_dispatch = True
instance.auto_task_id = f"failed_{timezone.now().timestamp()}"
instance.pending_dispatch = False
instance.auto_task_id = ''
instance.auto_expire_at = None
logger.info(f"订单 {instance.dingdan_id} 状态变为8自动结算已禁用不提交结算任务")
# --- 原自动结算逻辑(已禁用,保留代码备查)---
# expire_seconds = getattr(settings, 'ORDER_EXPIRE_SECONDS', 48 * 60 * 60)
# try:
# from orders.tasks import process_expired_order
# task_result = process_expired_order.apply_async(
# args=[instance.dingdan_id],
# countdown=expire_seconds,
# queue='order_tasks',
# priority=9
# )
# instance.auto_task_id = task_result.id
# instance.auto_expire_at = timezone.now() + timezone.timedelta(seconds=expire_seconds)
# except Exception as e:
# logger.error(f"❌ 任务提交失败: {e}")
# instance.pending_dispatch = True
# instance.auto_task_id = f"failed_{timezone.now().timestamp()}"
# 状态从 8 变为 非8
elif old == 8 and instance.zhuangtai != 8: