Browse Source

添加语音提示的坐标、执行时间字段

tanghongbin 4 years ago
parent
commit
b9101b988b
3 changed files with 41 additions and 5 deletions
  1. 25 1
      Controller/UidSetController.py
  2. 9 4
      Controller/VoicePromptController.py
  3. 7 0
      Model/models.py

+ 25 - 1
Controller/UidSetController.py

@@ -419,6 +419,12 @@ class UidSetView(View):
         leave_voice = request_dict.get('leave_voice', None)
         voice_status = request_dict.get('voice_status', None)
         intelligent_mute = request_dict.get('intelligent_mute', None)
+        start_x = request_dict.get('start_x', None)
+        start_y = request_dict.get('start_y', None)
+        end_x = request_dict.get('end_x', None)
+        end_y = request_dict.get('end_y', None)
+        start_time = request_dict.get('start_time', None)
+        end_time = request_dict.get('end_time', None)
 
         if uid and channel:
             channel = int(channel)
@@ -436,7 +442,25 @@ class UidSetView(View):
                     ucs['voice_prompt_status'] = voice_status
 
                 if intelligent_mute:
-                    ucs['intelligent_mute'] = intelligent_mute
+                    ucs['voice_prompt_intelligent_mute'] = intelligent_mute
+
+                if start_x:
+                    ucs['voice_start_x'] = start_x
+
+                if start_y:
+                    ucs['voice_start_y'] = start_y
+
+                if end_x:
+                    ucs['voice_end_x'] = end_x
+
+                if end_y:
+                    ucs['voice_end_y'] = end_y
+
+                if start_time:
+                    ucs['voice_start_time'] = start_time
+
+                if end_time:
+                    ucs['voice_end_time'] = end_time
 
                 uid_channel_set_qs = UidChannelSetModel.objects.filter(uid__uid=uid, channel=channel)
                 if not uid_channel_set_qs.exists():

+ 9 - 4
Controller/VoicePromptController.py

@@ -129,12 +129,20 @@ class VoicePromptView(View):
                 'voice_mute': 0
             }
             if channel_qs.exists():
-                channel_qs = channel_qs.values('voice_prompt_enter', 'voice_prompt_leave', 'voice_prompt_status', 'voice_prompt_intelligent_mute')
+                channel_qs = channel_qs.values('voice_prompt_enter', 'voice_prompt_leave', 'voice_prompt_status',
+                                               'voice_prompt_intelligent_mute', 'voice_start_x', 'voice_start_y',
+                                               'voice_end_x', 'voice_end_y', 'voice_start_time', 'voice_end_time')
                 print(channel_qs)
                 res['enter_voice'] = channel_qs[0]['voice_prompt_enter']
                 res['leave_voice'] = channel_qs[0]['voice_prompt_leave']
                 res['voice_status'] = channel_qs[0]['voice_prompt_status']
                 res['voice_mute'] = channel_qs[0]['voice_prompt_intelligent_mute']
+                res['start_x'] = channel_qs[0]['voice_start_x']
+                res['start_y'] = channel_qs[0]['voice_start_y']
+                res['end_x'] = channel_qs[0]['voice_end_x']
+                res['end_y'] = channel_qs[0]['voice_end_y']
+                res['start_time'] = channel_qs[0]['voice_start_time']
+                res['end_time'] = channel_qs[0]['voice_end_time']
 
             enter_systems = []
             leave_systems = []
@@ -163,9 +171,6 @@ class VoicePromptView(View):
                         if res['leave_voice'] == system['id']:
                             res['leave_voice'] = system
 
-
-
-
             if voice_qs.exists():
                 voice_qs = voice_qs.values('id', 'title', 'filename', 'type')
 

+ 7 - 0
Model/models.py

@@ -744,6 +744,13 @@ class UidChannelSetModel(models.Model):
     voice_prompt_enter = models.IntegerField(default=0, verbose_name='进入铃声id')
     voice_prompt_leave = models.IntegerField(default=0, verbose_name='离开铃声id')
     voice_prompt_intelligent_mute = models.SmallIntegerField(default=0, verbose_name='智能静音。0:关闭,1:开启')
+    voice_start_x = models.FloatField(default=0, verbose_name='起始坐标的x')
+    voice_start_y = models.FloatField(default=0, verbose_name='起始坐标的y')
+    voice_end_x = models.FloatField(default=0, verbose_name='结束坐标的x')
+    voice_end_y = models.FloatField(default=0, verbose_name='结束坐标的y')
+    voice_start_time = models.IntegerField(default=0, verbose_name='语音执行的起始时间')
+    voice_end_time = models.IntegerField(default=0, verbose_name='语音执行的结束时间')
+    voice_repeat_day = models.IntegerField(default=0, verbose_name='语音执行的日期,周几')
 
     class Meta:
         db_table = 'uid_channel'