|
@@ -286,19 +286,7 @@ class NotificationView(View):
|
|
userID_id = up["userID_id"]
|
|
userID_id = up["userID_id"]
|
|
int_is_st = int(is_st)
|
|
int_is_st = int(is_st)
|
|
if userID_id not in userID_ids:
|
|
if userID_id not in userID_ids:
|
|
- eq_list.append(Equipment_Info(
|
|
|
|
- userID_id=userID_id,
|
|
|
|
- eventTime=n_time,
|
|
|
|
- eventType=event_type,
|
|
|
|
- devUid=uid,
|
|
|
|
- devNickName=nickname,
|
|
|
|
- Channel=channel,
|
|
|
|
- alarm='Motion \tChannel:{channel}'.format(channel=channel),
|
|
|
|
- is_st=int_is_st,
|
|
|
|
- receiveTime=n_time,
|
|
|
|
- addTime=now_time,
|
|
|
|
- storage_location=2
|
|
|
|
- ))
|
|
|
|
|
|
+
|
|
if is_sys_msg:
|
|
if is_sys_msg:
|
|
sys_msg_text = self.get_msg_text(channel=channel, n_time=n_time, lang=lang, tz=tz,
|
|
sys_msg_text = self.get_msg_text(channel=channel, n_time=n_time, lang=lang, tz=tz,
|
|
event_type=event_type, is_sys=1)
|
|
event_type=event_type, is_sys=1)
|
|
@@ -309,10 +297,26 @@ class NotificationView(View):
|
|
updTime=now_time,
|
|
updTime=now_time,
|
|
uid=uid,
|
|
uid=uid,
|
|
eventType=event_type))
|
|
eventType=event_type))
|
|
|
|
+ else:
|
|
|
|
+ eq_list.append(Equipment_Info(
|
|
|
|
+ userID_id=userID_id,
|
|
|
|
+ eventTime=n_time,
|
|
|
|
+ eventType=event_type,
|
|
|
|
+ devUid=uid,
|
|
|
|
+ devNickName=nickname,
|
|
|
|
+ Channel=channel,
|
|
|
|
+ alarm='Motion \tChannel:{channel}'.format(channel=channel),
|
|
|
|
+ is_st=int_is_st,
|
|
|
|
+ receiveTime=n_time,
|
|
|
|
+ addTime=now_time,
|
|
|
|
+ storage_location=2
|
|
|
|
+ ))
|
|
userID_ids.append(userID_id)
|
|
userID_ids.append(userID_id)
|
|
if is_sys_msg:
|
|
if is_sys_msg:
|
|
SysMsgModel.objects.bulk_create(sys_msg_list)
|
|
SysMsgModel.objects.bulk_create(sys_msg_list)
|
|
- Equipment_Info.objects.bulk_create(eq_list)
|
|
|
|
|
|
+ else:
|
|
|
|
+ Equipment_Info.objects.bulk_create(eq_list)
|
|
|
|
+
|
|
logger.info("图片信息上传到数据库了")
|
|
logger.info("图片信息上传到数据库了")
|
|
if is_st == '0' or is_st == '2':
|
|
if is_st == '0' or is_st == '2':
|
|
logger.info("进到is_st为0或2")
|
|
logger.info("进到is_st为0或2")
|
|
@@ -784,19 +788,6 @@ class PushNotificationView(View):
|
|
tz = ua['tz']
|
|
tz = ua['tz']
|
|
userID_id = ua["userID_id"]
|
|
userID_id = ua["userID_id"]
|
|
if userID_id not in userID_ids:
|
|
if userID_id not in userID_ids:
|
|
- eq_list.append(Equipment_Info(
|
|
|
|
- userID_id=userID_id,
|
|
|
|
- eventTime=n_time,
|
|
|
|
- eventType=event_type,
|
|
|
|
- devUid=uid,
|
|
|
|
- devNickName=nickname,
|
|
|
|
- Channel=channel,
|
|
|
|
- alarm='Motion \tChannel:{channel}'.format(channel=channel),
|
|
|
|
- is_st=is_st,
|
|
|
|
- receiveTime=n_time,
|
|
|
|
- addTime=now_time,
|
|
|
|
- storage_location=2
|
|
|
|
- ))
|
|
|
|
if is_sys_msg:
|
|
if is_sys_msg:
|
|
sys_msg_text = self.get_msg_text(channel=channel, n_time=n_time, lang=lang, tz=tz,
|
|
sys_msg_text = self.get_msg_text(channel=channel, n_time=n_time, lang=lang, tz=tz,
|
|
event_type=event_type, is_sys=1)
|
|
event_type=event_type, is_sys=1)
|
|
@@ -807,6 +798,20 @@ class PushNotificationView(View):
|
|
updTime=now_time,
|
|
updTime=now_time,
|
|
uid=uid,
|
|
uid=uid,
|
|
eventType=event_type))
|
|
eventType=event_type))
|
|
|
|
+ else:
|
|
|
|
+ eq_list.append(Equipment_Info(
|
|
|
|
+ userID_id=userID_id,
|
|
|
|
+ eventTime=n_time,
|
|
|
|
+ eventType=event_type,
|
|
|
|
+ devUid=uid,
|
|
|
|
+ devNickName=nickname,
|
|
|
|
+ Channel=channel,
|
|
|
|
+ alarm='Motion \tChannel:{channel}'.format(channel=channel),
|
|
|
|
+ is_st=is_st,
|
|
|
|
+ receiveTime=n_time,
|
|
|
|
+ addTime=now_time,
|
|
|
|
+ storage_location=2
|
|
|
|
+ ))
|
|
if eq_list:
|
|
if eq_list:
|
|
print('eq_list')
|
|
print('eq_list')
|
|
Equipment_Info.objects.bulk_create(eq_list)
|
|
Equipment_Info.objects.bulk_create(eq_list)
|