|
@@ -611,9 +611,15 @@ class SerialNumberView(View):
|
|
|
# 重置扫码记录
|
|
|
AppScannedSerial.objects.filter(serial=serial).delete()
|
|
|
|
|
|
+ # 异步调用客户代理平台同步序列号解绑UID
|
|
|
+ agent_thread = threading.Thread(target=AgentDeviceView.device_binding_or_unbinding,
|
|
|
+ args=(serial_number[0:9], 2))
|
|
|
+ agent_thread.start()
|
|
|
+
|
|
|
# 记录操作日志
|
|
|
ip = CommonService.get_ip_address(request)
|
|
|
content = json.loads(json.dumps(request_dict))
|
|
|
+ end_time = int(time.time())
|
|
|
log = {
|
|
|
'ip': ip,
|
|
|
'user_id': 1,
|
|
@@ -621,15 +627,10 @@ class SerialNumberView(View):
|
|
|
'time': now_time,
|
|
|
'content': json.dumps(content),
|
|
|
'url': 'serialNumber/detachUID',
|
|
|
- 'operation': '序列号{}解绑uid: {}'.format(serial, uid),
|
|
|
+ 'operation': '序列号{}解绑uid{},执行时间{}秒'.format(serial, uid, end_time-now_time),
|
|
|
}
|
|
|
LogModel.objects.create(**log)
|
|
|
|
|
|
- # 异步调用客户代理平台同步序列号解绑UID
|
|
|
- agent_thread = threading.Thread(target=AgentDeviceView.device_binding_or_unbinding,
|
|
|
- args=(serial_number[0:9], 2))
|
|
|
- agent_thread.start()
|
|
|
-
|
|
|
return response.json(0)
|
|
|
except Exception as e:
|
|
|
# 记录操作日志
|