69
+                )
70
+                yesterday_num = sums.get('yesterday_num__sum', 0) or 0
71
+                current_month = sums.get('current_month__sum', 0) or 0
72
+                last_month = sums.get('last_month__sum', 0) or 0
73
+                SuperSalesResponsibilityInfoModelsSaleStatisticInfo.objects.create(
74
+                    brand_id=b.brand_id,
75
+                    sr_id=s.sr_id,
76
+                    sr_name=s.name,
77
+                    ymd=day,
78
+                    yesterday_num=yesterday_num,
79
+                    current_month=current_month,
80
+                    last_month=last_month,
81
+                )
82
+
83
+        close_old_connections()

+ 3 - 0
integral/models.py

@@ -99,6 +99,9 @@ class SaleclerkSubmitLogInfo(BaseModelMixin):
99 99
     test_user = models.BooleanField(_(u'test_user'), default=False, help_text=_(u'是否为测试用户'), db_index=True)
100 100
     test_sn = models.BooleanField(_(u'test_sn'), default=False, help_text=_(u'是否为测试序列号'), db_index=True)
101 101
 
102
+    ym = models.IntegerField(_(u'ym'), default=0, help_text=u'年月', db_index=True)  # 例:201712, tc.local_string(format='%Y%m')
103
+    ymd = models.IntegerField(_(u'ymd'), default=0, help_text=u'年月日', db_index=True)  # 例:20171208, tc.local_string(format='%Y%m%d')
104
+
102 105
     class Meta:
103 106
         verbose_name = _(u'saleclerksubmitloginfo')
104 107
         verbose_name_plural = _(u'saleclerksubmitloginfo')

+ 1 - 2
requirements.txt

@@ -2,8 +2,7 @@ CodeConvert==2.0.5
2 2
 MySQL-python==1.2.5
3 3
 Pillow==5.0.0
4 4
 StatusCode==1.0.0
5
-TimeConvert==1.4.4
6
-cryptography==1.5.2
5
+TimeConvert==1.5.0
7 6
 furl==2.0.0
8 7
 isoweek==1.3.3
9 8
 jsonfield==2.0.2

+ 3 - 0
sales/models.py

@@ -80,6 +80,9 @@ class SalesResponsibilityInfo(BaseModelMixin):
80 80
 class SalesResponsibilityInfoModelsSaleStatisticInfo(BaseModelMixin):
81 81
     brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True)
82 82
 
83
+    # 销售担当,供 SuperSalesResponsibilityInfoModelsSaleStatisticInfo 统计使用
84
+    sr_id = models.CharField(_(u'sr_id'), max_length=32, help_text=u'销售担当唯一标识', db_index=True)
85
+
83 86
     # 经销商
84 87
     distributor_id = models.CharField(_(u'distributor_id'), max_length=32, help_text=u'经销商唯一标识', db_index=True)
85 88
     distributor_name = models.CharField(_(u'distributor_name'), max_length=255, blank=True, null=True, help_text=u'经销商名称')

kodo - Gogs: Go Git Service

Нет описания

Kimi.Huang: 7dc0b7fc6b :art: Makemigrations лет %!s(int64=6): %!d(string=назад)
..
0001_initial.py 5fdb5b42fd Logfile Upload лет %!s(int64=8): %!d(string=назад)
0002_auto_20180530_1122.py 5fdb5b42fd Logfile Upload лет %!s(int64=8): %!d(string=назад)
0003_mchinfoencryptloginfo.py 15e0f2277f MchInfoEncryptLogInfo лет %!s(int64=8): %!d(string=назад)
0004_mchinfoencryptloginfo_distributor_pk.py 15e0f2277f MchInfoEncryptLogInfo лет %!s(int64=8): %!d(string=назад)
0005_mchinfodecryptloginfo.py 6e7c94e744 MchInfoDecryptLogInfo лет %!s(int64=8): %!d(string=назад)
0006_auto_20200113_1832.py 212f24c882 MarketCode лет %!s(int64=6): %!d(string=назад)
0007_auto_20200114_1229.py f17ee852fd decrypt2 лет %!s(int64=6): %!d(string=назад)
0008_mchsearchmodelandcameraloginfo.py 9619c195e6 :art: Makemigrations лет %!s(int64=6): %!d(string=назад)
0009_mchsearchmodelandcameraloginfo_is_selected_model.py 9619c195e6 :art: Makemigrations лет %!s(int64=6): %!d(string=назад)
0010_mchinfoencryptloginfo_version.py 7dc0b7fc6b :art: Makemigrations лет %!s(int64=6): %!d(string=назад)
0011_auto_20200309_1735.py 7dc0b7fc6b :art: Makemigrations лет %!s(int64=6): %!d(string=назад)
__init__.py 5fdb5b42fd Logfile Upload лет %!s(int64=8): %!d(string=назад)