|
|
@@ -134,6 +134,7 @@ async def is_close_changed_notice(exf_id: str = '', is_close: str = ''):
|
|
|
print('修改後狀態: 續約(D)')
|
|
|
html += '<div>本合約狀態已修改為 <span style="color:red;">續約</span></div>'
|
|
|
|
|
|
+ '''
|
|
|
# 發送通知給負責業務、CRM、Kevin、Sam
|
|
|
email_list = ['sam@hhh.com.tw','kevin.h@hhh.com.tw', 'miko@hhh.com.tw', 'mollie@hhh.com.tw', 'lynn@hhh.com.tw', 'zoe_lo@hhh.com.tw']
|
|
|
|
|
|
@@ -153,10 +154,12 @@ async def is_close_changed_notice(exf_id: str = '', is_close: str = ''):
|
|
|
if r1['execute_man']:
|
|
|
print('執行單位: ' + r1['execute_man'])
|
|
|
email_list.append(r1['execute_man'])
|
|
|
+ '''
|
|
|
elif is_close == 'E':
|
|
|
print('修改後狀態: 不續約延期(E)')
|
|
|
html += '<div>本合約狀態已修改為 <span style="color:red;">不續約延期</span></div>'
|
|
|
|
|
|
+ '''
|
|
|
# 發送通知給負責業務、CRM、Kevin、Sam
|
|
|
# 以變更後的合約日期來發送通知信
|
|
|
email_list = ['sam@hhh.com.tw','kevin.h@hhh.com.tw', 'miko@hhh.com.tw', 'mollie@hhh.com.tw', 'lynn@hhh.com.tw', 'zoe_lo@hhh.com.tw']
|
|
|
@@ -177,10 +180,12 @@ async def is_close_changed_notice(exf_id: str = '', is_close: str = ''):
|
|
|
if r1['execute_man']:
|
|
|
print('執行單位: ' + r1['execute_man'])
|
|
|
email_list.append(r1['execute_man'])
|
|
|
+ '''
|
|
|
elif is_close == 'F':
|
|
|
print('修改後狀態: 不續約需下線(F)')
|
|
|
html += '<div>本合約狀態已修改為 <span style="color:red;">不續約需下線</span></div>'
|
|
|
|
|
|
+ '''
|
|
|
# 發送通知通知給負責業務、CRM、財務部、Kevin、Sam
|
|
|
email_list = ['sam@hhh.com.tw','kevin.h@hhh.com.tw', 'miko@hhh.com.tw', 'mollie@hhh.com.tw', 'lynn@hhh.com.tw', 'zoe_lo@hhh.com.tw', 'ariel@hhh.com.tw']
|
|
|
|
|
|
@@ -200,6 +205,7 @@ async def is_close_changed_notice(exf_id: str = '', is_close: str = ''):
|
|
|
if r1['execute_man']:
|
|
|
print('執行單位: ' + r1['execute_man'])
|
|
|
email_list.append(r1['execute_man'])
|
|
|
+ '''
|
|
|
elif is_close == 'G':
|
|
|
print('修改後狀態: 已到期未續約(G)')
|
|
|
html += '<div>本合約狀態已修改為 <span style="color:red;">已到期未續約</span></div>'
|
|
|
@@ -210,6 +216,36 @@ async def is_close_changed_notice(exf_id: str = '', is_close: str = ''):
|
|
|
# 負責業務
|
|
|
print('負責業務: ' + r['sales_man'])
|
|
|
email_list.append(r['sales_man'])
|
|
|
+
|
|
|
+ # 列出該合約底下所有執行項目(含已完成、未完成)
|
|
|
+ q1 = "SELECT * \
|
|
|
+ FROM execute_detail \
|
|
|
+ WHERE exf_id=" + exf_id
|
|
|
+
|
|
|
+ q1_result_count = len(list(db.query(q1)))
|
|
|
+
|
|
|
+ if q1_result_count > 0: # 有執行項目
|
|
|
+ html += "<div style='color:blue;'><b>本合約執行項目: 共" + str(q1_result_count) + "筆,如下表:</b><br><br></div>"
|
|
|
+
|
|
|
+ html += "<table style='width:100%;border-collapse: collapse;' border='1'> \
|
|
|
+ <tr style='text-align:left;'> \
|
|
|
+ <th style='width:5%;'>#</th> \
|
|
|
+ <th>大項目</th> \
|
|
|
+ <th>執行項</th> \
|
|
|
+ <th>單位</th> \
|
|
|
+ <th>是否完成</th> \
|
|
|
+ <th>完成人</th> \
|
|
|
+ <th>備註</th> \
|
|
|
+ <th>預計排程日期</th> \
|
|
|
+ <th>第一次提醒日</th> \
|
|
|
+ </tr>";
|
|
|
+
|
|
|
+ idx = 0
|
|
|
+
|
|
|
+ for r1 in db.query(q1):
|
|
|
+ html += "<tr><td>" + str(idx) + "</td><td>" + r1['lv1'] + "</td><td>" + r1['lv2'] + "</td><td>" + r1['execute_man'] + "</td><td>" + r1['is_complete'] + "</td><td>" + r1['complete_man'] + "</td><td>" + r1['note'] + "</td><td>" + str(r1['set_date']) + "</td><td>" + str(r1['alert_date_1']) + "</td></tr>"
|
|
|
+
|
|
|
+ idx += 1
|
|
|
else:
|
|
|
print ('修改後狀態: ' + is_close + ',不需通知')
|
|
|
return
|
|
|
@@ -225,11 +261,10 @@ async def is_close_changed_notice(exf_id: str = '', is_close: str = ''):
|
|
|
for email in email_list: # test
|
|
|
print('寄送Email: ' + email)
|
|
|
|
|
|
- '''
|
|
|
+
|
|
|
# Email清單
|
|
|
email_list = ['mike@choozmo.com']
|
|
|
|
|
|
# 寄送逾期執行表單Email通知
|
|
|
for email in email_list:
|
|
|
- hhh_send_mail(email, subject, html)
|
|
|
- '''
|
|
|
+ hhh_send_mail(email, subject, html)
|