|
@@ -8,7 +8,7 @@ from django.db import transaction
|
|
from django.views import View
|
|
from django.views import View
|
|
|
|
|
|
from Model.models import SerialNumberModel, CompanySerialModel, UIDCompanySerialModel, CompanyModel, RegionModel, \
|
|
from Model.models import SerialNumberModel, CompanySerialModel, UIDCompanySerialModel, CompanyModel, RegionModel, \
|
|
- CountryModel, UIDModel, RegionCountryModel
|
|
|
|
|
|
+ CountryModel, UIDModel, RegionCountryModel, Device_Info, iotdeviceInfoModel
|
|
from Object.RedisObject import RedisObject
|
|
from Object.RedisObject import RedisObject
|
|
from Object.uidManageResponseObject import uidManageResponseObject
|
|
from Object.uidManageResponseObject import uidManageResponseObject
|
|
from Object.TokenObject import TokenObject
|
|
from Object.TokenObject import TokenObject
|
|
@@ -127,8 +127,8 @@ class SerialNumberView(View):
|
|
value = redisObject.lpop(key)
|
|
value = redisObject.lpop(key)
|
|
count += 1
|
|
count += 1
|
|
|
|
|
|
- # if count == 5 and value is False: 暂时注释
|
|
|
|
- # return response.json(5)
|
|
|
|
|
|
+ if count == 5 and value is False: #暂时注释
|
|
|
|
+ return response.json(5)
|
|
|
|
|
|
quantity = int(quantity)
|
|
quantity = int(quantity)
|
|
|
|
|
|
@@ -346,6 +346,10 @@ class SerialNumberView(View):
|
|
if uid_serial_qs.exists():
|
|
if uid_serial_qs.exists():
|
|
uid_serial = uid_serial_qs[0]
|
|
uid_serial = uid_serial_qs[0]
|
|
|
|
|
|
|
|
+ Device_Info.objects.filter(UID=uid_serial.uid).update(endpoint='',
|
|
|
|
+ token_iot_number='')
|
|
|
|
+ iotdeviceInfoModel.objects.filter(uid=uid_serial.uid).delete()
|
|
|
|
+
|
|
company_serial_qs = CompanySerialModel.objects.filter(id=uid_serial.company_serial.id)
|
|
company_serial_qs = CompanySerialModel.objects.filter(id=uid_serial.company_serial.id)
|
|
if company_serial_qs.exists():
|
|
if company_serial_qs.exists():
|
|
company_serial = company_serial_qs[0]
|
|
company_serial = company_serial_qs[0]
|