Jelajahi Sumber

绑定UID同步更新定制客户设备激活状态

zhangdongming 2 bulan lalu
induk
melakukan
51138303d5

+ 1 - 1
AdminController/CloudServiceManage/AgentDeviceController.py

@@ -369,7 +369,7 @@ class AgentDeviceView(View):
                 # 解绑设备
                 device_info.update(status=0, updated_time=n_time)
         except Exception as e:
-            LOGGER.info('*****AgentDeviceView.device_binding_or_unbinding:errLine:{}, errMsg:{}'
+            LOGGER.error('*****AgentDeviceView.device_binding_or_unbinding:errLine:{}, errMsg:{}'
                         .format(e.__traceback__.tb_lineno, repr(e)))
 
     @classmethod

+ 11 - 6
Controller/SerialNumberController.py

@@ -267,11 +267,6 @@ class SerialNumberView(View):
                                                                                                 redisObj))
                         thread.start()
 
-                        # 异步调用客户代理平台同步序列号绑定UID
-                        agent_thread = threading.Thread(target=AgentDeviceView.device_binding_or_unbinding,
-                                                        args=(full_serial, 1))
-                        agent_thread.start()
-
                         return response.json(0, res)
                     return response.json(5)
             elif company_serial.status == 2:  # 返回uid
@@ -412,6 +407,16 @@ class SerialNumberView(View):
             except Exception as e:
                 LOGGER.info('发送提醒邮件异常: error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
 
+        try:
+            # 异步调用客户代理平台同步序列号绑定UID
+            serial_number = serial + '11A'
+            agent_thread = threading.Thread(target=AgentDeviceView.device_binding_or_unbinding,
+                                            args=(serial_number, 1))
+            agent_thread.start()
+        except Exception as e:
+            LOGGER.error('异步更新定制客户序列号状态一次: error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno,
+                                                                                             repr(e)))
+
     @staticmethod
     def sync_serial_data_and_log(request, company_serial_id, serial, now_time):
         """
@@ -1161,7 +1166,7 @@ class SerialNumberView(View):
                 objectKey=license_name,
                 expires=3600  # 有效期1小时
             )
-            
+
             res = {
                 'license_url': download_url.signedUrl
             }