|
@@ -144,12 +144,6 @@ class SerialNumberView(View):
|
|
|
if company_serial.status == 0: # 该序列号未绑定企业
|
|
|
return response.json(173)
|
|
|
elif company_serial.status == 1: # 绑定uid
|
|
|
- # redis加锁,防止同一个序列号重复绑定
|
|
|
- key = serial + 'do_attach_uid'
|
|
|
- is_lock = redisObj.CONN.setnx(key, 1)
|
|
|
- if not is_lock:
|
|
|
- return response.json(5)
|
|
|
- redisObj.CONN.expire(key, 60)
|
|
|
|
|
|
# 查询app是否已扫码,未扫码不能进行绑定
|
|
|
app_scanned_serial_qs = AppScannedSerial.objects.filter(serial=serial)
|
|
@@ -157,6 +151,13 @@ class SerialNumberView(View):
|
|
|
LOGGER.info(f'{serial}当前序列号未进行APP扫码')
|
|
|
return response.json(5)
|
|
|
|
|
|
+ # redis加锁,防止同一个序列号重复绑定
|
|
|
+ key = serial + 'do_attach_uid'
|
|
|
+ is_lock = redisObj.CONN.setnx(key, 1)
|
|
|
+ if not is_lock:
|
|
|
+ return response.json(5)
|
|
|
+ redisObj.CONN.expire(key, 60)
|
|
|
+
|
|
|
# 获取并判断region_id
|
|
|
region_id = CommonService.confirm_region_id()
|
|
|
if region_id not in REGION_ID_LIST:
|