Browse Source

iiiiii

Signed-off-by: Binren Zhnag <zhangbr@elab-plus.com>
Binren Zhnag 4 years ago
parent
commit
bf91d924b1
2 changed files with 74 additions and 75 deletions
  1. 73 72
      apscheduler_elab.py
  2. 1 3
      jianye_report.py

+ 73 - 72
apscheduler_elab.py

@@ -63,79 +63,80 @@ class Config(object):
             'day_of_week': '*',
             'hour': 8,
             'minute': 30
-        },
-        {
-            'id': 'day_work_5',
-            'func': 'apscheduler_elab:Funcs.day_work_5',
-            'args': '',
-            'trigger': 'cron',
-            'day_of_week': '*',
-            'hour': jianye__house_hour,
-            'minute': jianye_house_minute
-        },
-        {
-            'id': 'day_work_6',
-            'func': 'apscheduler_elab:Funcs.day_work_6',
-            'args': '',
-            'trigger': 'cron',
-            'day_of_week': '*',
-            'hour': jianye__house_hour,
-            'minute': jianye_house_minute
-        },
-        {
-            'id': 'day_work_7',
-            'func': 'apscheduler_elab:Funcs.day_work_7',
-            'args': '',
-            'trigger': 'cron',
-            'day_of_week': '*',
-            'hour': jianye__house_hour,
-            'minute': jianye_house_minute
-        },
-        {
-            'id': 'day_work_8',
-            'func': 'apscheduler_elab:Funcs.day_work_8',
-            'args': '',
-            'trigger': 'cron',
-            'day_of_week': '*',
-            'hour': jianye__house_hour,
-            'minute': jianye_house_minute
-        },
-        {
-            'id': 'day_work_9',
-            'func': 'apscheduler_elab:Funcs.day_work_9',
-            'args': '',
-            'trigger': 'cron',
-            'day_of_week': '*',
-            'hour': jianye__house_hour,
-            'minute': jianye_house_minute
-        },
-        {
-            'id': 'day_work_10',
-            'func': 'apscheduler_elab:Funcs.day_work_10',
-            'args': '',
-            'trigger': 'cron',
-            'day_of_week': '*',
-            'hour': jianye__house_hour,
-            'minute': jianye_house_minute
-        },
-        {
-            'id': 'day_work_11',
-            'func': 'apscheduler_elab:Funcs.day_work_11',
-            'args': '',
-            'trigger': 'cron',
-            'day_of_week': '*',
-            'hour': jianye__house_hour,
-            'minute': jianye_house_minute
-        },
-        {
-            'id': 'day_work_12',
-            'func': 'apscheduler_elab:Funcs.day_work_12',
-            'args': '',
-            'trigger': 'cron',
-            'day_of_week': '*',
-            'hour': jianye_brand_hour,
-            'minute': jianye_brand_minute
         }
+        # ,
+        # {
+        #     'id': 'day_work_5',
+        #     'func': 'apscheduler_elab:Funcs.day_work_5',
+        #     'args': '',
+        #     'trigger': 'cron',
+        #     'day_of_week': '*',
+        #     'hour': jianye__house_hour,
+        #     'minute': jianye_house_minute
+        # },
+        # {
+        #     'id': 'day_work_6',
+        #     'func': 'apscheduler_elab:Funcs.day_work_6',
+        #     'args': '',
+        #     'trigger': 'cron',
+        #     'day_of_week': '*',
+        #     'hour': jianye__house_hour,
+        #     'minute': jianye_house_minute
+        # },
+        # {
+        #     'id': 'day_work_7',
+        #     'func': 'apscheduler_elab:Funcs.day_work_7',
+        #     'args': '',
+        #     'trigger': 'cron',
+        #     'day_of_week': '*',
+        #     'hour': jianye__house_hour,
+        #     'minute': jianye_house_minute
+        # },
+        # {
+        #     'id': 'day_work_8',
+        #     'func': 'apscheduler_elab:Funcs.day_work_8',
+        #     'args': '',
+        #     'trigger': 'cron',
+        #     'day_of_week': '*',
+        #     'hour': jianye__house_hour,
+        #     'minute': jianye_house_minute
+        # },
+        # {
+        #     'id': 'day_work_9',
+        #     'func': 'apscheduler_elab:Funcs.day_work_9',
+        #     'args': '',
+        #     'trigger': 'cron',
+        #     'day_of_week': '*',
+        #     'hour': jianye__house_hour,
+        #     'minute': jianye_house_minute
+        # },
+        # {
+        #     'id': 'day_work_10',
+        #     'func': 'apscheduler_elab:Funcs.day_work_10',
+        #     'args': '',
+        #     'trigger': 'cron',
+        #     'day_of_week': '*',
+        #     'hour': jianye__house_hour,
+        #     'minute': jianye_house_minute
+        # },
+        # {
+        #     'id': 'day_work_11',
+        #     'func': 'apscheduler_elab:Funcs.day_work_11',
+        #     'args': '',
+        #     'trigger': 'cron',
+        #     'day_of_week': '*',
+        #     'hour': jianye__house_hour,
+        #     'minute': jianye_house_minute
+        # },
+        # {
+        #     'id': 'day_work_12',
+        #     'func': 'apscheduler_elab:Funcs.day_work_12',
+        #     'args': '',
+        #     'trigger': 'cron',
+        #     'day_of_week': '*',
+        #     'hour': jianye_brand_hour,
+        #     'minute': jianye_brand_minute
+        # }
     ]
 
     # 线程池配置

+ 1 - 3
jianye_report.py

@@ -188,7 +188,7 @@ class JianYeReport(object):
 
     def get_house_pv_data(self, house_id, time_type):
         pv_data = self.get_pv_data(time_type)
-        if pv_data:
+        if pv_data is not None:
             for x in pv_data:
                 if str(x[1]) == str(house_id):
                     return x[3:]
@@ -340,8 +340,6 @@ class JianYeReport(object):
                     print(str(e))
                     #  # name, mail, report_name, push_time, send_status, status, error_message
                     send_mail_log.append([name, mail, title, -1, '数据查询失败:{}'.format(str(e))])
-                if len(send_data) == 2:
-                    break
             message['query_data'] = 'success'
             # 生成文件
             for data in send_data: