Merge branch 'master' of http://210.77.77.77/xieshen/newmediamonitoring
This commit is contained in:
commit
f2a580b521
|
@ -5,4 +5,4 @@ class PollsConfig(AppConfig):
|
||||||
name = 'polls'
|
name = 'polls'
|
||||||
|
|
||||||
def ready(self):
|
def ready(self):
|
||||||
tasks.process_notify_task(repeat=5)
|
pass
|
|
@ -20,10 +20,10 @@ def process_notify_task():
|
||||||
exists = SMSNotifyRecord.objects.filter(
|
exists = SMSNotifyRecord.objects.filter(
|
||||||
phone=phone, added=today, notice_id=n.id).exists()
|
phone=phone, added=today, notice_id=n.id).exists()
|
||||||
if exists:
|
if exists:
|
||||||
return
|
break
|
||||||
if hour < 8 or hour > 20:
|
if hour < 8 or hour > 20:
|
||||||
return
|
break
|
||||||
print('============', phone, n.type)
|
print('============', phone, n.type, n.id)
|
||||||
SMSNotifyRecord.objects.create(phone=phone)
|
SMSNotifyRecord.objects.create(phone=phone, notice_id=n.id)
|
||||||
sent_sms_notify(phone, n.type)
|
sent_sms_notify(phone, n.type)
|
||||||
print('end task', time.process_time() - start)
|
print('end task', time.process_time() - start)
|
||||||
|
|
|
@ -73,4 +73,6 @@ urlpatterns = [
|
||||||
path('app/intro.html', views.app_intro, name='polls_app_intro'),
|
path('app/intro.html', views.app_intro, name='polls_app_intro'),
|
||||||
path('app/download/', views.download, name='polls_app_download'),
|
path('app/download/', views.download, name='polls_app_download'),
|
||||||
path('app/has/update/', views.has_update, name='polls_app_has_update')
|
path('app/has/update/', views.has_update, name='polls_app_has_update')
|
||||||
]
|
]
|
||||||
|
|
||||||
|
tasks.process_notify_task(repeat=5)
|
|
@ -17,8 +17,8 @@ def sent_sms_code(phone, code):
|
||||||
|
|
||||||
def sent_sms_notify(phone, type):
|
def sent_sms_notify(phone, type):
|
||||||
clnt = YunpianClient('304eb08353f7ebf00596737acfc31f53')
|
clnt = YunpianClient('304eb08353f7ebf00596737acfc31f53')
|
||||||
if type == 0:
|
if type == 1:
|
||||||
param = {YC.MOBILE: phone ,YC.TEXT:'【甘肃大未来科技】政务新媒体管理APP有新消息,请及时登录处理。(若其他管理员已处理,请忽略)'}
|
param = {YC.MOBILE: phone ,YC.TEXT:'【甘肃大未来科技】政务新媒体管理APP有新消息,请及时登录处理。(若其他管理员已处理,请忽略)*测试*'}
|
||||||
else:
|
else:
|
||||||
param = {YC.MOBILE: phone ,YC.TEXT:'【甘肃大未来科技】政务新媒体管理APP有新任务,请及时登录处理。'}
|
param = {YC.MOBILE: phone ,YC.TEXT:'【甘肃大未来科技】政务新媒体管理APP有新任务,请及时登录处理。'}
|
||||||
r = clnt.sms().single_send(param)
|
r = clnt.sms().single_send(param)
|
||||||
|
|
Loading…
Reference in New Issue