3 Commits ffbad8d1dc ... 64bec49ac3

Autor SHA1 Mensaje Fecha
  chenshibin 64bec49ac3 Merge branch 'master' of http://192.168.136.99:3000/servers/ASJPush into test hace 4 años
  chenshibin e7c7c9a022 重置语音提示为127 hace 4 años
  chenshibin d93262d106 修改保存系统表时就不保存到消息表 hace 4 años
Se han modificado 2 ficheros con 33 adiciones y 28 borrados
  1. 32 27
      Controller/DetectControllerV2.py
  2. 1 1
      Controller/ShadowController.py

+ 32 - 27
Controller/DetectControllerV2.py

@@ -286,19 +286,7 @@ class NotificationView(View):
             userID_id = up["userID_id"]
             int_is_st = int(is_st)
             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:
                     sys_msg_text = self.get_msg_text(channel=channel, n_time=n_time, lang=lang, tz=tz,
                                                      event_type=event_type, is_sys=1)
@@ -309,10 +297,26 @@ class NotificationView(View):
                         updTime=now_time,
                         uid=uid,
                         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)
         if is_sys_msg:
             SysMsgModel.objects.bulk_create(sys_msg_list)
-        Equipment_Info.objects.bulk_create(eq_list)
+        else:
+            Equipment_Info.objects.bulk_create(eq_list)
+
         logger.info("图片信息上传到数据库了")
         if is_st == '0' or is_st == '2':
             logger.info("进到is_st为0或2")
@@ -784,19 +788,6 @@ class PushNotificationView(View):
             tz = ua['tz']
             userID_id = ua["userID_id"]
             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:
                     sys_msg_text = self.get_msg_text(channel=channel, n_time=n_time, lang=lang, tz=tz,
                                                      event_type=event_type, is_sys=1)
@@ -807,6 +798,20 @@ class PushNotificationView(View):
                         updTime=now_time,
                         uid=uid,
                         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:
             print('eq_list')
             Equipment_Info.objects.bulk_create(eq_list)

+ 1 - 1
Controller/ShadowController.py

@@ -82,7 +82,7 @@ def update_device_shadow(request):
         uid_channel_qs = UidChannelSetModel.objects.filter(uid__uid=uid)
         if uid_channel_qs.exists():
             uid_channel_qs.update(voice_prompt_intelligent_mute=0, voice_prompt_status=0, voice_prompt_enter=0,
-                           voice_prompt_leave=0)
+                           voice_prompt_leave=0, voice_repeat_day=127)
 
         # 删除uid_set数据
         UidSetModel.objects.filter(uid=uid).delete()