delete statistic_deep_analyze

FFIB 5 years ago
parent
commit
ec10994438
2 changed files with 1 additions and 45 deletions
  1. 1 43
      api/admin_views.py
  2. 0 2
      api/urls.py

+ 1 - 43
api/admin_views.py

@@ -362,46 +362,4 @@ def statistic_distributor(request):
362 362
         'daily_logs': daily_logs,
363 363
         'model_logs': model_logs,
364 364
         'distributor_logs': distributor_logs
365
-    })
366
-
367
-def statistic_deep_analyze(request):
368
-    start_time = request.POST.get('start_time', '')
369
-    end_time = request.POST.get('end_time', '')
370
-
371
-    start_date = datetime.strptime(start_time + ' 00:00:00', '%Y-%m-%d %H:%M:%S')
372
-    end_date = datetime.strptime(end_time + ' 23:59:59', '%Y-%m-%d %H:%M:%S')
373
-    logs = ConsumeInfoSubmitLogInfo.objects.filter(created_at__range=(start_date, end_date), dupload=False, test_user=False)
374
-    res = []
375
-
376
-    for log in logs:
377
-        modelInfo = ModelInfo.objects.get(model_id=log.model_id)
378
-        item = {'user_id': log.user_id, 'model_name': log.model_name, 'serialNo': log.serialNo}
379
-        try:
380
-            sale_log = SaleclerkSubmitLogInfo.objects.get(model_name=modelInfo.model_name, code=log.serialNo)
381
-            item['distributor_name'] = sale_log.distributor_name
382
-            item['outbound_time'] = sale_log.created_at
383
-        except:
384
-            item['distributor_name'] = ''
385
-            item['outbound_time'] = ''
386
-
387
-        
388
-        date = datetime.strptime('2020-01-14 00:00:00', '%Y-%m-%d %H:%M:%S')
389
-        encryptLog = MchInfoEncryptLogInfo.objects.filter(created_at__gte=date, sn=log.serialNo, model_pk=modelInfo.pk)
390
-        if not encryptLog:
391
-            item['is_new_code'] = False
392
-            item['is_complement'] = False
393
-        elif encryptLog.all()[0].operator_id == 'ZCQebtBiQHT8XRKpmbUotD':
394
-            item['is_complement'] = True
395
-            item['is_new_code'] = False
396
-        elif encryptLog.all()[0].operator_id == '5qX3KWXZ8iKaip4AdxwtKF':
397
-            item['is_new_code'] = True    
398
-            item['is_complement'] = False
399
-
400
-        if encryptLog:
401
-            item['outbound_time'] = encryptLog.all()[0].created_at 
402
-        else:
403
-            item['outbound_time'] = ''
404
-
405
-        res.append(item)
406
-
407
-    return response(data=res)
365
+    })

+ 0 - 2
api/urls.py

@@ -302,8 +302,6 @@ urlpatterns += [
302 302
     url(r'^admin/statistic/consumer/model$', admin_views.statistic_model, name='statistic_model'),
303 303
 
304 304
     url(r'^admin/statistic/distributor$', admin_views.statistic_distributor, name='statistic_distributor'),
305
-
306
-    url(r'^admin/statistic/deep/analyze$', admin_views.statistic_deep_analyze, name='statistic_deep_analyze'),
307 305
 ]
308 306
 
309 307
 urlpatterns += [