瀏覽代碼

云存短信提示 尊重-> 尊敬

locky 4 年之前
父節點
當前提交
d2f203e87e
共有 1 個文件被更改,包括 26 次插入28 次删除
  1. 26 28
      Controller/CloudStorage.py

+ 26 - 28
Controller/CloudStorage.py

@@ -790,8 +790,8 @@ class CloudStorageView(View):
 
                     order_qs.update(status=1, updTime=nowTime, uid_bucket_id=uid_bucket_id)
                     datetime = time.strftime("%Y-%m-%d", time.localtime())
-                    sys_msg_text_list = ['尊重的客户,您的'+UID+'设备在'+datetime+'已成功购买云存套餐,特此通知。', 'Dear customer, your '+UID+' device has successfully purchased the cloud storage package at '+datetime+', hereby notified.']
-                    self.do_vod_msg_Notice(UID, channel, userid, lang, sys_msg_text_list)
+                    sys_msg_text_list = ['温馨提示:尊敬的客户,您的'+UID+'设备在'+datetime+'已成功购买云存套餐', 'Warm tips: Dear customers, your '+UID+' device has successfully purchased the cloud storage package in '+datetime]
+                    self.do_vod_msg_Notice(UID, channel, userid, lang, sys_msg_text_list, 'SMS_219738485')
                     red_url = "{SERVER_DOMAIN_SSL}web/paid2/success.html".format(SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL)
                     if lang != 'cn':
                         red_url = "{SERVER_DOMAIN_SSL}web/paid2/en_success.html".format(SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL)
@@ -896,10 +896,10 @@ class CloudStorageView(View):
 
                 order_qs.update(status=1, updTime=nowTime, uid_bucket_id=uid_bucket_id)
                 datetime = time.strftime("%Y-%m-%d", time.localtime())
-                sys_msg_text_list = ['尊重的客户,您的' + UID + '设备在' + datetime + '已成功购买云存套餐,特此通知。',
-                                     'Dear customer, your ' + UID + ' device has successfully purchased the cloud storage package at ' + datetime + ', hereby notified.']
+                sys_msg_text_list = ['温馨提示:尊敬的客户,您的' + UID + '设备在' + datetime + '已成功购买云存套餐',
+                                     'Warm tips: Dear customers, your '+UID+' device has successfully purchased the cloud storage package in '+datetime]
 
-                self.do_vod_msg_Notice(UID, channel, userid, lang, sys_msg_text_list)
+                self.do_vod_msg_Notice(UID, channel, userid, lang, sys_msg_text_list, 'SMS_219738485')
 
                 # return response.json(0)
                 red_url = "{SERVER_DOMAIN_SSL}web/paid2/success.html".format(SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL)
@@ -999,9 +999,9 @@ class CloudStorageView(View):
 
                     order_qs.update(status=1, updTime=nowTime, uid_bucket_id=uid_bucket_id)
                     datetime = time.strftime("%Y-%m-%d", time.localtime())
-                    sys_msg_text_list = ['尊重的客户,您的' + UID + '设备在' + datetime + '已成功购买云存套餐,特此通知。',
-                                         'Dear customer, your ' + UID + ' device has successfully purchased the cloud storage package at ' + datetime + ', hereby notified.']
-                    self.do_vod_msg_Notice(UID, channel, userid, lang, sys_msg_text_list)
+                    sys_msg_text_list = ['温馨提示:尊敬的客户,您的' + UID + '设备在' + datetime + '已成功购买云存套餐',
+                                         'Warm tips: Dear customers, your '+UID+' device has successfully purchased the cloud storage package in '+datetime]
+                    self.do_vod_msg_Notice(UID, channel, userid, lang, sys_msg_text_list, 'SMS_219738485')
                     return HttpResponse(pay.xml_to_dict({'return_code': 'SUCCESS', 'return_msg': 'OK'}))
             else:
                 order_qs.update(status=10)
@@ -1278,10 +1278,10 @@ class CloudStorageView(View):
                 #         'user_id': userID
                 #     }
                 #     UIDMainUser.objects.create(**uid_main_dict)
-
+                sms = 'SMS_219738485'
                 datetime = time.strftime("%Y-%m-%d", time.localtime())
-                sys_msg_text_list = ['尊重的客户,您的' + uid + '设备在' + datetime + '已成功购买云存套餐,特此通知。',
-                                     'Dear customer, your ' + uid + ' device has successfully purchased the cloud storage package at ' + datetime + ', hereby notified.']
+                sys_msg_text_list = ['温馨提示:尊敬的客户,您的' + uid + '设备在' + datetime + '已成功购买云存套餐',
+                                     'Warm tips: Dear customers, your '+uid+' device has successfully purchased the cloud storage package in '+datetime]
                 # return response.json(0)
                 returnurl = "{SERVER_DOMAIN_SSL}cloudstorage/payOK?lang={lang}".format(SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL,lang=lang)
                 if pay_type == 10:
