修复了一些可能影响生产的问题
This commit is contained in:
@@ -1,3 +1 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class DingdanConfig(AppConfig):
|
||||
class OrdersConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'dingdan'
|
||||
name = 'orders'
|
||||
|
||||
def ready(self):
|
||||
# 导入信号处理,确保信号被注册
|
||||
|
||||
@@ -22,16 +22,11 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@shared_task(bind=True, max_retries=3, default_retry_delay=60)
|
||||
def process_expired_order(self, dingdan_id):
|
||||
"""
|
||||
处理单个超时订单(订单状态=8,超过48小时未处理)
|
||||
"""
|
||||
|
||||
|
||||
try:
|
||||
# 使用select_for_update锁定记录,防止并发修改
|
||||
with transaction.atomic():
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
|
||||
@@ -5,7 +5,6 @@ import json
|
||||
import time
|
||||
import random
|
||||
import string
|
||||
import uuid
|
||||
import traceback
|
||||
import threading
|
||||
import requests
|
||||
@@ -14,15 +13,12 @@ import xml.etree.ElementTree as ET
|
||||
import xmltodict
|
||||
import logging
|
||||
from decimal import Decimal
|
||||
from datetime import datetime
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import models, transaction
|
||||
from django.db.models import F, Q, Count, OuterRef, Subquery, Prefetch
|
||||
from django.db.models import F, Q, OuterRef, Subquery
|
||||
from django.core.cache import cache
|
||||
from django.core.paginator import Paginator
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.shortcuts import render
|
||||
from django.http import HttpResponse
|
||||
from django.utils import timezone
|
||||
|
||||
@@ -41,7 +37,6 @@ from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentClo
|
||||
from tencentcloud.sts.v20180813 import sts_client, models
|
||||
|
||||
from utils.weixin_broadcast import WeixinBroadcastSender
|
||||
from utils.goeasy_service import GoEasyService
|
||||
from utils.chat_utils import _send_group_message, _subscribe_users_to_group, establish_order_chat
|
||||
from utils.fadan_utils import check_fadan_qiangdan_eligible
|
||||
|
||||
@@ -60,7 +55,7 @@ from orders.notice_tasks import dingdan_guangbo
|
||||
|
||||
from .models import (
|
||||
Dingdan, DingdanShangjia, DingdanPingtai, Dashoutupian,
|
||||
Chufajilu, Chufatupian, Fadan, FadanFenhong, Liaotian
|
||||
Chufajilu, Chufatupian, Fadan, FadanFenhong
|
||||
)
|
||||
from orders.models import (
|
||||
Lilubiao, Pingfen, PreSettlement, Tuikuanjilu, CrossPlatformOrderData
|
||||
|
||||
Reference in New Issue
Block a user