um lines-num-old"> 199
+        sssi, _ = SaleclerkSaleStatisticInfo.objects.select_for_update().get_or_create(
200
+            brand_id=brand.brand_id,
201
+            clerk_id=clerk.clerk_id,
202
+            ymd=ymd[:4],
203
+        )
204
+        sssi.distributor_id = distributor.distributor_id
205
+        sssi.distributor_name = distributor.distributor_name
206
+        sssi.distributor_short_name = distributor.distributor_short_name
207
+        sssi.clerk_name = clerk.clerk_name
208
+        sssi.num -= 1
209
+        sssi.save()
210
+
211
+
212
+@logit
213
+@staff_member_required
214
+@transaction.atomic
215
+def del_clerk_sale_submit_api(request):
216
+    brand_id = request.GET.get('brand_id', settings.KODO_DEFAULT_BRAND_ID)
217
+    pk = request.GET.get('pk', '')
218
+
219
+    exec_del_clerk_sale_submit(pk, request.user.username)
220
+
221
+    return response(200, 'Del Success', u'删除成功')

+ 7 - 3
api/urls.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -6,7 +6,7 @@ from django_file_upload import views as file_views
6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 from account import tourguide_views
7 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 7 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 from account import views as account_views
8 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 8 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 from api import (admin_views, clerk_views, distributor_views, encrypt_views, mch_views, member_views, model_views,
9 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-                 operator_views, sr_views, log_views)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 9 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                 operator_views, sr_views, staff_views, log_views)
10 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 10 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 from box import views as box_views
11 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 11 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 from geo import views as geo_views
12 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 12 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 from group import (groupuser_views, lensman_views, tourguidegroup_views, tourguidegroupadmin_views,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -295,7 +295,7 @@ urlpatterns += [
295 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 295 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     url(r'^admin/query_userinfo$', admin_views.query_userinfo, name='query_userinfo'),
296 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 296 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     url(r'^admin/userinfo_update$', admin_views.userinfo_update, name='userinfo_update'),
297 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 297 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
298 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-    #statistic
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 298 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    # statistic
299 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 299 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     url(r'^admin/statistic/user_profile$', admin_views.statistic_userprofile, name='statistic_userprofile'),
300 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 300 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     url(r'^admin/statistic/consumer/daily$', admin_views.statistic_daily, name='statistic_daily'),
301 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 301 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     url(r'^admin/statistic/consumer/model$', admin_views.statistic_model, name='statistic_model'),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -343,4 +343,8 @@ urlpatterns += [
343 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 343 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
344 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 344 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 urlpatterns += [
345 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 345 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     url(r'^log/camera/adaptive$', log_views.collect_camera_adaptive_log, name='log_camera_adaptive'),
346 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-]
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 346 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+]
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 347 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 348 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+urlpatterns += [
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 349 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    url(r'^del/clerk/sale/submit$', staff_views.del_clerk_sale_submit_api, name='del_clerk_sale_submit_api'),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 350 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+]

+ 1 - 2
commands/management/commands/gis.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -69,12 +69,11 @@ class Command(CompatibilityBaseCommand):
69 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 69 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
                     user_id = v.get('user_id', '')
70 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 70 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
                     ymd = v.get('ymd', '')
71 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 71 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
72 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-                    #更新用户表
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 72 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                    # 更新用户表
73 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 73 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
                     user = UserInfo.objects.get(user_id=user_id, status=True)
74 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 74 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
                     user.province_name = ProvinceShortModelMixin.PROVINCE_CODE_NAME_DICT.get(province_code)
75 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 75 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
                     user.save()
76 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 76 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
77 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-
78 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 77 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
                     # [消费者维度]省份销量统计
79 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 78 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
                     # 日
80 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 79 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
                     cpssi, _ = ConsumeProvinceSaleStatisticInfo.objects.select_for_update().get_or_create(

+ 1 - 0
coupon/tests.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -3,4 +3,5 @@ from __future__ import unicode_literals
3 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 3 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 from django.test import TestCase
5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 7 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 # Create your tests here.

+ 1 - 0
coupon/views.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -3,4 +3,5 @@ from __future__ import unicode_literals
3 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 3 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 from django.shortcuts import render
5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 7 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 # Create your views here.

+ 1 - 0
integral/admin.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -20,5 +20,6 @@ class SaleclerkSubmitLogInfoAdmin(AdvancedExportExcelModelAdmin, ReadOnlyModelAd
20 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 20 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     search_fields = ('code', 'remark', 'trackingNo', 'distributor_name', 'clerk_name', 'model_name')
21 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 21 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
22 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 22 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 23 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
23 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 24 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 admin.site.register(SaleclerkIntegralIncomeExpensesInfo, SaleclerkIntegralIncomeExpensesInfoAdmin)
24 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 25 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 admin.site.register(SaleclerkSubmitLogInfo, SaleclerkSubmitLogInfoAdmin)

+ 20 - 0
integral/migrations/0012_saleclerksubmitloginfo_is_wxwork.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -0,0 +1,20 @@
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+# -*- coding: utf-8 -*-
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 2 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+# Generated by Django 1.11.26 on 2020-02-25 08:28
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 3 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from __future__ import unicode_literals
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from django.db import migrations, models
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 7 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 8 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+class Migration(migrations.Migration):
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 9 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 10 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    dependencies = [
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 11 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        ('integral', '0011_auto_20191119_1348'),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 12 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    ]
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 13 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 14 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    operations = [
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 15 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        migrations.AddField(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 16 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            model_name='saleclerksubmitloginfo',
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 17 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            name='is_wxwork',
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 18 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            field=models.BooleanField(db_index=True, default=False, help_text='\u662f\u5426\u4e3a\u4f01\u4e1a\u5fae\u4fe1\u7aef', verbose_name='is_wxwork'),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 19 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        ),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 20 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    ]

+ 20 - 0
integral/migrations/0013_saleclerksubmitloginfo_is_staff_delete.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -0,0 +1,20 @@
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+# -*- coding: utf-8 -*-
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 2 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+# Generated by Django 1.11.28 on 2020-03-01 12:52
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 3 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from __future__ import unicode_literals
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from django.db import migrations, models
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 7 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 8 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+class Migration(migrations.Migration):
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 9 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 10 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    dependencies = [
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 11 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        ('integral', '0012_saleclerksubmitloginfo_is_wxwork'),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 12 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    ]
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 13 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 14 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    operations = [
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 15 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        migrations.AddField(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 16 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            model_name='saleclerksubmitloginfo',
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 17 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            name='is_staff_delete',
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 18 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            field=models.BooleanField(db_index=True, default=False, help_text='\u662f\u5426\u7ba1\u7406\u5458\u5220\u9664', verbose_name='is_staff_delete'),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 19 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        ),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 20 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    ]

+ 2 - 0
integral/models.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -114,6 +114,8 @@ class SaleclerkSubmitLogInfo(BaseModelMixin):
114 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 114 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
115 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 115 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     is_wxwork = models.BooleanField(_(u'is_wxwork'), default=False, help_text=_(u'是否为企业微信端'), db_index=True)
116 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 116 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 117 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    is_staff_delete = models.BooleanField(_(u'is_staff_delete'), default=False, help_text=_(u'是否管理员删除'), db_index=True)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 118 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
117 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 119 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     class Meta:
118 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 120 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
         verbose_name = _(u'销售员扫码出库记录')
119 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 121 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
         verbose_name_plural = _(u'销售员扫码出库记录')

+ 1 - 0
kodo/settings.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -71,6 +71,7 @@ INSTALLED_APPS = (
71 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 71 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     'pre',
72 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 72 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     'sales',
73 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 73 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     'server',
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 74 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    'staff',
74 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 75 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     'statistic',
75 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 76 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     'website',
76 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 77 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     'daterange_filter',

+ 3 - 0
logs/admin.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -21,15 +21,18 @@ class MchLogInfoAdmin(ReadOnlyModelAdmin, admin.ModelAdmin):
21 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 21 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     list_filter = ('operator_id', 'app_version', 'status')
22 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 22 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     search_fields = ('operator_id', 'app_version')
23 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 23 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 24 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
24 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 25 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 class MchLogInfoAdmin(ReadOnlyModelAdmin, admin.ModelAdmin):
25 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 26 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     list_display = ('log_id', 'log_file', 'operator_id', 'app_version', 'status', 'created_at', 'updated_at')
26 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 27 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     list_filter = ('operator_id', 'app_version', 'status')
27 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 28 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     search_fields = ('operator_id', 'app_version')
28 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 29 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 30 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
29 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 31 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 class MchSearchModelAndCameraLogInfoAdmin(admin.ModelAdmin):
30 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 32 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     list_display = ('user_id', 'is_search_model', 'is_selected_model', 'is_search_camera', 'is_search_model_camera', 'is_search_camera_after_model', 'created_at')
31 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 33 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     list_filter = ('is_search_model', 'is_selected_model', 'is_search_camera', 'is_search_model_camera', 'is_search_camera_after_model')
32 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 34 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 35 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
33 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 36 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 admin.site.register(MchInfoDecryptLogInfo, MchInfoDecryptLogInfoAdmin)
34 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 37 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 admin.site.register(MchInfoEncryptLogInfo, MchInfoEncryptLogInfoAdmin)
35 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 38 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 admin.site.register(MchSearchModelAndCameraLogInfo, MchSearchModelAndCameraLogInfoAdmin)

+ 35 - 0
logs/migrations/0008_mchsearchmodelandcameraloginfo.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -0,0 +1,35 @@
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+# -*- coding: utf-8 -*-
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 2 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+# Generated by Django 1.11.26 on 2020-02-27 16:58
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 3 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from __future__ import unicode_literals
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from django.db import migrations, models
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+import shortuuidfield.fields
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 7 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 8 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 9 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+class Migration(migrations.Migration):
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 10 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 11 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    dependencies = [
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 12 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        ('logs', '0007_auto_20200114_1229'),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 13 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    ]
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 14 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 15 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    operations = [
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 16 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        migrations.CreateModel(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 17 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            name='MchSearchModelAndCameraLogInfo',
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 18 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            fields=[
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 19 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 20 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ('status', models.BooleanField(db_index=True, default=True, help_text='Status', verbose_name='status')),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 21 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ('created_at', models.DateTimeField(auto_now_add=True, help_text='Create Time', verbose_name='created_at')),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 22 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ('updated_at', models.DateTimeField(auto_now=True, help_text='Update Time', verbose_name='updated_at')),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 23 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ('user_id', models.CharField(blank=True, db_index=True, help_text='\u7528\u6237\u552f\u4e00\u6807\u8bc6', max_length=32, null=True, verbose_name='user_id')),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 24 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ('log_id', shortuuidfield.fields.ShortUUIDField(blank=True, db_index=True, editable=False, help_text='\u65e5\u5fd7\u552f\u4e00\u6807\u8bc6', max_length=22)),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 25 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ('is_search_model', models.IntegerField(db_index=True, default=0, help_text='\u641c\u7d22\u955c\u5934\u578b\u53f7', verbose_name='is_search_model')),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 26 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ('is_search_camera', models.IntegerField(db_index=True, default=0, help_text='\u641c\u7d22\u76f8\u673a\u578b\u53f7', verbose_name='is_search_model')),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 27 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ('is_search_model_camera', models.IntegerField(db_index=True, default=0, help_text='\u641c\u7d22\u76f8\u673a\u578b\u53f7\u548c\u955c\u5934\u578b\u53f7', verbose_name='is_search_model')),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 28 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ('is_search_camera_after_model', models.IntegerField(db_index=True, default=0, help_text='\u9009\u62e9\u955c\u5934\u540e\u641c\u7d22\u76f8\u673a\u578b\u53f7', verbose_name='is_search_camera_after_model')),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 29 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            ],
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 30 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            options={
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 31 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                'verbose_name': 'mchsearchmodelandcameraloginfo',
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 32 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                'verbose_name_plural': 'mchsearchmodelandcameraloginfo',
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 33 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            },
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 34 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        ),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 35 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    ]

+ 20 - 0
logs/migrations/0009_mchsearchmodelandcameraloginfo_is_selected_model.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -0,0 +1,20 @@
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+# -*- coding: utf-8 -*-
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 2 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+# Generated by Django 1.11.26 on 2020-02-27 17:08
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 3 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from __future__ import unicode_literals
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from django.db import migrations, models
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 7 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 8 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+class Migration(migrations.Migration):
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 9 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 10 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    dependencies = [
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 11 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        ('logs', '0008_mchsearchmodelandcameraloginfo'),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 12 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    ]
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 13 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 14 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    operations = [
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 15 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        migrations.AddField(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 16 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            model_name='mchsearchmodelandcameraloginfo',
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 17 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            name='is_selected_model',
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 18 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            field=models.IntegerField(db_index=True, default=0, help_text='\u641c\u7d22\u76f8\u673a\u578b\u53f7', verbose_name='is_selected_model'),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 19 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        ),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 20 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    ]

+ 2 - 1
logs/models.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -72,6 +72,7 @@ class MchLogInfo(BaseModelMixin):
72 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 72 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     def __unicode__(self):
73 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 73 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
         return unicode(self.pk)
74 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 74 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 75 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
75 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 76 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 class MchSearchModelAndCameraLogInfo(BaseModelMixin):
76 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 77 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     user_id = models.CharField(_(u'user_id'), max_length=32, blank=True, null=True, help_text=u'用户唯一标识', db_index=True)
77 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 78 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -88,4 +89,4 @@ class MchSearchModelAndCameraLogInfo(BaseModelMixin):
88 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 89 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
         verbose_name_plural = _(u'mchsearchmodelandcameraloginfo')
89 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 90 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
90 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 91 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     def __unicode__(self):
91 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        return unicode(self.pk)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 92 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        return unicode(self.pk)

+ 20 - 0
mch/migrations/0044_modelcamerabodyinfo_camera_brand_name.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -0,0 +1,20 @@
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+# -*- coding: utf-8 -*-
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 2 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+# Generated by Django 1.11.26 on 2020-02-23 08:32
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 3 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from __future__ import unicode_literals
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from django.db import migrations, models
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 7 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 8 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+class Migration(migrations.Migration):
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 9 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 10 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    dependencies = [
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 11 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        ('mch', '0043_modelcamerabodyinfo'),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 12 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    ]
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 13 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 14 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    operations = [
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 15 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        migrations.AddField(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 16 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            model_name='modelcamerabodyinfo',
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 17 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            name='camera_brand_name',
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 18 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            field=models.CharField(blank=True, help_text='\u673a\u8eab\u54c1\u724c', max_length=255, null=True, verbose_name='camera_brand_name'),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 19 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        ),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 20 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    ]

+ 2 - 1
mch/models.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -635,7 +635,7 @@ class ConsumeInfoSubmitLogInfo(BaseModelMixin):
635 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 635 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
             model_info = ModelInfo.objects.get(model_id=self.model_id)
636 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 636 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
         except ModelInfo.DoesNotExist:
637 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 637 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
             model_info = {}
638 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 638 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
639 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 639 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
         return {
640 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 640 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
             'model_name': self.model_name,
641 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 641 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
             'serialNo': self.serialNo,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -644,6 +644,7 @@ class ConsumeInfoSubmitLogInfo(BaseModelMixin):
644 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 644 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
             'created_at': tc.local_string(self.created_at, format='%Y-%m-%d'),
645 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 645 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
         }
646 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 646 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 647 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
647 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 648 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 class ActivityInfo(BaseModelMixin):
648 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 649 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     FIXED_EXPIRED_TIME = 0
649 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 650 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     CHANGED_EXPIRED_TIME = 1

+ 1 - 1
member/models.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -91,7 +91,7 @@ class GoodsInfo(BaseModelMixin):
91 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 91 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
             'able': True,
92 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 92 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
             'value': self.value,
93 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 93 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
         }
94 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-    
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 94 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
95 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 95 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     def details(self, user_id):
96 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 96 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
         detail = self.data(user_id)
97 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 97 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
         detail['desc'] = self.desc

+ 2 - 15
page/sale_views.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -97,9 +97,7 @@ def clerk_sale_submit_api(request):
97 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 97 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     ymd = tc.local_string(format='%Y%m%d')
98 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 98 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
99 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 99 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     # 是否被消费者扫过
100 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-    has_scan = ConsumeInfoSubmitLogInfo.objects.filter(
101 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        model_id=model.model_id,
102 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        serialNo=serialNo).exists()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 100 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    has_scan = ConsumeInfoSubmitLogInfo.objects.filter(model_id=model.model_id, serialNo=serialNo).exists()
103 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 101 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
104 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 102 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     # 店员提交记录
105 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 103 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     ssli = SaleclerkSubmitLogInfo.objects.create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -239,7 +237,6 @@ def clerk_sale_submit_api(request):
239 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 237 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
         mssi.num = len(mssi.saleclerks)
240 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 238 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
         mssi.save()
241 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 239 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
242 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-
243 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 240 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
         # 经销商销量统计
244 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 241 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
         dssi, _ = DistributorSaleStatisticInfo.objects.select_for_update().get_or_create(
245 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 242 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
             brand_id=brand.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -287,15 +284,6 @@ def clerk_sale_submit_api(request):
287 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 284 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
         pssi.num += 1
288 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 285 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
         pssi.save()
289 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 286 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
290 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        # pssi2, _ = ProvinceSaleStatisticInfo.objects.select_for_update().get_or_create(
291 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        #     brand_id=brand.brand_id,
292 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        #     province_code=distributor.distributor_province_code,
293 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        #     ymd=0,
294 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        # )
295 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        # pssi2.province_name = distributor.distributor_province_name
296 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        # pssi2.num += 1
297 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        # pssi2.save()
298 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-
299 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 287 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
         # 日销售员销量统计
300 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 288 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
         sssi, _ = SaleclerkSaleStatisticInfo.objects.select_for_update().get_or_create(
301 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 289 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
             brand_id=brand.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -451,9 +439,8 @@ def clerk_checkout_serialNo_api(request):
451 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 439 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     except SaleclerkInfo.DoesNotExist:
452 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 440 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
         return response(SaleclerkStatusCode.CLERK_NOT_FOUND)
453 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 441 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
454 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-
455 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 442 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     log = MchInfoEncryptLogInfo.objects.filter(model_pk=model_pk, sn=serialNo)
456 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-    
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 443 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
457 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 444 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
     if not log:
458 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 445 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
         return response(ProductMachineStatusCode.SN_NOT_FOUND)
459 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 446 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 

+ 0 - 2
pre/market_code.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -37,5 +37,3 @@ def marketcodedownload(application_id, code_start, code_end, isv_application_id=
37 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 37 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
                 code_index=code_index,
38 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 38 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
                 code_url=code_url
39 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 39 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
             )
40 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-
41 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-

+ 248 - 76
pre/views.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -4,14 +4,17 @@ from __future__ import division
4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 import xlrd
6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 from django.conf import settings
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 7 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from django.db import transaction
7 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 8 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 from pysnippets.strsnippets import strip
8 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 9 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 from TimeConvert import TimeConvert as tc
9 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 10 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
10 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-from mch.models import BrandInfo, ConsumeInfoSubmitLogInfo, DistributorInfo, ModelInfo, ModelCameraBodyInfo
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 11 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from integral.models import SaleclerkSubmitLogInfo
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 12 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from mch.models import (BrandInfo, ConsumeInfoSubmitLogInfo, DistributorInfo, ModelCameraBodyInfo, ModelInfo,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 13 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                        SaleclerkInfo)
11 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 14 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 from statistic.models import (ConsumeDistributorSaleStatisticInfo, ConsumeModelSaleStatisticInfo,
12 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 15 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
                               ConsumeProvinceSaleStatisticInfo, ConsumeSaleStatisticInfo, ConsumeUserStatisticInfo,
13 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 16 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
                               DistributorSaleStatisticInfo, ModelSaleStatisticInfo, ProvinceSaleStatisticInfo,
14 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-                              SaleStatisticInfo)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 17 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                              SaleclerkSaleStatisticInfo, SaleStatisticInfo)
15 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 18 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 from utils.redis.connect import r
16 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 19 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 from utils.redis.rkeys import MINI_PROGRAM_GIS_LIST
17 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 20 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -253,77 +256,246 @@ def refreshs():
253 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 256 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
         except ModelInfo.DoesNotExist:
254 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 257 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
             continue
255 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 258 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
256 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cusi, _ = ConsumeUserStatisticInfo.objects.get_or_create(
257 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            brand_id=mdl.brand_id,
258 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            ymd=ymd,
259 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        )
260 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cusi.users = list(set(cusi.users + [log.user_id]))
261 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cusi.num = len(cusi.users)
262 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cusi.save()
263 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cusi, _ = ConsumeUserStatisticInfo.objects.get_or_create(
264 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            brand_id=mdl.brand_id,
265 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            ymd=ymd[:6],
266 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        )
267 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cusi.users = list(set(cusi.users + [log.user_id]))
268 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cusi.num = len(cusi.users)
269 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cusi.save()
270 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cusi, _ = ConsumeUserStatisticInfo.objects.get_or_create(
271 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            brand_id=mdl.brand_id,
272 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            ymd=ymd[:4],
273 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        )
274 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cusi.users = list(set(cusi.users + [log.user_id]))
275 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cusi.num = len(cusi.users)
276 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cusi.save()
277 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-
278 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cssi, _ = ConsumeSaleStatisticInfo.objects.get_or_create(
279 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            brand_id=mdl.brand_id,
280 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            ymd=ymd,
281 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        )
282 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cssi.num += 1
283 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cssi.save()
284 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cssi, _ = ConsumeSaleStatisticInfo.objects.get_or_create(
285 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            brand_id=mdl.brand_id,
286 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            ymd=ymd[:6],
287 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        )
288 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cssi.num += 1
289 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cssi.save()
290 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cssi, _ = ConsumeSaleStatisticInfo.objects.get_or_create(
291 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            brand_id=mdl.brand_id,
292 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            ymd=ymd[:4],
293 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        )
294 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cssi.num += 1
295 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cssi.save()
296 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-
297 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        # 日型号销量统计
298 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cmssi, _ = ConsumeModelSaleStatisticInfo.objects.get_or_create(
299 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            brand_id=mdl.brand_id,
300 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            model_name=mdl.model_uni_name,
301 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            ymd=ymd,
302 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        )
303 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cmssi.num += 1
304 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cmssi.save()
305 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        # 月型号销量统计
306 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cmssi, _ = ConsumeModelSaleStatisticInfo.objects.get_or_create(
307 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            brand_id=mdl.brand_id,
308 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            model_name=mdl.model_uni_name,
309 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            ymd=ymd[:6],
310 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        )
311 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cmssi.num += 1
312 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cmssi.save()
313 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        # 年型号销量统计
314 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cmssi, _ = ConsumeModelSaleStatisticInfo.objects.get_or_create(
315 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            brand_id=mdl.brand_id,
316 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            model_name=mdl.model_uni_name,
317 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            ymd=ymd[:4],
318 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        )
319 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cmssi.num += 1
320 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        cmssi.save()
321 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-
322 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        r.rpushjson(MINI_PROGRAM_GIS_LIST, {
323 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            'brand_id': log.brand_id,
324 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            'user_id': log.user_id,
325 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            'lat': log.lat,
326 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            'lon': log.lon,
327 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            'phone': log.phone,
328 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-            'ymd': tc.local_string(tc.to_local_datetime(log.created_at), format='%Y%m%d'),
329 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
-        })
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 259 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        with transaction.atomic():
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 260 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cusi, _ = ConsumeUserStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 261 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=mdl.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 262 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 263 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 264 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cusi.users = list(set(cusi.users + [log.user_id]))
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 265 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cusi.num = len(cusi.users)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 266 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cusi.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 267 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cusi, _ = ConsumeUserStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 268 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=mdl.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 269 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd[:6],
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 270 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 271 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cusi.users = list(set(cusi.users + [log.user_id]))
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 272 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cusi.num = len(cusi.users)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 273 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cusi.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 274 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cusi, _ = ConsumeUserStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 275 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=mdl.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 276 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd[:4],
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 277 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 278 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cusi.users = list(set(cusi.users + [log.user_id]))
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 279 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cusi.num = len(cusi.users)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 280 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cusi.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 281 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 282 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cssi, _ = ConsumeSaleStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 283 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=mdl.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 284 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 285 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 286 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cssi.num += 1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 287 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cssi.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 288 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cssi, _ = ConsumeSaleStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 289 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=mdl.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 290 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd[:6],
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 291 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 292 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cssi.num += 1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 293 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cssi.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 294 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cssi, _ = ConsumeSaleStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 295 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=mdl.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 296 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd[:4],
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 297 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 298 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cssi.num += 1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 299 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cssi.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 300 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 301 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            # 日型号销量统计
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 302 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cmssi, _ = ConsumeModelSaleStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 303 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=mdl.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 304 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                model_name=mdl.model_uni_name,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 305 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 306 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 307 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cmssi.num += 1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 308 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cmssi.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 309 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            # 月型号销量统计
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 310 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cmssi, _ = ConsumeModelSaleStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 311 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=mdl.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 312 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                model_name=mdl.model_uni_name,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 313 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd[:6],
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 314 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 315 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cmssi.num += 1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 316 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cmssi.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 317 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            # 年型号销量统计
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 318 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cmssi, _ = ConsumeModelSaleStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 319 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=mdl.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 320 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                model_name=mdl.model_uni_name,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 321 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd[:4],
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 322 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 323 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cmssi.num += 1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 324 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            cmssi.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 325 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 326 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            r.rpushjson(MINI_PROGRAM_GIS_LIST, {
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 327 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                'brand_id': log.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 328 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                'user_id': log.user_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 329 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                'lat': log.lat,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 330 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                'lon': log.lon,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 331 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                'phone': log.phone,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 332 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                'ymd': tc.local_string(tc.to_local_datetime(log.created_at), format='%Y%m%d'),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 333 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            })
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 334 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 335 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 336 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+def refreshs2():
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 337 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    SaleStatisticInfo.objects.all().delete()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 338 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    ModelSaleStatisticInfo.objects.all().delete()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 339 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    DistributorSaleStatisticInfo.objects.all().delete()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 340 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    ProvinceSaleStatisticInfo.objects.all().delete()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 341 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    SaleclerkSaleStatisticInfo.objects.all().delete()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 342 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 343 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    logs = SaleclerkSubmitLogInfo.objects.filter(dupload=False, test_user=False, test_sn=False, status=True)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 344 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 345 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    for log in logs:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 346 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        ymd = tc.local_string(tc.to_local_datetime(log.created_at), format='%Y%m%d')
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 347 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 348 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        try:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 349 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            brand = BrandInfo.objects.get(pk=log.brand_pk)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 350 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        except BrandInfo.DoesNotExist:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 351 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            continue
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 352 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 353 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        try:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 354 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            model = ModelInfo.objects.get(pk=log.model_pk)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 355 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        except ModelInfo.DoesNotExist:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 356 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            continue
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 357 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 358 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        try:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 359 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            clerk = SaleclerkInfo.objects.get(clerk_id=log.clerk_id, status=True)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 360 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        except SaleclerkInfo.DoesNotExist:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 361 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            continue
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 362 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 363 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        try:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 364 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            distributor = DistributorInfo.objects.get(distributor_id=clerk.distributor_id)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 365 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        except DistributorInfo.DoesNotExist:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 366 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            continue
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 367 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 368 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        with transaction.atomic():
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 369 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            # 日销量统计
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 370 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            ssi, _ = SaleStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 371 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=brand.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 372 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 373 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 374 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            ssi.num += 1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 375 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            ssi.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 376 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            # 月销量统计
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 377 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            ssi, _ = SaleStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 378 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=brand.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 379 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd[:6],
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 380 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 381 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            ssi.num += 1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 382 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            ssi.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 383 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            # 年销量统计
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 384 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            ssi, _ = SaleStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 385 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=brand.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 386 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd[:4],
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 387 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 388 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            ssi.num += 1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 389 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            ssi.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 390 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 391 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            # 型号销量统计
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 392 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            mssi, _ = ModelSaleStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 393 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=brand.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 394 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                model_name=model.model_uni_name,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 395 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 396 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 397 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            mssi.saleclerks += [clerk.clerk_id]
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 398 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            mssi.num = len(mssi.saleclerks)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 399 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            mssi.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 400 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 401 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            mssi, _ = ModelSaleStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 402 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=brand.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 403 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                model_name=model.model_uni_name,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 404 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd[:6],
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 405 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 406 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            mssi.saleclerks += [clerk.clerk_id]
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 407 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            mssi.num = len(mssi.saleclerks)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 408 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            mssi.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 409 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 410 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            mssi, _ = ModelSaleStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 411 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=brand.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 412 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                model_name=model.model_uni_name,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 413 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd[:4],
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 414 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 415 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            mssi.saleclerks += [clerk.clerk_id]
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 416 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            mssi.num = len(mssi.saleclerks)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 417 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            mssi.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 418 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 419 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            # 经销商销量统计
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 420 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            dssi, _ = DistributorSaleStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 421 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=brand.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 422 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                distributor_id=distributor.distributor_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 423 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 424 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 425 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            dssi.distributor_name = distributor.distributor_name
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 426 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            dssi.num += 1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 427 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            dssi.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 428 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 429 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            dssi2, _ = DistributorSaleStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 430 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=brand.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 431 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                distributor_id=distributor.distributor_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 432 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=0,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 433 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 434 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            dssi2.distributor_name = distributor.distributor_name
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 435 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            dssi2.num += 1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 436 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            dssi2.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 437 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 438 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            # 日省份销量统计
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 439 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            pssi, _ = ProvinceSaleStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 440 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=brand.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 441 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                province_code=distributor.distributor_province_code,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 442 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 443 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 444 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            pssi.province_name = distributor.distributor_province_name
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 445 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            pssi.num += 1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 446 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            pssi.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 447 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            # 月省份销量统计
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 448 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            pssi, _ = ProvinceSaleStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 449 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=brand.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 450 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                province_code=distributor.distributor_province_code,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 451 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd[:6],
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 452 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 453 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            pssi.province_name = distributor.distributor_province_name
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 454 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            pssi.num += 1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 455 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            pssi.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 456 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            # 年省份销量统计
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 457 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            pssi, _ = ProvinceSaleStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 458 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=brand.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 459 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                province_code=distributor.distributor_province_code,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 460 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd[:4],
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 461 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 462 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            pssi.province_name = distributor.distributor_province_name
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 463 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            pssi.num += 1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 464 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            pssi.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 465 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 466 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            # 日销售员销量统计
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 467 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            sssi, _ = SaleclerkSaleStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 468 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=brand.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 469 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                clerk_id=clerk.clerk_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 470 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 471 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 472 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            sssi.distributor_id = distributor.distributor_id
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 473 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            sssi.distributor_name = distributor.distributor_name
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 474 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            sssi.distributor_short_name = distributor.distributor_short_name
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 475 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            sssi.clerk_name = clerk.clerk_name
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 476 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            sssi.num += 1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 477 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            sssi.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 478 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            # 月销售员销量统计
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 479 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            sssi, _ = SaleclerkSaleStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 480 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=brand.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 481 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                clerk_id=clerk.clerk_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 482 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd[:6],
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 483 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 484 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            sssi.distributor_id = distributor.distributor_id
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 485 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            sssi.distributor_name = distributor.distributor_name
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 486 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            sssi.distributor_short_name = distributor.distributor_short_name
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 487 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            sssi.clerk_name = clerk.clerk_name
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 488 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            sssi.num += 1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 489 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            sssi.save()
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 490 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            # 年销售员销量统计
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 491 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            sssi, _ = SaleclerkSaleStatisticInfo.objects.select_for_update().get_or_create(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 492 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                brand_id=brand.brand_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 493 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                clerk_id=clerk.clerk_id,
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 494 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ymd=ymd[:4],
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 495 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            )
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 496 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            sssi.distributor_id = distributor.distributor_id
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 497 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            sssi.distributor_name = distributor.distributor_name
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 498 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            sssi.distributor_short_name = distributor.distributor_short_name
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 499 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            sssi.clerk_name = clerk.clerk_name
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 500 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            sssi.num += 1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 501 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            sssi.save()

+ 1 - 0
shells/admin.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -3,4 +3,5 @@ from __future__ import unicode_literals
3 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 3 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 from django.contrib import admin
5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 7 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 # Register your models here.

+ 1 - 0
shells/models.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -3,4 +3,5 @@ from __future__ import unicode_literals
3 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 3 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 from django.db import models
5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 7 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 # Create your models here.

+ 1 - 0
shells/tests.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -3,4 +3,5 @@ from __future__ import unicode_literals
3 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 3 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 from django.test import TestCase
5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 7 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
 # Create your tests here.

+ 0 - 0
staff/__init__.py


+ 12 - 0
staff/admin.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -0,0 +1,12 @@
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+# -*- coding: utf-8 -*-
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 2 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 3 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from django.contrib import admin
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from staff.models import StaffDeleteClerkSaleSubmitLogInfo
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 7 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 8 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+class StaffDeleteClerkSaleSubmitLogInfoAdmin(admin.ModelAdmin):
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 9 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    list_display = ('username', 'code', 'status', 'created_at', 'updated_at')
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 10 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 11 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 12 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+admin.site.register(StaffDeleteClerkSaleSubmitLogInfo, StaffDeleteClerkSaleSubmitLogInfoAdmin)

+ 8 - 0
staff/apps.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -0,0 +1,8 @@
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+# -*- coding: utf-8 -*-
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 2 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from __future__ import unicode_literals
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 3 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from django.apps import AppConfig
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 7 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+class StaffConfig(AppConfig):
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 8 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    name = 'staff'

+ 31 - 0
staff/migrations/0001_initial.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -0,0 +1,31 @@
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+# -*- coding: utf-8 -*-
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 2 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+# Generated by Django 1.11.28 on 2020-03-01 13:19
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 3 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from __future__ import unicode_literals
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from django.db import migrations, models
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 7 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 8 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+class Migration(migrations.Migration):
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 9 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 10 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    initial = True
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 11 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 12 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    dependencies = [
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 13 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    ]
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 14 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 15 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    operations = [
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 16 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        migrations.CreateModel(
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 17 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            name='StaffDeleteClerkSaleSubmitLogInfo',
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 18 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            fields=[
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 19 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 20 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ('status', models.BooleanField(db_index=True, default=True, help_text='Status', verbose_name='status')),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 21 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ('created_at', models.DateTimeField(auto_now_add=True, help_text='Create Time', verbose_name='created_at')),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 22 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ('updated_at', models.DateTimeField(auto_now=True, help_text='Update Time', verbose_name='updated_at')),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 23 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ('username', models.CharField(blank=True, db_index=True, help_text='\u7528\u6237\u540d', max_length=32, null=True, verbose_name='username')),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 24 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                ('code', models.CharField(blank=True, db_index=True, help_text='\u673a\u8eab\u7801', max_length=32, null=True, verbose_name='code')),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 25 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            ],
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 26 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            options={
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 27 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                'verbose_name': 'staffdeleteclerksalesubmitloginfo',
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 28 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+                'verbose_name_plural': 'staffdeleteclerksalesubmitloginfo',
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 29 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+            },
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 30 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        ),
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 31 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    ]

+ 0 - 0
staff/migrations/__init__.py


+ 17 - 0
staff/models.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -0,0 +1,17 @@
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+# -*- coding: utf-8 -*-
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 2 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 3 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from django.db import models
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from django.utils.translation import ugettext_lazy as _
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from django_models_ext import BaseModelMixin
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 7 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 8 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+class StaffDeleteClerkSaleSubmitLogInfo(BaseModelMixin):
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 9 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    username = models.CharField(_(u'username'), max_length=32, blank=True, null=True, help_text=u'用户名', db_index=True)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 10 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    code = models.CharField(_(u'code'), max_length=32, blank=True, null=True, help_text=u'机身码', db_index=True)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 11 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 12 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    class Meta:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 13 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        verbose_name = _(u'staffdeleteclerksalesubmitloginfo')
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 14 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        verbose_name_plural = _(u'staffdeleteclerksalesubmitloginfo')
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 15 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 16 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+    def __unicode__(self):
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 17 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+        return unicode(self.pk)

+ 6 - 0
staff/tests.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -0,0 +1,6 @@
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+# -*- coding: utf-8 -*-
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 2 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from __future__ import unicode_literals
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 3 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from django.test import TestCase
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+# Create your tests here.

+ 6 - 0
staff/views.py

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
@@ -0,0 +1,6 @@
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 1 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+# -*- coding: utf-8 -*-
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 2 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from __future__ import unicode_literals
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 3 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 4 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+from django.shortcuts import render
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 6 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
+# Create your views here.

pai2 - Gogs: Go Git Service

拍爱

oauth_views.py 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # -*- coding: utf-8 -*-
  2. import json
  3. from django.shortcuts import render
  4. from account.models import LensmanInfo, TourGuideInfo
  5. from utils.redis.connect import r
  6. def lensman_oauth(request):
  7. unionid = request.GET.get('unionid', '')
  8. try:
  9. lensman = LensmanInfo.objects.get(unionid=unionid)
  10. except LensmanInfo.DoesNotExist:
  11. lensman = None
  12. return render(request, 'page/lensman_oauth.html', {
  13. 'lensman_info': lensman and lensman.data,
  14. 'modified': bool((not lensman) or (lensman and lensman.user_status in [LensmanInfo.UNVERIFIED, LensmanInfo.REFUSED])), # 是否可以更改信息
  15. })
  16. def tourguide_oauth(request):
  17. unionid = request.GET.get('unionid', '')
  18. try:
  19. tourguide = TourGuideInfo.objects.get(unionid=unionid)
  20. except TourGuideInfo.DoesNotExist:
  21. tourguide = None
  22. return render(request, 'page/tourguide_oauth.html', {
  23. 'tourguide_info': tourguide and tourguide.data,
  24. 'modified': bool((not tourguide) or (tourguide and tourguide.user_status in [TourGuideInfo.UNVERIFIED, TourGuideInfo.REFUSED])), # 是否可以更改信息
  25. })
  26. def login_qrcode(request):
  27. unionid = request.GET.get('unionid', '')
  28. data = {
  29. 'unionid': unionid,
  30. 'token': r.token(unionid)
  31. }
  32. return render(request, 'page/login_qrcode.html', {
  33. 'data': json.dumps(data)
  34. })