@@ -1292,9 +1292,9 @@ class CloudStorageView(View):
                     )
                     returnurl = "{SERVER_DOMAIN_SSL}cloudstorage/payOK?paytype=10&lang={lang}".format(SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL,lang=lang)
                     datetime = time.strftime("%Y-%m-%d", time.localtime())
-                    sys_msg_text_list = ['尊重的客户,您的' + uid + '设备在' + datetime + '已成功体验云存,特此通知。',
-                                         'Dear customers, your '+uid+' device has successfully experienced cloud storage at '+datetime+', hereby notified.']
-
+                    sys_msg_text_list = ['温馨提示:尊敬的客户,您的' + uid + '设备在' + datetime + '已成功体验云存',
+                                         'Warm tips: respected customers, your '+uid+' device has successfully experienced cloud storage in '+datetime]
+                    sms = 'SMS_219743364'
                 if pay_type == 11:
                     update_dict = {}
                     update_dict['is_activate'] = 1
@@ -1303,11 +1303,11 @@ class CloudStorageView(View):
                     returnurl = "{SERVER_DOMAIN_SSL}cloudstorage/payOK?paytype=11&lang={lang}".format(SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL,lang=lang)
 
                     datetime = time.strftime("%Y-%m-%d", time.localtime())
-                    sys_msg_text_list = ['尊重的客户,您的' + uid + '设备在' + datetime + '已成功兑换云存,特此通知。',
-                                         'Dear customer, your '+uid+' device has been redeemed for cloud deposit at '+datetime+', hereby notified.']
-
+                    sys_msg_text_list = ['温馨提示:尊敬的客户,您的' + uid + '设备在' + datetime + '已成功兑换云存',
+                                         'Warm tips: Dear customers, your '+uid+' device has been successfully converted to cloud deposit at '+datetime]
+                    sms = 'SMS_219748439'
 
-                self.do_vod_msg_Notice(uid, channel, userID, lang, sys_msg_text_list)
+                self.do_vod_msg_Notice(uid, channel, userID, lang, sys_msg_text_list, sms)
                 result = returnurl
                 return response.json(0, result)
         except Exception:
@@ -1434,7 +1434,7 @@ class CloudStorageView(View):
         return response.json(444)
 
     # 云存操作系统消息
-    def do_vod_msg_Notice(self, uid, channel, userID, lang, sys_msg_text_list):
+    def do_vod_msg_Notice(self, uid, channel, userID, lang, sys_msg_text_list, sms):
         try:
             logger = logging.getLogger('log')
             logger.info('进来了')
@@ -1455,10 +1455,10 @@ class CloudStorageView(View):
                 username = user.username
                 data_valid = DataValid()
                 if data_valid.email_validate(username):
-                    S3Email.faEmail(sys_msg_text,username)
+                    S3Email().faEmail(sys_msg_text, username)
                 elif data_valid.mobile_validate(username):
                     params = u'{"devname":"' + uid + '","submittime":"' + time.strftime("%Y-%m-%d",time.localtime()) + '"}'
-                    self.sendMessage(username, params, 'SMS_217405528')
+                    self.sendMessage(username, params, sms)
 
                 self.pushApp(nowTime, uid, channel, sys_msg_text)
 
@@ -1491,10 +1491,9 @@ class CloudStorageView(View):
             for oo in oqlist:
                 if ub['id'] == oo['uid_bucket_id']:
                     if ub['bucket__area'] == 'cn':
-                        sys_msg_text = "尊重的客户,您" + ub['uid'] + "设备的云存套餐将在" + time.strftime("%Y-%m-%d", time.localtime(ub['endTime'])) + "到期,特此通知。"
+                        sys_msg_text = "温馨提示:尊敬的客户,您" + ub['uid'] + "设备的云存套餐将在" + time.strftime("%Y-%m-%d", time.localtime(ub['endTime'])) + "到期"
                     else:
-                        sys_msg_text = "Dear customer, the cloud storage package of your " + ub[
-                            'uid'] + " device will expire in " + time.strftime("%Y-%m-%d", time.localtime(ub['endTime'])) + ", hereby notified."
+                        sys_msg_text = "Warm tips: Dear customers, the cloud storage package of your " + ub['uid'] + " device will expire at " + time.strftime("%Y-%m-%d", time.localtime(ub['endTime']))
                     uq_list.append(SysMsgModel(
                         userID_id=oo['userID_id'],
                         addTime=now_time,
@@ -1512,12 +1511,11 @@ class CloudStorageView(View):
                         data_valid = DataValid()
 
                         if data_valid.email_validate(username):
-                            S3Email.faEmail(sys_msg_text, username)
+                            S3Email().faEmail(sys_msg_text, username)
                         elif data_valid.mobile_validate(username):
                             params = u'{"devname":"' + ub['uid'] + '","submittime":"' + time.strftime("%Y-%m-%d",
-                                                                                                      ub[
-                                                                                                          'endTime']) + '"}'
-                            self.sendMessage(username, params, 'SMS_217425550')
+                                                                                                      time.localtime(ub['endTime'])) + '"}'
+                            self.sendMessage(username, params, 'SMS_219748440')
 
                         self.pushApp(now_time, ub['uid'], ub['channel'], sys_msg_text)