|
@@ -127,6 +127,21 @@ class DevicePushService:
|
|
'uid_set__msg_notify', 'jg_token_val')
|
|
'uid_set__msg_notify', 'jg_token_val')
|
|
return uid_push_qs
|
|
return uid_push_qs
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
+ def get_uid_push_by_uid(cls, uid):
|
|
|
|
+ """
|
|
|
|
+ 根据uid获取设备推送(目前仅用在OZI定制客户)
|
|
|
|
+ """
|
|
|
|
+ device_info_qs = Device_Info.objects.filter(UID=uid).values('vodPrimaryUserID')
|
|
|
|
+ primary_user_id = device_info_qs[0]['vodPrimaryUserID']
|
|
|
|
+ uid_push_qs = UidPushModel.objects.filter(uid_set__uid=uid, userID_id=primary_user_id) \
|
|
|
|
+ .exclude(token_val='0'). \
|
|
|
|
+ values('token_val', 'app_type', 'appBundleId', 'm_code', 'push_type', 'userID_id', 'userID__NickName',
|
|
|
|
+ 'lang', 'm_code', 'tz', 'uid_set__nickname', 'uid_set__detect_interval', 'uid_set__detect_group',
|
|
|
|
+ 'uid_set__channel', 'uid_set__ai_type', 'uid_set__device_type', 'uid_set__new_detect_interval',
|
|
|
|
+ 'uid_set__msg_notify', 'jg_token_val')
|
|
|
|
+ return uid_push_qs
|
|
|
|
+
|
|
@staticmethod
|
|
@staticmethod
|
|
def qs_to_list(qs):
|
|
def qs_to_list(qs):
|
|
"""
|
|
"""
|
|
@@ -169,8 +184,8 @@ class DevicePushService:
|
|
cls.is_send_app_push(
|
|
cls.is_send_app_push(
|
|
params['event_type'], params['event_tag'], params['app_push_config'], params['app_push'], uid)
|
|
params['event_type'], params['event_tag'], params['app_push_config'], params['app_push'], uid)
|
|
|
|
|
|
- # 低功耗产品推送,休眠702、低电量704提醒,并且detection=0,0标识单事件类型,1标识多事件类型
|
|
|
|
- is_app_push = True if params['event_type'] in [702, 704] and params['detection'] == 0 else is_app_push
|
|
|
|
|
|
+ # 低功耗产品推送,休眠702,低电量704提醒,515 ozi, 并且detection=0,0标识单事件类型,1标识多事件类型
|
|
|
|
+ is_app_push = True if params['event_type'] in [702, 704, 515] and params['detection'] == 0 else is_app_push
|
|
redis_obj = params['redis_obj']
|
|
redis_obj = params['redis_obj']
|
|
# 推送
|
|
# 推送
|
|
if is_app_push:
|
|
if is_app_push:
|
|
@@ -562,6 +577,8 @@ class DevicePushService:
|
|
msg_type = '有人徘徊'
|
|
msg_type = '有人徘徊'
|
|
elif event_type == 65:
|
|
elif event_type == 65:
|
|
msg_type = '长时间无人出现'
|
|
msg_type = '长时间无人出现'
|
|
|
|
+ elif event_type == 515:
|
|
|
|
+ msg_type = '儿童保护模式开启'
|
|
|
|
|
|
elif event_type == 704:
|
|
elif event_type == 704:
|
|
msg_type = '电量低'
|
|
msg_type = '电量低'
|
|
@@ -615,6 +632,8 @@ class DevicePushService:
|
|
msg_type = 'Loitering detected'
|
|
msg_type = 'Loitering detected'
|
|
elif event_type == 65:
|
|
elif event_type == 65:
|
|
msg_type = 'No appearance for a long time'
|
|
msg_type = 'No appearance for a long time'
|
|
|
|
+ elif event_type == 515:
|
|
|
|
+ msg_type = 'Child protection mode is enabled'
|
|
|
|
|
|
elif event_type == 704:
|
|
elif event_type == 704:
|
|
msg_type = 'low battery'
|
|
msg_type = 'low battery'
|