|
@@ -12,7 +12,7 @@ class JianYeReport(object):
|
|
|
建业报表数据处理
|
|
|
"""
|
|
|
# customer_mails = ['liutt@elab-plus.com', 'binrenzhang@qq.com', 'plf@centralchina.com']
|
|
|
- customer_mails = ['liutt@elab-plus.com', 'binrenzhang@qq.com', 'zhuyl@elab-plus.com', 'lijm@elab-plus.com', 'xuanxc@elab-plus.com']
|
|
|
+ customer_mails = ['liutt@elab-plus.com', 'binrenzhang@qq.com', 'lijm@elab-plus.com', 'xuanxc@elab-plus.com']
|
|
|
|
|
|
#
|
|
|
index_type = [
|
|
@@ -385,7 +385,7 @@ class JianYeReport(object):
|
|
|
def get_customer_info_by_id(self, customer_id):
|
|
|
return self.db.select(Sql.sql_14, [customer_id])
|
|
|
|
|
|
- def send_mail_for_customer_id(self, customer_id, task_key=None, new_mail=None):
|
|
|
+ def send_mail_for_customer_id(self, customer_id, new_mail=None):
|
|
|
"""
|
|
|
获取指定客户的邮件信息
|
|
|
:param customer_id:
|
|
@@ -393,11 +393,7 @@ class JianYeReport(object):
|
|
|
:return:
|
|
|
"""
|
|
|
message = {}
|
|
|
- customers = []
|
|
|
- if task_key:
|
|
|
- customers = self.get_report_customers(task_key)
|
|
|
- else:
|
|
|
- customers = self.get_customer_info_by_id(customer_id)
|
|
|
+ customers = self.get_customer_info_by_id(customer_id)
|
|
|
message['customer'] = str(customer_id)
|
|
|
send_data = []
|
|
|
if customers:
|
|
@@ -491,17 +487,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], 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))])
|
|
|
+ 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))])
|
|
|
return send_mail_log
|
|
|
|
|
|
def get_house_ids(self, ids_str):
|