|
@@ -110,9 +110,9 @@ class DevicePushService:
|
|
|
kwag_args = params['kwag_args']
|
|
|
code_data = {'do_apns_code': '', 'do_fcm_code': '', 'do_jpush_code': ''}
|
|
|
local_date_time = ''
|
|
|
- push_permission = True
|
|
|
+ # push_permission = True
|
|
|
try:
|
|
|
- params['event_tag'] = cls.get_event_tag(params['ai_type'], params['event_type'])
|
|
|
+ params['event_tag'] = cls.get_event_tag(params['ai_type'], params['event_type'], params['detection'])
|
|
|
for up in uid_set_push_list:
|
|
|
appBundleId = up['appBundleId']
|
|
|
token_val = up['token_val']
|
|
@@ -168,19 +168,24 @@ class DevicePushService:
|
|
|
LOGGING.info('推送消息或存表异常: errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
|
|
@classmethod
|
|
|
- def get_event_tag(cls, ai_type, event_type):
|
|
|
+ def get_event_tag(cls, ai_type, event_type, detection=0):
|
|
|
"""
|
|
|
获取事件标签
|
|
|
"""
|
|
|
- if ai_type > 0:
|
|
|
- event_res = DEVICE_EVENT_TYPE.get(event_type, 0)
|
|
|
- if event_res > 0:
|
|
|
- return ',' + str(event_res) + ','
|
|
|
- event_type = cls.dec_to_bin(event_type)
|
|
|
- types = cls.get_combo_types(event_type)
|
|
|
- res = ','.join(types) + ','
|
|
|
- return ',' + res
|
|
|
- return ',' + str(event_type) + ','
|
|
|
+ algorithm = False
|
|
|
+ if ai_type > 0 and detection == 1:
|
|
|
+ algorithm = True
|
|
|
+ elif ai_type == 7 or event_type == 47:
|
|
|
+ algorithm = True
|
|
|
+ if not algorithm:
|
|
|
+ return ',' + str(event_type) + ','
|
|
|
+ event_res = DEVICE_EVENT_TYPE.get(event_type, 0)
|
|
|
+ if event_res > 0:
|
|
|
+ return ',' + str(event_res) + ','
|
|
|
+ event_type = cls.dec_to_bin(event_type)
|
|
|
+ types = cls.get_combo_types(event_type)
|
|
|
+ res = ','.join(types) + ','
|
|
|
+ return ',' + res
|
|
|
|
|
|
@classmethod
|
|
|
def get_combo_types(cls, event_type):
|