Explorar el Código

序列号分配国外修改

chenshibin hace 4 años
padre
commit
c7fff269e9
Se han modificado 1 ficheros con 11 adiciones y 17 borrados
  1. 11 17
      Controller/SerialNumberController.py

+ 11 - 17
Controller/SerialNumberController.py

@@ -188,16 +188,16 @@ class SerialNumberView(View):
 
         if serial_number and len(serial_number) == 9  and company_id:
 
-            token = int(CommonService.decode_data(token))
-            time_stamp = int(time_stamp)
-
-            now_time = int(time.time())
-            distance = now_time - time_stamp
-
-            if token != time_stamp or distance > 60000 or distance < -60000: #为了全球化时间控制在一天内
-                return response.json(404)
-
-            mark = serial_number[6:9]
+            # token = int(CommonService.decode_data(token))
+            # time_stamp = int(time_stamp)
+            #
+            # now_time = int(time.time())
+            # distance = now_time - time_stamp
+            #
+            # if token != time_stamp or distance > 60000 or distance < -60000: #为了全球化时间控制在一天内
+            #     return response.json(404)
+            #
+            # mark = serial_number[6:9]
             serial = serial_number[0:6]
 
             savePoint = transaction.savepoint()
@@ -220,18 +220,12 @@ class SerialNumberView(View):
                         # 该序列号未绑定企业
                         return response.json(173)
                     elif company_serial.status == 1:
-                        # 确定所在区域
-                        country_qs = CountryModel.objects.filter(number=country_id)
-                        if not country_qs.exists():
-                            return response.json(374)
-
-                        region = country_qs.values('region_id')[0]
 
                         count = 0
                         while count < 3:
                             p2p = SerialNumberModel.objects.filter(serial_number=serial).values('p2p')
                             print('此序列号的p2p类型:', p2p[0]['p2p'])
-                            uid_qs = UIDModel.objects.filter(vpg__company_id=company_serial.company.id, vpg__region_id=region['region_id'],
+                            uid_qs = UIDModel.objects.filter(vpg__company_id=company_serial.company.id, vpg__region_id=country_id,
                                                              status=0, p2p_type=p2p[0]['p2p']).order_by('id')[0:10]
                             # uid_qs:未进行绑定的uid列表
                             if uid_qs.exists():