|
@@ -178,7 +178,6 @@ class NotificationView(View):
|
|
|
}
|
|
|
eq_list = []
|
|
|
sys_msg_list = []
|
|
|
- eq_ex_list = []
|
|
|
userID_ids = []
|
|
|
do_apns_code = ''
|
|
|
do_fcm_code = ''
|
|
@@ -200,25 +199,18 @@ class NotificationView(View):
|
|
|
kwag_args['token_val'] = token_val
|
|
|
kwag_args['msg_title'] = msg_title
|
|
|
kwag_args['msg_text'] = msg_text
|
|
|
- push_server_status = 0
|
|
|
#推送
|
|
|
if detect_med_type == 2 or detect_med_type == 0:
|
|
|
if push_type == 0: # ios apns
|
|
|
print('do_apns')
|
|
|
# self.do_apns(**kwag_args)
|
|
|
do_apns_code = self.do_apns(**kwag_args)
|
|
|
- if isinstance(do_apns_code, int):
|
|
|
- push_server_status = do_apns_code
|
|
|
- else:
|
|
|
- push_server_status = 400
|
|
|
elif push_type == 1: # android gcm
|
|
|
print('do_fcm')
|
|
|
do_fcm_code = self.do_fcm(**kwag_args)
|
|
|
- push_server_status = 200
|
|
|
elif push_type == 2: # android jpush
|
|
|
print('do_jpush')
|
|
|
do_jpush_code = self.do_jpush(**kwag_args)
|
|
|
- push_server_status = do_jpush_code
|
|
|
# return JsonResponse(status=200, data={'code': 0, '状态:': self.do_jpush(**kwag_args)})
|
|
|
if detect_med_type == 1:
|
|
|
do_apns_code = '只存库不推送'
|
|
@@ -238,9 +230,6 @@ class NotificationView(View):
|
|
|
alarm='Motion \tChannel:{channel}'.format(channel=channel),
|
|
|
is_st=int_is_st,
|
|
|
receiveTime=n_time,
|
|
|
- message_id='',
|
|
|
- push_type=push_type,
|
|
|
- push_server_status=push_server_status,
|
|
|
addTime=now_time
|
|
|
))
|
|
|
if is_sys_msg:
|
|
@@ -257,7 +246,6 @@ class NotificationView(View):
|
|
|
if is_sys_msg:
|
|
|
SysMsgModel.objects.bulk_create(sys_msg_list)
|
|
|
Equipment_Info.objects.bulk_create(eq_list)
|
|
|
-
|
|
|
if is_st == '0' or is_st == '2':
|
|
|
print("is_st=0or2")
|
|
|
for up in redis_list:
|