Ver código fonte

取消表3的发送

Signed-off-by: binren <zhangbr@elab-plus.com>
binren 4 anos atrás
pai
commit
b2c8bfe58d
1 arquivos alterados com 22 adições e 18 exclusões
  1. 22 18
      jianye_report.py

+ 22 - 18
jianye_report.py

@@ -317,12 +317,15 @@ class JianYeReport(object):
                     elif customer_type == 1:
                         title_1, title_2 = title[0], title[1]
                         table_2 = self.house_data(self.get_house_ids(ids))
-                        table_3 = self.get_table_3(self.get_house_ids(ids))
+                        # table_3 = self.get_table_3(self.get_house_ids(ids))
                         file_path = save_path + '/' + title_1 + '.xls'
                         file_path_1 = save_path + '/' + title_2 + '.xls'
                         send_data.append(
                             [table_2, self.sheet_names_1, title_1, [self.head_1, self.head_1, self.head_1], file_path,
-                             content, name, mail, title_2, [self.head_2, self.head_2, self.head_2], table_3, file_path_1])
+                             content, name, mail])
+                        # send_data.append(
+                        #     [table_2, self.sheet_names_1, title_1, [self.head_1, self.head_1, self.head_1], file_path,
+                        #      content, name, mail, title_2, [self.head_2, self.head_2, self.head_2], table_3, file_path_1])
                     elif customer_type == 3:
                         file_path = save_path + '/' + title + '.xls'
                         table_2 = self.house_data(self.get_house_ids(ids))
@@ -412,13 +415,16 @@ class JianYeReport(object):
                         # 项目
                         title_1, title_2 = title[0], title[1]
                         table_2 = self.house_data(ids)
-                        table_3 = self.get_table_3(ids)
+                        # table_3 = self.get_table_3(ids)
                         file_path = save_path + '/' + title_1 + '.xls'
                         file_path_1 = save_path + '/' + title_2 + '.xls'
                         send_data.append(
                             [table_2, self.sheet_names_1, title_1, [self.head_1, self.head_1, self.head_1], file_path,
-                             content, name, mail, title_2, [self.head_2, self.head_2, self.head_2], table_3,
-                             file_path_1])
+                             content, name, mail])
+                        # send_data.append(
+                        #     [table_2, self.sheet_names_1, title_1, [self.head_1, self.head_1, self.head_1], file_path,
+                        #      content, name, mail, title_2, [self.head_2, self.head_2, self.head_2], table_3,
+                        #      file_path_1])
                     elif customer_type == 2:
                         # 集团
                         file_path = save_path + '/' + title + '.xls'
@@ -452,10 +458,8 @@ class JianYeReport(object):
                 try:
                     send_mai_info_sub = []
                     rfu.create_excel_file(data[0], data[1], data[2], data[3], data[4])
-                    # [title, content, mail, file_path, title + '.xlsx', name]
                     send_mai_info_sub.extend([data[2], data[5], data[7], data[4], data[2] + '.xls', data[6]])
                     if len(data) == 12:
-                        #  data, sheet_names, title, headers, file_path
                         rfu.create_excel_file(data[10], data[1], data[8], data[9], data[11])
                         send_mai_info_sub.extend([data[11], data[8] + '.xls'])
                     send_mail_info.append(send_mai_info_sub)
@@ -487,17 +491,17 @@ class JianYeReport(object):
 
     def send_mail(self, mail, send_mail_log):
         result = None
-        for m in self.customer_mails:
-            if len(mail) == 6:
-                result = self.mail_util.send_mail_by_admin(mail[0], mail[1], m, mail[3], mail[4])
-            elif len(mail) == 8:
-                result = self.mail_util.send_mail_by_admin(mail[0], mail[1], m, mail[3], mail[4], mail[6],
-                                                      mail[7])
-            if result:
-                # name, mail, report_name, push_time, send_status, status, error_message
-                send_mail_log.append([mail[5], mail[2], mail[3], 1, 'success'])
-            else:
-                send_mail_log.append([mail[5], mail[2], mail[3], -1, '调用邮件接口失败:{}'.format(str(result))])
+        # for m in self.customer_mails:
+        if len(mail) == 6:
+            result = self.mail_util.send_mail_by_admin(mail[0], mail[1], mail[2], mail[3], mail[4])
+        elif len(mail) == 8:
+            result = self.mail_util.send_mail_by_admin(mail[0], mail[1], mail[2], mail[3], mail[4], mail[6],
+                                                  mail[7])
+        if result:
+            # name, mail, report_name, push_time, send_status, status, error_message
+            send_mail_log.append([mail[5], mail[2], mail[3], 1, 'success'])
+        else:
+            send_mail_log.append([mail[5], mail[2], mail[3], -1, '调用邮件接口失败:{}'.format(str(result))])
         return send_mail_log
 
     def get_house_ids(self, ids_str):