|
@@ -20,7 +20,7 @@ from Ansjer.config import USED_SERIAL_REDIS_LIST, UNUSED_SERIAL_REDIS_LIST, CONF
|
|
from Model.models import Device_User, Device_Info, UidSetModel, UID_Bucket, Unused_Uid_Meal, Order_Model, StsCrdModel, \
|
|
from Model.models import Device_User, Device_Info, UidSetModel, UID_Bucket, Unused_Uid_Meal, Order_Model, StsCrdModel, \
|
|
VodHlsModel, ExperienceContextModel, AiService, VodHlsSummary, VideoPlaybackTimeModel, DeviceUserSummary, \
|
|
VodHlsModel, ExperienceContextModel, AiService, VodHlsSummary, VideoPlaybackTimeModel, DeviceUserSummary, \
|
|
CountryModel, DeviceTypeModel, OrdersSummary, DeviceInfoSummary, CompanySerialModel, \
|
|
CountryModel, DeviceTypeModel, OrdersSummary, DeviceInfoSummary, CompanySerialModel, \
|
|
- CloudLogModel, UidCloudStorageCount, UserExModel, DeviceDomainRegionModel, VodHlsTag, VodHlsTagType
|
|
|
|
|
|
+ CloudLogModel, UidCloudStorageCount, UserExModel, DeviceDomainRegionModel, VodHlsTag, VodHlsTagType, IcloudService
|
|
from Object.RedisObject import RedisObject
|
|
from Object.RedisObject import RedisObject
|
|
from Object.ResponseObject import ResponseObject
|
|
from Object.ResponseObject import ResponseObject
|
|
from Object.utils import LocalDateTimeUtil
|
|
from Object.utils import LocalDateTimeUtil
|
|
@@ -257,6 +257,8 @@ class CronUpdateDataView(View):
|
|
return self.updateUnusedUidBucket(response)
|
|
return self.updateUnusedUidBucket(response)
|
|
elif operation == 'updateUnusedAiService': # 定时更新过期ai关联的未使用套餐状态
|
|
elif operation == 'updateUnusedAiService': # 定时更新过期ai关联的未使用套餐状态
|
|
return self.updateUnusedAiService(response)
|
|
return self.updateUnusedAiService(response)
|
|
|
|
+ elif operation == 'updateIcloudService': # 定时更新过期云盘套餐使用状态
|
|
|
|
+ return self.updateIcloudService(response)
|
|
elif operation == 'reqUpdateSerialStatus': # 定时请求更新序列号状态
|
|
elif operation == 'reqUpdateSerialStatus': # 定时请求更新序列号状态
|
|
return self.reqUpdateSerialStatus(response)
|
|
return self.reqUpdateSerialStatus(response)
|
|
elif operation == 'updateSerialStatus': # 更新序列号状态
|
|
elif operation == 'updateSerialStatus': # 更新序列号状态
|
|
@@ -354,6 +356,22 @@ class CronUpdateDataView(View):
|
|
continue
|
|
continue
|
|
return response.json(0)
|
|
return response.json(0)
|
|
|
|
|
|
|
|
+ @staticmethod
|
|
|
|
+ def updateIcloudService(response):
|
|
|
|
+ """
|
|
|
|
+ 监控云盘套餐过期修改状态
|
|
|
|
+ @param response:
|
|
|
|
+ @return:
|
|
|
|
+ """
|
|
|
|
+ # 定时更新已过期套餐修改状态为2
|
|
|
|
+ now_time = int(time.time())
|
|
|
|
+ try:
|
|
|
|
+ IcloudService.objects.filter(Q(end_time__lte=now_time), ~Q(end_time=0),
|
|
|
|
+ ~Q(use_status=1)).update(use_status=1)
|
|
|
|
+ return response.json(0)
|
|
|
|
+ except Exception as e:
|
|
|
|
+ return response.json(500)
|
|
|
|
+
|
|
@classmethod
|
|
@classmethod
|
|
def reqUpdateSerialStatus(cls, response):
|
|
def reqUpdateSerialStatus(cls, response):
|
|
redis_obj = RedisObject()
|
|
redis_obj = RedisObject()
|
|
@@ -994,4 +1012,3 @@ class CronCollectDataView(View):
|
|
return response.json(0)
|
|
return response.json(0)
|
|
except Exception as e:
|
|
except Exception as e:
|
|
return response.json(500, repr(e))
|
|
return response.json(500, repr(e))
|
|
-
|
|
|